Skip to content

Commit 00c1930

Browse files
committed
feat: upgrade typst to 0.14.1
Close #46
1 parent ece2e38 commit 00c1930

File tree

3 files changed

+114
-115
lines changed

3 files changed

+114
-115
lines changed

pyproject.toml

Lines changed: 78 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,59 @@
22
name = "pyobsplot"
33
version = "0.5.5"
44
description = "Observable Plot in Jupyter notebooks and Quarto documents"
5-
authors = [{ name = "Julien Barnier", email = "julien@nozav.org" }]
6-
license = { file = "LICENSE" }
75
readme = "README.md"
86
requires-python = ">=3.10"
7+
license = { file = "LICENSE" }
8+
authors = [{ name = "Julien Barnier", email = "julien@nozav.org" }]
99
classifiers = [
10-
"Development Status :: 4 - Beta",
11-
"Framework :: Jupyter :: JupyterLab",
12-
"License :: OSI Approved :: MIT License",
13-
"Programming Language :: Python :: 3",
14-
"Programming Language :: JavaScript",
15-
"Topic :: Scientific/Engineering :: Visualization",
10+
"Development Status :: 4 - Beta",
11+
"Framework :: Jupyter :: JupyterLab",
12+
"License :: OSI Approved :: MIT License",
13+
"Programming Language :: JavaScript",
14+
"Programming Language :: Python :: 3",
15+
"Topic :: Scientific/Engineering :: Visualization",
1616
]
1717
dependencies = [
18-
"anywidget>=0.9.18",
19-
"pandas>=2.0.0",
20-
"polars>=1.4.1",
21-
"requests",
22-
"pyarrow>=20.0.0",
18+
"anywidget>=0.9.18",
19+
"pandas>=2.0.0",
20+
"polars>=1.4.1",
21+
"pyarrow>=20.0.0",
22+
"requests",
2323
]
2424

25+
[project.urls]
26+
changelog = "https://github.com/juba/pyobsplot/blob/main/NEWS.md"
27+
documentation = "https://juba.github.io/pyobsplot"
28+
homepage = "https://github.com/juba/pyobsplot"
29+
repository = "https://github.com/juba/pyobsplot"
30+
2531
[project.optional-dependencies]
26-
typst = ["typst>=0.13.2"]
32+
typst = ["typst>=0.14.1"]
2733

2834
[dependency-groups]
2935
dev = [
30-
"anywidget[dev]>=0.9.18",
31-
"pytest>=8.2.1",
32-
"geopandas>=0.14.4",
33-
"jupyterlab>=4.4.1",
34-
"ipykernel>=6.29.5",
35-
"playwright>=1.44.0",
36+
"anywidget[dev]>=0.9.18",
37+
"geopandas>=0.14.4",
38+
"ipykernel>=6.29.5",
39+
"jupyterlab>=4.4.1",
40+
"playwright>=1.44.0",
41+
"pytest>=8.2.1",
3642
]
3743

38-
[tool.uv]
39-
default-groups = "all"
40-
4144
[build-system]
4245
requires = ["hatchling"]
4346
build-backend = "hatchling.build"
4447

45-
46-
[project.urls]
47-
homepage = "https://github.com/juba/pyobsplot"
48-
documentation = "https://juba.github.io/pyobsplot"
49-
repository = "https://github.com/juba/pyobsplot"
50-
changelog = "https://github.com/juba/pyobsplot/blob/main/NEWS.md"
51-
5248
[tool.hatch.build.targets.sdist]
5349
exclude = [".github", "doc", ".vscode", "examples", "tests", "utils"]
5450

5551
[tool.hatch.build.targets.wheel]
5652
packages = ["src/pyobsplot"]
5753

5854
[tool.pytest.ini_options]
59-
testpaths = "tests"
60-
pythonpath = "src"
6155
filterwarnings = "ignore::DeprecationWarning"
56+
pythonpath = "src"
57+
testpaths = "tests"
6258

6359
[tool.ruff]
6460
target-version = "py310"
@@ -67,57 +63,57 @@ line-length = 88
6763

