Skip to content

Commit 882818a

Browse files
committed
py-html5lib: add py314 subport
1 parent 3e0eb49 commit 882818a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

python/py-html5lib/Portfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ checksums rmd160 11c51e956d700383e5e57e401d76f8ceb98b07e8 \
2525
sha256 2a57d32c2061305c1fa8de9a228d3659ff75126ccd91f31e21bebd7124a5de4c \
2626
size 257986
2727

28-
python.versions 27 39 310 311 312 313
28+
python.versions 27 39 310 311 312 313 314
2929

3030
if {${name} ne ${subport}} {
3131
depends_lib-append \
32-
port:py${python.version}-setuptools \
3332
port:py${python.version}-six \
3433
port:py${python.version}-webencodings
3534

35+
if {${python.version} == 314} {
36+
# see: https://github.com/html5lib/html5lib-python/pull/589
37+
patchfiles patch-589.diff
38+
}
39+
3640
post-destroot {
3741
set docdir ${prefix}/share/doc/${subport}
3842
xinstall -d ${destroot}${docdir}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/setup.py b/setup.py
2+
index 30ee0575..42ab6f67 100644
3+
--- setup.py
4+
+++ setup.py
5+
@@ -92,9 +92,14 @@ def default_environment():
6+
for a in assignments:
7+
if (len(a.targets) == 1 and
8+
isinstance(a.targets[0], ast.Name) and
9+
- a.targets[0].id == "__version__" and
10+
- isinstance(a.value, ast.Str)):
11+
- version = a.value.s
12+
+ a.targets[0].id == "__version__"):
13+
+ if hasattr(ast, "Str") and isinstance(a.value, ast.Str):
14+
+ version = a.value.s
15+
+ elif (hasattr(ast, "Constant")
16+
+ and isinstance(a.value, ast.Constant)
17+
+ and isinstance(a.value.value, str)):
18+
+ version = a.value.value
19+
+assert version is not None
20+
21+
setup(name='html5lib',
22+
version=version,

0 commit comments

Comments
 (0)