From 28b16fe39c9c95500296c6a15f6517b073a11280 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Thu, 13 Jul 2023 23:38:31 +0200 Subject: [PATCH] Drop support for Python 3.7 --- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 4 ++-- CHANGELOG.md | 1 + auditlog/__init__.py | 16 ++-------------- docs/source/installation.rst | 6 +++--- pyproject.toml | 2 +- setup.py | 3 +-- tox.ini | 8 +++----- 8 files changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cc93d7d..dd773a1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false max-parallel: 5 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] services: postgres: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62794935..f12cc6ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: language_version: python3.8 args: - "--target-version" - - "py37" + - "py38" - repo: https://github.com/PyCQA/flake8 rev: "6.0.0" hooks: @@ -21,7 +21,7 @@ repos: rev: v3.8.0 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] - repo: https://github.com/adamchainz/django-upgrade rev: 1.14.0 hooks: diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f8291c..0cecfa40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ #### Breaking Changes - feat: Change `LogEntry.change` field type to `JSONField` rather than `TextField`. This change include a migration that may take time to run depending on the number of records on your `LogEntry` table ([#407](https://github.com/jazzband/django-auditlog/pull/407)) +- Python: Drop support for Python 3.7 ([#546](https://github.com/jazzband/django-auditlog/pull/546)) #### Improvements diff --git a/auditlog/__init__.py b/auditlog/__init__.py index b758d0d0..0fd293e3 100644 --- a/auditlog/__init__.py +++ b/auditlog/__init__.py @@ -1,15 +1,3 @@ -try: - from importlib.metadata import version # New in Python 3.8 -except ImportError: - from pkg_resources import ( # from setuptools, deprecated - DistributionNotFound, - get_distribution, - ) +from importlib.metadata import version - try: - __version__ = get_distribution("django-auditlog").version - except DistributionNotFound: - # package is not installed - pass -else: - __version__ = version("django-auditlog") +__version__ = version("django-auditlog") diff --git a/docs/source/installation.rst b/docs/source/installation.rst index e6b0233a..0df17b78 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -11,10 +11,10 @@ The repository can be found at https://github.com/jazzband/django-auditlog/. **Requirements** -- Python 3.7 or higher -- Django 3.2 or higher +- Python 3.8 or higher +- Django 3.2, 4.1 and 4.2 -Auditlog is currently tested with Python 3.7+ and Django 3.2 and 4.0. The latest test report can be found +Auditlog is currently tested with Python 3.8+ and Django 3.2, 4.1 and 4.2. The latest test report can be found at https://github.com/jazzband/django-auditlog/actions. Adding Auditlog to your Django application diff --git a/pyproject.toml b/pyproject.toml index eb65f46d..e8dad4e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target-version = ["py37"] +target-version = ["py38"] [tool.isort] profile = "black" diff --git a/setup.py b/setup.py index d5c3a618..f01a16d4 100644 --- a/setup.py +++ b/setup.py @@ -27,12 +27,11 @@ description="Audit log app for Django", long_description=long_description, long_description_content_type="text/markdown", - python_requires=">=3.7", + python_requires=">=3.8", install_requires=["Django>=3.2", "python-dateutil>=2.7.0"], zip_safe=False, classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/tox.ini b/tox.ini index 8ccd8fcf..4b098590 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - {py37,py38,py39,py310}-django32 + {py38,py39,py310}-django32 {py38,py39,py310,py311}-django{41,42} {py310,py311}-djangomain - py37-docs + py38-docs py38-lint [testenv] @@ -34,9 +34,8 @@ basepython = py310: python3.10 py39: python3.9 py38: python3.8 - py37: python3.7 -[testenv:py37-docs] +[testenv:py38-docs] changedir = docs/source deps = -rdocs/requirements.txt commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html @@ -48,7 +47,6 @@ commands = [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310