diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0166665..4b0f86f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,18 +14,17 @@ jobs: fail-fast: false matrix: python-version: - - "3.7" - - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -38,4 +37,4 @@ jobs: run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) - name: codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 diff --git a/appconf/base.py b/appconf/base.py index 864004f..9c3a4f1 100644 --- a/appconf/base.py +++ b/appconf/base.py @@ -5,7 +5,7 @@ from .utils import import_attribute -class AppConfOptions(object): +class AppConfOptions: def __init__(self, meta, prefix=None): self.prefix = prefix @@ -18,7 +18,7 @@ def __init__(self, meta, prefix=None): def prefixed_name(self, name): if name.startswith(self.prefix.upper()): return name - return "%s_%s" % (self.prefix.upper(), name.upper()) + return "{}_{}".format(self.prefix.upper(), name.upper()) def contribute_to_class(self, cls, name): cls._meta = self @@ -29,7 +29,7 @@ def contribute_to_class(self, cls, name): class AppConfMetaClass(type): def __new__(cls, name, bases, attrs): - super_new = super(AppConfMetaClass, cls).__new__ + super_new = super().__new__ parents = [b for b in bases if isinstance(b, AppConfMetaClass)] if not parents: return super_new(cls, name, bases, attrs) diff --git a/appconf/utils.py b/appconf/utils.py index e71cb7d..300e733 100644 --- a/appconf/utils.py +++ b/appconf/utils.py @@ -3,10 +3,7 @@ def import_attribute(import_path, exception_handler=None): - try: - from importlib import import_module - except ImportError: # pragma: no cover - from django.utils.importlib import import_module + from importlib import import_module module_name, object_name = import_path.rsplit('.', 1) try: module = import_module(module_name) diff --git a/docs/conf.py b/docs/conf.py index 49e8469..78de37f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # django-appconf documentation build configuration file, created by # sphinx-quickstart on Thu Aug 25 14:26:22 2011. # @@ -40,8 +38,8 @@ master_doc = 'index' # General information about the project. -project = u'django-appconf' -copyright = u'2011-2013, Jannis Leidel and individual contributors' +project = 'django-appconf' +copyright = '2011-2013, Jannis Leidel and individual contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -182,8 +180,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'django-appconf.tex', u'django-appconf Documentation', - u'Jannis Leidel and individual contributors', 'manual'), + ('index', 'django-appconf.tex', 'django-appconf Documentation', + 'Jannis Leidel and individual contributors', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -215,8 +213,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'django-appconf', u'django-appconf Documentation', - [u'Jannis Leidel and individual contributors'], 1) + ('index', 'django-appconf', 'django-appconf Documentation', + ['Jannis Leidel and individual contributors'], 1) ] diff --git a/setup.py b/setup.py index b6574d4..9783e26 100644 --- a/setup.py +++ b/setup.py @@ -29,28 +29,24 @@ def find_version(*parts): license='BSD', url='https://django-appconf.readthedocs.io/', packages=['appconf'], - python_requires='>=3.7', + python_requires='>=3.9', install_requires=['django'], classifiers=[ 'Development Status :: 5 - Production/Stable', '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', 'Framework :: Django :: 5.1', + 'Framework :: Django :: 5.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - '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', + 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3 :: Only', 'Topic :: Utilities', ], diff --git a/tests/models.py b/tests/models.py index 11219f8..8c1693b 100644 --- a/tests/models.py +++ b/tests/models.py @@ -1,7 +1,7 @@ from appconf import AppConf -class CustomHolder(object): +class CustomHolder: HOLDER_VALUE = True custom_holder = CustomHolder() diff --git a/tox.ini b/tox.ini index 54b18d6..9b98a74 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - flake8-py311, - py{37,38,39,310}-dj32 - py{38,39,310,311}-dj{40,41,42} - py{310,311,312}-dj{50,51,main} + flake8-py313, + py{39,310,311,312}-dj42 + py{310,311,312,313}-dj{51,52} + py{312,313}-djmain [testenv] usedevelop = true @@ -11,21 +11,18 @@ setenv = PYTHONPATH = {toxinidir} DJANGO_SETTINGS_MODULE=tests.test_settings deps = - py{37,38,39,310,311,312}: coverage + py{39,310,311,312,313}: coverage django-discover-runner - dj32: Django>=3.2,<4.0 - dj40: Django>=4.0,<4.1 - dj41: Django>=4.1,<4.2 - dj42: Django>=4.2a1,<4.3 - dj50: Django>=5.0b1,<5.1 + dj42: Django>=4.2,<4.3 dj51: Django>=5.1,<5.2 + dj52: Django>=5.2a1,<5.3 djmain: https://github.com/django/django/archive/main.tar.gz#egg=django commands = coverage run {envbindir}/django-admin test -v2 {posargs:tests} coverage report -[testenv:flake8-py311] +[testenv:flake8-py313] commands = flake8 appconf deps = flake8