Skip to content

Commit cbe2979

Browse files
authored
Upgrade Python support and fix CI issues (#1296)
1 parent b7bb1a5 commit cbe2979

File tree

6 files changed

+21
-27
lines changed

6 files changed

+21
-27
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,21 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- python-version: "3.13"
17+
- python-version: "3.14"
1818
toxenv: pre-commit
19-
- python-version: "3.9"
19+
- python-version: "3.10"
2020
toxenv: min
21-
- python-version: "3.9"
22-
toxenv: min-all
23-
- python-version: "3.9"
2421
- python-version: "3.10"
22+
toxenv: min-all
2523
- python-version: "3.11"
2624
- python-version: "3.12"
27-
- python-version: "3.13"
25+
- python-version: "3.14"
2826
toxenv: all
29-
- python-version: "3.13"
27+
- python-version: "3.14"
3028
toxenv: scripts
31-
- python-version: "3.12" # Keep in sync with tox.ini
29+
- python-version: "3.14"
3230
toxenv: docs
33-
- python-version: "3.13"
31+
- python-version: "3.14"
3432
toxenv: twinecheck
3533
steps:
3634
- uses: actions/checkout@v3

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ are executed, you can do so through the
157157
Installation
158158
------------
159159

160-
Dateparser supports Python >= 3.9. You can install it by doing:
160+
Dateparser supports Python 3.10+. You can install it by doing:
161161

162162
::
163163

dateparser_scripts/write_complete_data.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from collections import OrderedDict
55

66
import regex as re
7-
from ruamel.yaml import RoundTripLoader
7+
from ruamel.yaml import YAML
88

99
from dateparser_scripts.order_languages import avoid_languages
1010
from dateparser_scripts.utils import combine_dicts
@@ -55,7 +55,8 @@ def _get_complete_date_translation_data(language):
5555
cldr_data = json.load(f, object_pairs_hook=OrderedDict)
5656
if language in supplementary_languages:
5757
with open(supplementary_date_directory + language + ".yaml") as g:
58-
supplementary_data = OrderedDict(RoundTripLoader(g).get_data())
58+
yaml = YAML()
59+
supplementary_data = OrderedDict(yaml.load(g))
5960
complete_data = combine_dicts(cldr_data, supplementary_data)
6061
if "name" not in complete_data:
6162
complete_data["name"] = language
@@ -88,7 +89,8 @@ def write_complete_data(in_memory=False):
8889
os.mkdir(date_translation_directory)
8990

9091
with open(supplementary_directory + "base_data.yaml") as f:
91-
base_data = RoundTripLoader(f).get_data()
92+
yaml = YAML()
93+
base_data = yaml.load(f)
9294

9395
for language in all_languages:
9496
date_translation_data = _get_complete_date_translation_data(language)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@
3939
},
4040
extras_require={
4141
"calendars": ["convertdate>=2.2.1", "hijridate"],
42-
"fasttext": ["fasttext>=0.9.1", "numpy>=1.19.3,<2"],
42+
"fasttext": ["fasttext>=0.9.1", "numpy>=1.22.0,<2"],
4343
"langdetect": ["langdetect>=1.0.0"],
4444
},
4545
license="BSD",
4646
zip_safe=False,
4747
keywords="dateparser",
48-
python_requires=">=3.8", # Python 3.8 is required for fuzzing
48+
python_requires=">=3.10",
4949
classifiers=[
5050
"Development Status :: 5 - Production/Stable",
5151
"Intended Audience :: Developers",
5252
"License :: OSI Approved :: BSD License",
5353
"Natural Language :: English",
5454
"Programming Language :: Python :: 3",
55-
"Programming Language :: Python :: 3.9",
5655
"Programming Language :: Python :: 3.10",
5756
"Programming Language :: Python :: 3.11",
5857
"Programming Language :: Python :: 3.12",
5958
"Programming Language :: Python :: 3.13",
59+
"Programming Language :: Python :: 3.14",
6060
"Programming Language :: Python :: Implementation :: CPython",
6161
],
6262
)

tests/test_freshness_date_parser.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44

55
import pytz
66

7-
try:
8-
from zoneinfo import ZoneInfo
9-
except ImportError:
10-
try:
11-
from backports.zoneinfo import ZoneInfo # Python < 3.9 + tzlocal >= 3
12-
except ImportError:
13-
ZoneInfo = None # Python < 3.9
7+
from zoneinfo import ZoneInfo
148

159
from unittest.mock import Mock, patch
1610

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = pre-commit,min,min-all,py39,py310,py311,py312,py313,all,scripts,docs,twinedeck
2+
envlist = pre-commit,min,min-all,py310,py311,py312,py313,py314,all,scripts,docs,twinedeck
33

44
[base]
55
deps =
@@ -15,14 +15,14 @@ commands =
1515
pytest --cov=dateparser --cov-report=xml {posargs: tests}
1616

1717
[testenv:all]
18-
basepython = python3.13
18+
basepython = python3.14
1919
extras =
2020
calendars
2121
fasttext
2222
langdetect
2323

2424
[testenv:min]
25-
basepython = python3.9
25+
basepython = python3.10
2626
deps =
2727
{[testenv]deps}
2828
python-dateutil==2.7.0
@@ -38,7 +38,7 @@ deps =
3838
convertdate==2.2.1
3939
hijridate==2.3.0
4040
langdetect==1.0.0
41-
numpy==1.19.3
41+
numpy==1.22.0
4242
# fasttext excluded due to
4343
# https://github.com/facebookresearch/fastText/issues/512
4444

0 commit comments

Comments
 (0)