Skip to content

Commit b324225

Browse files
zhemaitukAndrei
andauthored
fix: relax lxml version constraint und use fixed date parsers list (#184)
* #183 relax lxml version constraint * formatting corrected for black on python 3.13 * fixed 'mypy -p htmldate' complaint --------- Co-authored-by: Andrei <andrei@riskfront.ai>
1 parent 1074ee7 commit b324225

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

htmldate/extractors.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
# coverage for date parsing
1414
from dateparser import DateDataParser # type: ignore # third-party, slow
15-
from dateparser_data.settings import default_parsers
1615

1716
from dateutil.parser import parse as dateutil_parse
1817

@@ -34,9 +33,8 @@
3433
settings={
3534
"NORMALIZE": True, # False may be faster
3635
"PARSERS": [
37-
p
38-
for p in default_parsers
39-
if p not in ("no-spaces-time", "relative-time", "timestamp")
36+
"custom-formats",
37+
"absolute-time",
4038
],
4139
"PREFER_DATES_FROM": "past",
4240
"PREFER_LOCALE_DATE_ORDER": True,

htmldate/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
class Extractor:
4848
"Defines a class to store all extraction options."
49+
4950
__slots__ = ["extensive", "format", "max", "min", "original"]
5051

5152
# consider dataclasses for Python 3.7+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dependencies = [
5353
"dateparser >= 1.1.2", # 1.1.3+ slower
5454
# see tests on Github Actions
5555
"lxml == 4.9.2 ; platform_system == 'Darwin' and python_version <= '3.8'",
56-
"lxml >= 5.3.0, < 6 ; platform_system != 'Darwin' or python_version > '3.8'",
56+
"lxml >= 5.3.0 ; platform_system != 'Darwin' or python_version > '3.8'",
5757
"python-dateutil >= 2.9.0.post0",
5858
"urllib3 >= 1.26, < 3",
5959
]

0 commit comments

Comments
 (0)