summaryrefslogtreecommitdiff
path: root/www/py-htmldate
diff options
context:
space:
mode:
Diffstat (limited to 'www/py-htmldate')
-rw-r--r--www/py-htmldate/Makefile3
-rw-r--r--www/py-htmldate/files/patch-lxml35
2 files changed, 37 insertions, 1 deletions
diff --git a/www/py-htmldate/Makefile b/www/py-htmldate/Makefile
index b91e52287495..2b86a31dc1de 100644
--- a/www/py-htmldate/Makefile
+++ b/www/py-htmldate/Makefile
@@ -1,5 +1,6 @@
PORTNAME= htmldate
PORTVERSION= 1.9.3
+PORTREVISION= 1
CATEGORIES= www python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -16,7 +17,7 @@ BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=61.0:devel/py-setuptools@${PY_
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}charset-normalizer>=3.4.0:textproc/py-charset-normalizer@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dateparser>=1.1.2:devel/py-dateparser@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}lxml5>=5.3.0<6:devel/py-lxml5@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}lxml5>=5.3.0:devel/py-lxml5@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}python-dateutil>=2.9.0:devel/py-python-dateutil@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}urllib3>=1.26,1<3,1:net/py-urllib3@${PY_FLAVOR}
diff --git a/www/py-htmldate/files/patch-lxml b/www/py-htmldate/files/patch-lxml
new file mode 100644
index 000000000000..8669ef1d35dc
--- /dev/null
+++ b/www/py-htmldate/files/patch-lxml
@@ -0,0 +1,35 @@
+Obtained from: https://github.com/adbar/htmldate/commit/b32422541cbc1f610838784f010a2e8cfc36fa05
+
+--- htmldate/extractors.py.orig 2024-11-28 17:24:58 UTC
++++ htmldate/extractors.py
+@@ -12,7 +12,6 @@ from dateparser import DateDataParser # type: ignore
+
+ # coverage for date parsing
+ from dateparser import DateDataParser # type: ignore # third-party, slow
+-from dateparser_data.settings import default_parsers
+
+ from dateutil.parser import parse as dateutil_parse
+
+@@ -34,9 +33,8 @@ EXTERNAL_PARSER = DateDataParser(
+ settings={
+ "NORMALIZE": True, # False may be faster
+ "PARSERS": [
+- p
+- for p in default_parsers
+- if p not in ("no-spaces-time", "relative-time", "timestamp")
++ "custom-formats",
++ "absolute-time",
+ ],
+ "PREFER_DATES_FROM": "past",
+ "PREFER_LOCALE_DATE_ORDER": True,
+--- pyproject.toml.orig 2024-11-27 17:50:43 UTC
++++ pyproject.toml
+@@ -53,7 +53,7 @@ dependencies = [
+ "dateparser >= 1.1.2", # 1.1.3+ slower
+ # see tests on Github Actions
+ "lxml == 4.9.2 ; platform_system == 'Darwin' and python_version <= '3.8'",
+- "lxml >= 5.3.0, < 6 ; platform_system != 'Darwin' or python_version > '3.8'",
++ "lxml >= 5.3.0 ; platform_system != 'Darwin' or python_version > '3.8'",
+ "python-dateutil >= 2.9.0.post0",
+ "urllib3 >= 1.26, < 3",
+ ]