From 70895c194e5e300e8130a6353a8af395f8177786 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Wed, 30 Oct 2024 15:46:12 +0100 Subject: [PATCH] Dropped support for Python 3.8 (#1701) --- .github/workflows/tests.yml | 2 +- .pre-commit-config.yaml | 4 +--- README.rst | 2 +- tox.ini | 3 +-- tracdb/models.py | 6 +----- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 523fafabf..7cbef817c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: matrix: # tox-gh-actions will only run the tox environments which match the currently # running python-version. See [gh-actions] in tox.ini for the mapping. - python-version: ["3.8", "3.12"] + python-version: ["3.12"] services: postgres: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6358ed90..b1c416594 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,9 +30,7 @@ repos: rev: "v3.19.0" hooks: - id: pyupgrade - # TODO: Update to --py312 when dropping support for - # Python 3.8 - args: [--py38-plus] + args: [--py312] - repo: https://github.com/adamchainz/django-upgrade rev: "1.22.1" hooks: diff --git a/README.rst b/README.rst index fd5815661..a3c665e8c 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ To run locally, you can either: Install and run locally from a virtual environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#. Create a `Python Python 3.8 or 3.12 virtualenv and activate it `_ +#. Create a `Python Python 3.12 virtualenv and activate it `_ #. Install dependencies:: diff --git a/tox.ini b/tox.ini index 01fe9f392..d8f31f0b9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] -envlist =py{38,312}-{tests,flake8,black,isort} +envlist =py{312}-{tests,flake8,black,isort} skipsdist = true [gh-actions] python = - 3.8: py38 3.12: py312 [testenv] diff --git a/tracdb/models.py b/tracdb/models.py index 24f5a8bd4..e1f6b1788 100644 --- a/tracdb/models.py +++ b/tracdb/models.py @@ -50,11 +50,7 @@ from django.db import models -try: - _epoc = datetime.datetime(1970, 1, 1, tzinfo=datetime.UTC) -except AttributeError: - # TODO: Remove when dropping support for Python 3.8 - _epoc = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc) +_epoc = datetime.datetime(1970, 1, 1, tzinfo=datetime.UTC) class time_property: