Skip to content

Commit f3c1c77

Browse files
authored
Merge pull request #95 from Salamek/py39
Add Python 3.9 and 3.10 support
2 parents 19533fc + db399fa commit f3c1c77

File tree

8 files changed

+19
-9
lines changed

8 files changed

+19
-9
lines changed

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-24.04
1010
strategy:
1111
matrix:
12-
python-version: ["3.11", "3.12", "3.13", "3.14"]
12+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1313

1414
steps:
1515
- uses: actions/checkout@v4

cron_descriptor/ExpressionDescriptor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
from __future__ import annotations
2223

2324
import calendar
2425
import datetime
2526
import re
26-
from collections.abc import Callable
27-
from typing import TypedDict, Unpack
27+
from typing import Callable, TypedDict
28+
29+
from typing_extensions import Unpack
2830

2931
from .CasingTypeEnum import CasingTypeEnum
3032
from .DescriptionTypeEnum import DescriptionTypeEnum
@@ -349,7 +351,7 @@ def get_month_description(self) -> str:
349351
return self.get_segment_description(
350352
self._expression_parts[4],
351353
"",
352-
lambda s: datetime.date(datetime.datetime.now(tz=datetime.UTC).date().year, int(s), 1).strftime("%B"),
354+
lambda s: datetime.date(datetime.datetime.now(tz=datetime.timezone.utc).date().year, int(s), 1).strftime("%B"),
353355
lambda s: self.translate(", every {0} months").format(s),
354356
lambda _: self.translate(", month {0} through month {1}") or self.translate(", {0} through {1}"),
355357
lambda _: self.translate(", only in {0}"),

cron_descriptor/ExpressionValidator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import re
24
from typing import ClassVar
35

cron_descriptor/GetText.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
from __future__ import annotations
2223

2324
import gettext
2425
import logging

cron_descriptor/Options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
from __future__ import annotations
2223

2324
import locale
2425

examples/crontabReader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
22+
from __future__ import annotations
2223

2324
# /// script
2425
# requires-python = ">=3.11"
2526
# dependencies = [
2627
# "cron-descriptor",
2728
# ]
2829
# ///
29-
3030
import re
3131
from pathlib import Path
3232

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = 'setuptools.build_meta'
66
name = "cron_descriptor"
77
license = "MIT"
88
dynamic = ["version"]
9-
requires-python = ">= 3.11"
9+
requires-python = ">= 3.9"
1010
description = "A Python library that converts cron expressions into human readable strings."
1111

1212
classifiers = [
@@ -18,14 +18,16 @@ classifiers = [
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: Implementation :: CPython",
2020
"Programming Language :: Python :: Implementation :: PyPy",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
2123
"Programming Language :: Python :: 3.11",
2224
"Programming Language :: Python :: 3.12",
2325
"Programming Language :: Python :: 3.13",
2426
"Topic :: Software Development",
2527
]
2628

2729
dependencies = [
28-
30+
"typing_extensions"
2931
]
3032

3133
[project.optional-dependencies]
@@ -60,7 +62,7 @@ exclude = ["tests*", "examples*"]
6062

6163
[tool.ruff]
6264
line-length = 200
63-
target-version = "py312"
65+
target-version = "py39"
6466

6567
[tool.ruff.lint]
6668
select = ["ALL"]
@@ -89,10 +91,12 @@ max-returns = 10
8991

9092
[tool.mypy]
9193
files = ["cron_descriptor", "tests"]
94+
python_version = 3.9
9295
ignore_missing_imports = true
9396
strict = true
9497

9598

99+
96100
[tool.pytest.ini_options]
97101
# Tell pytest where to look for tests
98102
testpaths = [

tools/resx2po.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def resx2dict(self, resx: Path) -> dict[str, str]:
5858

5959
def generate(self) -> None:
6060
po = polib.POFile()
61-
now = datetime.datetime.now(datetime.UTC)
61+
now = datetime.datetime.now(datetime.timezone.utc)
6262
po.metadata = {
6363
"Project-Id-Version": "1.0",
6464
"Report-Msgid-Bugs-To": "adam.schubert@sg1-game.net",

0 commit comments

Comments
 (0)