6864
[tool.ruff.lint]
6965
select = [
70-
"A",
71-
"ARG",
72-
"B",
73-
"C",
74-
"DTZ",
75-
"E",
76-
"EM",
77-
"F",
78-
"FBT",
79-
"I",
80-
"ICN",
81-
"ISC",
82-
"N",
83-
"PLC",
84-
"PLE",
85-
"PLR",
86-
"PLW",
87-
"Q",
88-
"RUF",
89-
"S",
90-
"T",
91-
"TID",
92-
"UP",
93-
"W",
94-
"YTT",
66+
"A",
67+
"ARG",
68+
"B",
69+
"C",
70+
"DTZ",
71+
"E",
72+
"EM",
73+
"F",
74+
"FBT",
75+
"I",
76+
"ICN",
77+
"ISC",
78+
"N",
79+
"PLC",
80+
"PLE",
81+
"PLR",
82+
"PLW",
83+
"Q",
84+
"RUF",
85+
"S",
86+
"T",
87+
"TID",
88+
"UP",
89+
"W",
90+
"YTT",
9591
]
9692
ignore = [
97-
# Allow non-abstract empty methods in abstract base classes
98-
"B027",
99-
# Allow boolean positional values in function calls, like `dict.get(... True)`
100-
"FBT003",
101-
# Ignore checks for possible passwords
102-
"S105",
103-
"S106",
104-
"S107",
105-
# Ignore complexity
106-
"C901",
107-
"PLR0911",
108-
"PLR0912",
109-
"PLR0913",
110-
"PLR0915",
111-
"S301",
112-
"S113",
113-
# Ignore datetime timezone
114-
"DTZ001",
115-
# Ignore Uppercase in method names
116-
"N802",
93+
# Allow non-abstract empty methods in abstract base classes
94+
"B027",
95+
# Allow boolean positional values in function calls, like `dict.get(... True)`
96+
"FBT003",
97+
# Ignore checks for possible passwords
98+
"S105",
99+
"S106",
100+
"S107",
101+
# Ignore complexity
102+
"C901",
103+
"PLR0911",
104+
"PLR0912",
105+
"PLR0913",
106+
"PLR0915",
107+
"S301",
108+
"S113",
109+
# Ignore datetime timezone
110+
"DTZ001",
111+
# Ignore Uppercase in method names
112+
"N802",
117113
]
118114
unfixable = [
119-
# Don't touch unused imports
120-
"F401",
115+
# Don't touch unused imports
116+
"F401",
121117
]
122118

123119
[tool.ruff.lint.isort]
@@ -138,3 +134,6 @@ ban-relative-imports = "all"
138134
[tool.ruff.per-file-ignores]
139135
# Tests can use magic values, assertions, and relative imports
140136
"tests/**/*" = ["PLR2004", "S101", "TID252"]
137+
138+
[tool.uv]
139+
default-groups = "all"

src/pyobsplot/static/template.typ

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111

1212
#let encode-xml(elem) = {
13-
if (type(elem) == "string") {
13+
if (type(elem) == str) {
1414
decode-ampersand(elem)
15-
} else if (type(elem) == "dictionary") {
15+
} else if (type(elem) == dictionary) {
1616
"<" + elem.tag + elem.attrs.pairs().map(
1717
v => " " + v.at(0) + "=\"" + decode-ampersand(v.at(1)) + "\""
1818
).join("") + if (elem.tag == "svg") {" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\""} + ">" + elem.children.map(encode-xml).join("") + "</" + elem.tag + ">"
@@ -37,11 +37,11 @@
3737
let swatch-item(elem) = {
3838
set align(horizon)
3939
stack(
40-
dir: ltr,
41-
spacing: .2em,
42-
image.decode(
43-
encode-xml(elem.children.first()),
44-
width: 1in * float(elem.children.first().attrs.width) / dpi,
40+
dir: ltr,
41+
spacing: .2em,
42+
image(
43+
bytes(encode-xml(elem.children.first())),
44+
width: 1in * float(elem.children.first().attrs.width) / dpi,
4545
height: 1in * float(elem.children.first().attrs.width) /dpi
4646
),
4747
text(elem.children.last(), size: 1in * 10/dpi)
@@ -50,8 +50,8 @@
5050

5151
let swatch(elem) = {
5252
stack(
53-
dir: ltr,
54-
spacing: .6em,
53+
dir: ltr,
54+
spacing: .6em,
5555
..elem.children.filter(e => e.tag == "span").map(swatch-item)
5656
)
5757
}
@@ -68,7 +68,7 @@
6868
let legends = figuresvgs
6969
.filter(svg => "ramp" in svg.attrs.class)
7070
.map(svg => (..svg, attrs: (..svg.attrs,
71-
width: str(float(svg.attrs.width) + 2*legend-padding),
71+
width: str(float(svg.attrs.width) + 2*legend-padding),
7272
viewbox: "-"+str(legend-padding)+" 0 "+str(float(svg.attrs.width)+legend-padding)+" "+str(float(svg.attrs.height)))
7373
))
7474
let mainfigure = figuresvgs.find(svg => "ramp" not in svg.attrs.class)
@@ -96,12 +96,12 @@
9696
v(1in * 8/dpi)
9797
},
9898
..figure.children.filter(e => e.tag == "div").map(swatch),
99-
..legends.map(svg => image.decode(encode-xml(svg), height: 1in * float(svg.attrs.height) / dpi)),
100-
image.decode(encode-xml(mainfigure), height: 1in * float(mainfigure.attrs.height) / dpi),
99+
..legends.map(svg => image(bytes(encode-xml(svg)), height: 1in * float(svg.attrs.height) / dpi)),
100+
image(bytes(encode-xml(mainfigure)), height: 1in * float(mainfigure.attrs.height) / dpi),
101101
if (caption != none) {
102102
set text(size: 1in * 13/dpi, fill: rgb(caption_color), weight: 500)
103103
text(caption.children.first())
104104
v(1in * 4/dpi)
105105
}
106106
)
107-
}
107+
}

uv.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)