From 50a98d0878db7ae20d669b2705ed7d7cd598fe74 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Thu, 11 Jul 2024 14:42:19 +0330 Subject: [PATCH] Update Python and Django versions (#76) --- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 2 +- setup.py | 8 ++++---- src/voting/__init__.py | 6 +++--- tox.ini | 17 ++++++++--------- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1bfe876..7be282a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ccad1a..7459569 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: "7.1.0" hooks: @@ -21,7 +21,7 @@ repos: rev: v3.16.0 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] - repo: https://github.com/adamchainz/django-upgrade rev: 1.19.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 7145f7d..f2e2f64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target-version = ["py37"] +target-version = ["py38"] # black compatible isort [tool.isort] diff --git a/setup.py b/setup.py index d7d8a19..a559b60 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup_requires=[ "setuptools_scm", ], - python_requires=">=3.7", + python_requires=">=3.8", install_requires=[ "Django >=3.2", ], @@ -25,19 +25,19 @@ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", - "Framework :: Django :: 4.1", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Utilities", ], ) diff --git a/src/voting/__init__.py b/src/voting/__init__.py index 4880c85..95f8998 100644 --- a/src/voting/__init__.py +++ b/src/voting/__init__.py @@ -1,7 +1,7 @@ -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import version try: - __version__ = get_distribution("django-voting").version -except DistributionNotFound: + __version__ = version("django-voting") +except Exception: # package is not installed __version__ = None diff --git a/tox.ini b/tox.ini index 0dcd1f7..9c1cde8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] envlist = - py{37,38,39,310}-dj32 - py{38,39,310}-dj40 - py{38,39,310,311}-dj41 - py{310,311}-djmain + py{38,39,310}-dj32 + py{38,39,310,311}-dj42 + py{310,311,312}-dj{50,main} py38-lint [testenv] @@ -14,8 +13,8 @@ deps = pytest-django pytest-flake8 dj32: Django>=3.2,<4.0 - dj40: Django>=4.0,<4.1 - dj41: Django>=4.1,<4.2 + dj42: Django>=4.2,<4.3 + dj50: Django>=5.0,<5.1 djmain: https://github.com/django/django/archive/main.tar.gz setenv = DJANGO_SETTINGS_MODULE = test_settings @@ -28,17 +27,17 @@ ignore_outcome = [gh-actions] python = - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [gh-actions:env] DJANGO = 3.2: dj32 - 4.0: dj40 - 4.1: dj41 + 4.2: dj42 + 5.0: dj50 main: djmain [testenv:py38-lint]