From b79c0d13e9e731879bd6d83f7e7e0eefd50f4a06 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 22 Aug 2024 12:24:19 +0500 Subject: [PATCH] feat: add support for django 5.1 --- .github/workflows/ci.yml | 6 +- .github/workflows/pypi-publish.yml | 2 +- CHANGELOG.rst | 6 ++ djpyfs/__init__.py | 2 +- djpyfs/models.py | 4 +- requirements/ci.txt | 22 ++--- requirements/common_constraints.txt | 15 ++-- requirements/dev.txt | 57 +++++-------- requirements/pip-tools.txt | 21 ++--- requirements/pip.txt | 8 +- requirements/quality.txt | 128 +++++++++++----------------- requirements/test.txt | 56 +++++------- setup.py | 8 +- tox.ini | 16 ++-- 14 files changed, 140 insertions(+), 211 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b441f54..f1f2fcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,9 @@ jobs: matrix: os: [ubuntu-20.04] python-version: - - '3.8' - '3.11' - toxenv: [quality, django42] + - '3.12' + toxenv: [quality, django42, django51] steps: - name: checkout repo @@ -38,7 +38,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django42' + if: matrix.python-version == '3.12' && matrix.toxenv=='django42' uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index b1320a2..620608b 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -15,7 +15,7 @@ jobs: - name: setup python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.12 - name: Install pip run: pip install -r requirements/pip.txt diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3a95387..b3bae5b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,12 @@ Change Log Unreleased ********** +3.7.0 +***** + +* feat: support for Django 5.1 +* chore: drop support for python 3.8 + 3.6.0 ***** diff --git a/djpyfs/__init__.py b/djpyfs/__init__.py index 21294fb..7eaafb9 100644 --- a/djpyfs/__init__.py +++ b/djpyfs/__init__.py @@ -1,3 +1,3 @@ # pylint: disable=django-not-configured """init file""" -__version__ = '3.6.0' +__version__ = '3.7.0' diff --git a/djpyfs/models.py b/djpyfs/models.py index 99f6f1f..f2cd94d 100644 --- a/djpyfs/models.py +++ b/djpyfs/models.py @@ -70,8 +70,8 @@ class Meta: # We'd like to create an index first on expiration than on expires (so # we can search for objects where expires=True and expiration is before # now). - index_together = [ - ["expiration", "expires"], + indexes = [ + models.Index(fields=["expiration", "expires"]), ] def __str__(self): diff --git a/requirements/ci.txt b/requirements/ci.txt index 65c85eb..ac6fe93 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,10 +1,10 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/ci.txt requirements/ci.in # -cachetools==5.3.3 +cachetools==5.5.0 # via tox chardet==5.2.0 # via tox @@ -12,27 +12,23 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.1 +filelock==3.15.4 # via # tox # virtualenv -packaging==24.0 +packaging==24.1 # via # pyproject-api # tox -platformdirs==4.2.0 +platformdirs==4.2.2 # via # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via tox -pyproject-api==1.6.1 +pyproject-api==1.7.1 # via tox -tomli==2.0.1 - # via - # pyproject-api - # tox -tox==4.14.1 +tox==4.18.0 # via -r requirements/ci.in -virtualenv==20.25.1 +virtualenv==20.26.3 # via tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index e3bf8ea..31879f7 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -17,16 +17,15 @@ Django<5.0 # elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. # elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html +# See https://github.com/openedx/edx-platform/issues/35126 for more info elasticsearch<7.14.0 # django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected django-simple-history==3.0.0 -# opentelemetry requires version 6.x at the moment: -# https://github.com/open-telemetry/opentelemetry-python/issues/3570 -# Normally this could be added as a constraint in edx-django-utils, where we're -# adding the opentelemetry dependency. However, when we compile pip-tools.txt, -# that uses version 7.x, and then there's no undoing that when compiling base.txt. -# So we need to pin it globally, for now. -# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407 -importlib-metadata<7 +# Cause: https://github.com/openedx/event-tracking/pull/290 +# event-tracking 2.4.1 upgrades to pymongo 4.4.0 which is not supported on edx-platform. +# We will pin event-tracking to do not break existing installations +# This can be unpinned once https://github.com/openedx/edx-platform/issues/34586 +# has been resolved and edx-platform is running with pymongo>=4.4.0 +event-tracking<2.4.1 diff --git a/requirements/dev.txt b/requirements/dev.txt index 52a42eb..4d6f7e0 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,26 +1,22 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/dev.txt requirements/base.in requirements/dev.in # appdirs==1.4.4 # via fs -asgiref==3.7.2 +asgiref==3.8.1 # via django -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # django -boto3==1.34.61 +boto3==1.35.3 # via fs-s3fs -botocore==1.34.61 +botocore==1.35.3 # via # boto3 # s3transfer -build==1.1.1 +build==1.2.1 # via pip-tools -cachetools==5.3.3 +cachetools==5.5.0 # via tox chardet==5.2.0 # via tox @@ -30,11 +26,11 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -django==4.2.11 +django==4.2.15 # via # -c requirements/common_constraints.txt # -r requirements/base.in -filelock==3.13.1 +filelock==3.15.4 # via # tox # virtualenv @@ -44,63 +40,48 @@ fs==2.4.16 # fs-s3fs fs-s3fs==1.1.1 # via -r requirements/base.in -importlib-metadata==6.11.0 - # via - # -c requirements/common_constraints.txt - # build jmespath==1.0.1 # via # boto3 # botocore -packaging==24.0 +packaging==24.1 # via # build # pyproject-api # tox pip-tools==7.4.1 # via -r requirements/dev.in -platformdirs==4.2.0 +platformdirs==4.2.2 # via # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via tox -pyproject-api==1.6.1 +pyproject-api==1.7.1 # via tox -pyproject-hooks==1.0.0 +pyproject-hooks==1.1.0 # via # build # pip-tools python-dateutil==2.9.0.post0 # via botocore -s3transfer==0.10.0 +s3transfer==0.10.2 # via boto3 six==1.16.0 # via # fs # fs-s3fs # python-dateutil -sqlparse==0.4.4 +sqlparse==0.5.1 # via django -tomli==2.0.1 - # via - # build - # pip-tools - # pyproject-api - # pyproject-hooks - # tox -tox==4.14.1 +tox==4.18.0 # via -r requirements/dev.in -typing-extensions==4.10.0 - # via asgiref -urllib3==1.26.18 +urllib3==2.2.2 # via botocore -virtualenv==20.25.1 +virtualenv==20.26.3 # via tox -wheel==0.43.0 +wheel==0.44.0 # via pip-tools -zipp==3.18.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 67aaa3d..c4a07f4 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,34 +1,23 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/pip-tools.txt requirements/pip-tools.in # -build==1.1.1 +build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.11.0 - # via - # -c requirements/common_constraints.txt - # build -packaging==24.0 +packaging==24.1 # via build pip-tools==7.4.1 # via -r requirements/pip-tools.in -pyproject-hooks==1.0.0 - # via - # build - # pip-tools -tomli==2.0.1 +pyproject-hooks==1.1.0 # via # build # pip-tools - # pyproject-hooks -wheel==0.43.0 +wheel==0.44.0 # via pip-tools -zipp==3.18.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index e9a7a83..16455f3 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --allow-unsafe --output-file=requirements/pip.txt requirements/pip.in # -wheel==0.43.0 +wheel==0.44.0 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==24.0 +pip==24.2 # via -r requirements/pip.in -setuptools==69.1.1 +setuptools==73.0.1 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index 92e3e26..425ab49 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/quality.txt requirements/quality.in @@ -8,35 +8,30 @@ appdirs==1.4.4 # via # -r requirements/test.txt # fs -asgiref==3.7.2 +asgiref==3.8.1 # via # -r requirements/test.txt # django -astroid==3.1.0 +astroid==3.2.4 # via # pylint # pylint-celery -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/test.txt - # django -boto3==1.34.61 +boto3==1.35.3 # via # -r requirements/test.txt # fs-s3fs # moto -botocore==1.34.61 +botocore==1.35.3 # via # -r requirements/test.txt # boto3 # moto # s3transfer -certifi==2024.2.2 +certifi==2024.7.4 # via # -r requirements/test.txt # requests -cffi==1.16.0 +cffi==1.17.0 # via # -r requirements/test.txt # cryptography @@ -51,48 +46,38 @@ click==8.1.7 # edx-lint click-log==0.4.0 # via edx-lint -code-annotations==1.6.0 +code-annotations==1.8.0 # via edx-lint -coverage[toml]==7.4.3 +coverage[toml]==7.6.1 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 +cryptography==43.0.0 # via # -r requirements/test.txt # moto - # secretstorage dill==0.3.8 # via pylint -django==4.2.11 +django==4.2.15 # via # -c requirements/common_constraints.txt # -r requirements/test.txt -docutils==0.20.1 +docutils==0.21.2 # via readme-renderer -edx-lint==5.3.6 +edx-lint==5.3.7 # via -r requirements/quality.in -exceptiongroup==1.2.0 - # via - # -r requirements/test.txt - # pytest fs==2.4.16 # via # -r requirements/test.txt # fs-s3fs fs-s3fs==1.1.1 # via -r requirements/test.txt -idna==3.6 +idna==3.7 # via # -r requirements/test.txt # requests -importlib-metadata==6.11.0 - # via - # -c requirements/common_constraints.txt - # keyring - # twine -importlib-resources==6.3.0 - # via keyring +importlib-metadata==8.4.0 + # via twine iniconfig==2.0.0 # via # -r requirements/test.txt @@ -101,13 +86,13 @@ isort==5.13.2 # via # -r requirements/quality.in # pylint -jaraco-classes==3.3.1 +jaraco-classes==3.4.0 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage -jinja2==3.1.3 +jaraco-context==6.0.1 + # via keyring +jaraco-functools==4.0.2 + # via keyring +jinja2==3.1.4 # via # -r requirements/test.txt # code-annotations @@ -117,7 +102,7 @@ jmespath==1.0.1 # -r requirements/test.txt # boto3 # botocore -keyring==24.3.1 +keyring==25.3.0 # via twine markdown-it-py==3.0.0 # via rich @@ -132,15 +117,17 @@ mdurl==0.1.2 # via markdown-it-py mock==5.1.0 # via -r requirements/test.txt -more-itertools==10.2.0 - # via jaraco-classes +more-itertools==10.4.0 + # via + # jaraco-classes + # jaraco-functools moto==4.2.14 # via # -c requirements/constraints.txt # -r requirements/test.txt -nh3==0.2.15 +nh3==0.2.18 # via readme-renderer -packaging==24.0 +packaging==24.1 # via # -r requirements/test.txt # pytest @@ -148,25 +135,25 @@ pbr==6.0.0 # via stevedore pkginfo==1.10.0 # via twine -platformdirs==4.2.0 +platformdirs==4.2.2 # via pylint -pluggy==1.4.0 +pluggy==1.5.0 # via # -r requirements/test.txt # pytest -pycodestyle==2.11.1 +pycodestyle==2.12.1 # via -r requirements/quality.in -pycparser==2.21 +pycparser==2.22 # via # -r requirements/test.txt # cffi pydocstyle==6.3.0 # via -r requirements/quality.in -pygments==2.17.2 +pygments==2.18.0 # via # readme-renderer # rich -pylint==3.1.0 +pylint==3.2.6 # via # edx-lint # pylint-celery @@ -182,12 +169,12 @@ pylint-plugin-utils==0.8.2 # pylint-django pypng==0.20220715.0 # via -r requirements/test.txt -pytest==8.1.1 +pytest==8.3.2 # via # -r requirements/test.txt # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/test.txt pytest-django==4.8.0 # via -r requirements/test.txt @@ -198,14 +185,14 @@ python-dateutil==2.9.0.post0 # moto python-slugify==8.0.4 # via code-annotations -pyyaml==6.0.1 +pyyaml==6.0.2 # via # -r requirements/test.txt # code-annotations # responses -readme-renderer==43.0 +readme-renderer==44.0 # via twine -requests==2.31.0 +requests==2.32.3 # via # -r requirements/test.txt # moto @@ -214,7 +201,7 @@ requests==2.31.0 # twine requests-toolbelt==1.0.0 # via twine -responses==0.25.0 +responses==0.25.3 # via # -r requirements/test.txt # moto @@ -222,12 +209,10 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -s3transfer==0.10.0 +s3transfer==0.10.2 # via # -r requirements/test.txt # boto3 -secretstorage==3.3.3 - # via keyring six==1.16.0 # via # -r requirements/test.txt @@ -237,7 +222,7 @@ six==1.16.0 # python-dateutil snowballstemmer==2.2.0 # via pydocstyle -sqlparse==0.4.4 +sqlparse==0.5.1 # via # -r requirements/test.txt # django @@ -245,31 +230,18 @@ stevedore==5.2.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # coverage - # pylint - # pytest -tomlkit==0.12.4 +tomlkit==0.13.2 # via pylint -twine==5.0.0 +twine==5.1.1 # via -r requirements/quality.in -typing-extensions==4.10.0 - # via - # -r requirements/test.txt - # asgiref - # astroid - # pylint - # rich -urllib3==1.26.18 +urllib3==2.2.2 # via # -r requirements/test.txt # botocore # requests # responses # twine -werkzeug==3.0.1 +werkzeug==3.0.4 # via # -r requirements/test.txt # moto @@ -277,10 +249,8 @@ xmltodict==0.13.0 # via # -r requirements/test.txt # moto -zipp==3.18.0 - # via - # importlib-metadata - # importlib-resources +zipp==3.20.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements/test.txt b/requirements/test.txt index 404f082..44ea6fc 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,52 +1,46 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/test.txt requirements/base.in requirements/test.in # appdirs==1.4.4 # via fs -asgiref==3.7.2 +asgiref==3.8.1 # via django -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # django -boto3==1.34.61 +boto3==1.35.3 # via # fs-s3fs # moto -botocore==1.34.61 +botocore==1.35.3 # via # boto3 # moto # s3transfer -certifi==2024.2.2 +certifi==2024.7.4 # via requests -cffi==1.16.0 +cffi==1.17.0 # via cryptography charset-normalizer==3.3.2 # via requests -coverage[toml]==7.4.3 +coverage[toml]==7.6.1 # via pytest-cov -cryptography==42.0.5 +cryptography==43.0.0 # via moto # via # -c requirements/common_constraints.txt # -r requirements/base.in -exceptiongroup==1.2.0 - # via pytest fs==2.4.16 # via # -r requirements/base.in # fs-s3fs fs-s3fs==1.1.1 # via -r requirements/base.in -idna==3.6 +idna==3.7 # via requests iniconfig==2.0.0 # via pytest -jinja2==3.1.3 +jinja2==3.1.4 # via moto jmespath==1.0.1 # via @@ -62,20 +56,20 @@ moto==4.2.14 # via # -c requirements/constraints.txt # -r requirements/test.in -packaging==24.0 +packaging==24.1 # via pytest -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -pycparser==2.21 +pycparser==2.22 # via cffi pypng==0.20220715.0 # via -r requirements/test.in -pytest==8.1.1 +pytest==8.3.2 # via # -r requirements/test.in # pytest-cov # pytest-django -pytest-cov==4.1.0 +pytest-cov==5.0.0 # via -r requirements/test.in pytest-django==4.8.0 # via -r requirements/test.in @@ -83,35 +77,29 @@ python-dateutil==2.9.0.post0 # via # botocore # moto -pyyaml==6.0.1 +pyyaml==6.0.2 # via responses -requests==2.31.0 +requests==2.32.3 # via # moto # responses -responses==0.25.0 +responses==0.25.3 # via moto -s3transfer==0.10.0 +s3transfer==0.10.2 # via boto3 six==1.16.0 # via # fs # fs-s3fs # python-dateutil -sqlparse==0.4.4 +sqlparse==0.5.1 # via django -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.10.0 - # via asgiref -urllib3==1.26.18 +urllib3==2.2.2 # via # botocore # requests # responses -werkzeug==3.0.1 +werkzeug==3.0.4 # via moto xmltodict==0.13.0 # via moto diff --git a/setup.py b/setup.py index 2fa4205..2c9ac4e 100644 --- a/setup.py +++ b/setup.py @@ -111,12 +111,12 @@ def get_version(*file_paths): classifiers=[ "Development Status :: 4 - Beta", "Framework :: Django", - 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.0', - 'Framework :: Django :: 4.2', + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.1", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries :: Python Modules", "License :: OSI Approved :: Apache Software License", ], diff --git a/tox.ini b/tox.ini index e090033..ecd44eb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,28 +1,28 @@ [tox] -envlist = python{3.8,3.11}-django{42},quality +envlist = python{311, 312}-django{42, 51},quality [testenv] -passenv = +passenv = CI TRAVIS TRAVIS_* -commands = +commands = python -Wd -m pytest --cov {posargs} python -m coverage html -deps = +deps = -r{toxinidir}/requirements/test.txt - django42: Django>=4.2,<4.3 - + django42: Django>=4.2,<5.0 + django51: Django>=5.1,<5.2 [testenv:quality] -allowlist_externals = +allowlist_externals = make rm touch deps = wheel -r{toxinidir}/requirements/quality.txt -commands = +commands = pylint djpyfs isort --check-only djpyfs python setup.py sdist bdist_wheel