From 2b64ba6fe57e15f1b320a0d9d45cc55459bffcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 18 Sep 2026 15:34:20 +0100 Subject: [PATCH 1/2] MAINT: bumping minimum python to 3.11 --- .github/workflows/coverage.yml | 2 +- .github/workflows/test.yml | 2 +- pyproject.toml | 2 +- yaml2ics.py | 6 +----- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 772bce6..4e721ee 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c485f4..43e0f93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ubuntu, macos, windows] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v7 diff --git a/pyproject.toml b/pyproject.toml index 40b0f38..aa5a8ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "yaml2ics" version = "0.4dev0" -requires-python = ">=3.9" +requires-python = ">=3.11" authors = [{name = "Scientific Python Developers"}] readme = "README.md" license = {file = "LICENSE"} diff --git a/yaml2ics.py b/yaml2ics.py index 28b76be..19a9692 100644 --- a/yaml2ics.py +++ b/yaml2ics.py @@ -35,11 +35,7 @@ def datetime_to_str(date): def utcnow(): - try: - return datetime.datetime.now(datetime.UTC).replace(tzinfo=dateutil.tz.UTC) - except AttributeError: - # TODO: This section can be removed once Python 3.11 is the minimum version - return datetime.datetime.utcnow().replace(tzinfo=dateutil.tz.UTC) + return datetime.datetime.now(datetime.UTC).replace(tzinfo=dateutil.tz.UTC) def gettz(tzname: str) -> datetime.tzinfo: From ec5a68b540cbfa0852af4d0f307560209a577f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 18 Sep 2026 16:25:10 +0100 Subject: [PATCH 2/2] Some more python updates --- tests/test_calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_calendar.py b/tests/test_calendar.py index 3d6784b..be5a47f 100644 --- a/tests/test_calendar.py +++ b/tests/test_calendar.py @@ -70,7 +70,7 @@ def test_calendar_default_timezone(): # Test again by normalizing to UTC. Helsinki is two hours ahead, so the # times should be 22:00:00. - cal.normalize(datetime.timezone.utc) + cal.normalize(datetime.UTC) cal_norm_str = cal.serialize() # noqa: F841 # 1 Feb midnight assert "DTSTART:20211231T220000Z" # 1 jan @@ -105,7 +105,7 @@ def test_calendar_event_different_timezone(): # Test again by normalizing to UTC. Helsinki is two hours ahead, so the # times should be 22:00:00. - cal.normalize(datetime.timezone.utc) + cal.normalize(datetime.UTC) cal_norm_str = cal.serialize() # noqa: F841 # 1 Feb midnight assert "DTSTART:20211231T220000Z" # 1 jan