From 95539a4de16945dc9e763fdfeb24d11a524cf9d0 Mon Sep 17 00:00:00 2001 From: Hayden Richards Date: Tue, 30 Jan 2024 14:18:28 +0800 Subject: [PATCH] Drop support for Python 2, Django 1.11 and 2.2. Add support for Python 3.7+, Django 3+. --- .github/workflows/main.yml | 25 ++++++++++++++----------- README.rst | 4 ++-- pyproject.toml | 4 ++-- tests/requirements.txt | 2 +- tests/settings.py | 2 ++ tox.ini | 21 ++++++++++++++++----- 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bc84f9..5eb67f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,18 +20,21 @@ jobs: strategy: matrix: python-version: - - py27-django111 - - py3-django2 - - py3-django3 + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: ${{ matrix.python-version }} - - run: pip install tox - - run: tox -e ${{ matrix.python-version }} + - run: pip install tox tox-gh-actions + - run: tox ############ # Coverage # @@ -40,10 +43,10 @@ jobs: coverage: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v1 - - uses: actions/checkout@v1 + - uses: actions/setup-python@v2 + - uses: actions/checkout@v2 - - run: pip install coverage + - run: pip install coverage setuptools - run: python setup.py install - run: coverage run runtests.py @@ -69,7 +72,7 @@ jobs: with: python-version: "3.7" - - run: python -m pip install black==19.10b0 + - run: python -m pip install black==19.10b0 click==8.0.4 - run: black --safe --check --diff . @@ -83,7 +86,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: "2.7" + python-version: "3.7" - run: python -m pip install flake8==3.3.0 - run: flake8 --config=.flake8 . diff --git a/README.rst b/README.rst index 5cae526..00d7308 100644 --- a/README.rst +++ b/README.rst @@ -97,8 +97,8 @@ Installation Supported versions ------------------ -* Python (2.7, 3.7) -* Django (1.11, 2.2, 3.0) +* Python 3.7+ +* Django 3.0+ License diff --git a/pyproject.toml b/pyproject.toml index 7e9f952..ea917d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ target-version = ['py27'] exclude = ''' /( \.git - | \.venv([23])? + | \.venv )/ ''' @@ -18,7 +18,7 @@ import_heading_firstparty = 'local' lines_after_imports = 2 atomic = true combine_star = true -skip = ['.git', '.venv2', '.venv3'] +skip = ['.git', '.venv'] # These settings makes isort compatible with Black: # https://github.com/psf/black#how-black-wraps-lines multi_line_output = 3 diff --git a/tests/requirements.txt b/tests/requirements.txt index 881639e..539fa47 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1,2 @@ django-bulk-update -django-chunkator +django-chunkator<2 diff --git a/tests/settings.py b/tests/settings.py index 61b527c..369e942 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -3,3 +3,5 @@ SECRET_KEY = "j^owl8=_)2do0don9sk@5k7obl!vxm!_404wf%yvk9rp3@a83#" DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} + +DEFAULT_AUTO_FIELD = "django.db.models.AutoField" diff --git a/tox.ini b/tox.ini index c0383f7..b6fb363 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,26 @@ [tox] -envlist = py27-django{111}, py3-django{2,3} +envlist = + py{37,38,39,310,311,312}-django{3} + py{38,39,310,311,312}-django{4} + py{310,311,312}-django{5} + +[gh-actions] +python = + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 [testenv] deps = - py27: mock - django111: Django>=1.11,<2 - django2: Django>=2,<3 django3: Django>=3,<4 + django4: Django>=4,<5 + django5: Django>=5,<6 -r tests/requirements.txt -commands = ./runtests.py +commands = python runtests.py setenv = PYTHONDONTWRITEBYTECODE=1