diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a23b1919..7336bc4a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,6 +30,7 @@ jobs: python_version: - "3.9" - "3.10" + - "3.11" steps: - name: Check Out VCS Repository @@ -85,6 +86,7 @@ jobs: python_version: - "3.9" - "3.10" + - "3.11" steps: - name: Check Out VCS Repository diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 97db5c26..eb910aba 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -44,7 +44,7 @@ jobs: id: set_up_python uses: actions/setup-python@v6.0.0 with: - python-version: "3.10" + python-version: "3.11" - name: Restoring/Saving Cache uses: actions/cache@v4.3.0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a180543a..f2225d7e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,7 @@ jobs: id: set_up_python uses: actions/setup-python@v6.0.0 with: - python-version: "3.10" + python-version: "3.11" - name: Create Python Virtual Environment run: make python-virtualenv PYTHON_VIRTUALENV_DIR="venv" diff --git a/README.md b/README.md index d44ee39f..200744ad 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The full documentation is at . ## Supported Python versions -Only Python 3.9 and 3.10. Python 3.8 and below will not work because we use some features +Only Python 3.9, 3.10, and 3.11. Python 3.8 and below will not work because we use some features introduced in Python 3.9. ## Quickstart diff --git a/pyproject.toml b/pyproject.toml index e6b64ecb..90e7ad24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "signxml>=4.0.0", "typing-extensions>=4.0.1", ] -requires-python = ">=3.9, <3.11" +requires-python = ">=3.9, <3.12" authors = [ {name = "Fyntex TI SpA", email = "no-reply@fyntex.ai"}, ] @@ -44,6 +44,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] dynamic = ["version"] diff --git a/src/tests/test_libs_tz_utils.py b/src/tests/test_libs_tz_utils.py index a86c6710..af24c497 100644 --- a/src/tests/test_libs_tz_utils.py +++ b/src/tests/test_libs_tz_utils.py @@ -1,5 +1,6 @@ import datetime import re +import sys import unittest from cl_sii.libs.tz_utils import ( # noqa: F401 @@ -74,7 +75,12 @@ def test_validate_dt_tz_tzinfo_zone_attribute_check(self) -> None: ) with self.assertRaisesRegex(AssertionError, expected_error_message): validate_dt_tz(dt_with_tzinfo_utc_pytz, tzinfo_utc_stdlib) - expected_error_message = re.compile(r"^Object UTC must have 'zone' attribute.$") + if sys.version_info >= (3, 11): + expected_error_message = re.compile( + r"^Object datetime.timezone.utc must have 'zone' attribute.$" + ) + else: + expected_error_message = re.compile(r"^Object UTC must have 'zone' attribute.$") with self.assertRaisesRegex(AssertionError, expected_error_message): validate_dt_tz(dt_with_tzinfo_utc_stdlib, tzinfo_utc_pytz) @@ -86,8 +92,15 @@ def test_validate_dt_tz_tzinfo_zone_attribute_check(self) -> None: ) with self.assertRaisesRegex(AssertionError, expected_error_message): validate_dt_tz(dt_with_tzinfo_not_utc_pytz, tzinfo_not_utc_stdlib) # type: ignore - expected_error_message = re.compile( - r"^Object" r" UTC-03:00" r" must have 'zone' attribute.$" - ) + if sys.version_info >= (3, 11): + expected_error_message = re.compile( + r"^Object" + r" datetime.timezone\(datetime.timedelta\(days=-1, seconds=75600\)\)" + r" must have 'zone' attribute.$" + ) + else: + expected_error_message = re.compile( + r"^Object" r" UTC-03:00" r" must have 'zone' attribute.$" + ) with self.assertRaisesRegex(AssertionError, expected_error_message): validate_dt_tz(dt_with_tzinfo_not_utc_stdlib, tzinfo_not_utc_pytz) diff --git a/tox.ini b/tox.ini index c62778c7..cfeac9c0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py39, py310, + py311, [testenv] setenv = @@ -13,3 +14,4 @@ deps = basepython = py39: python3.9 py310: python3.10 + py311: python3.11