diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f7d8768..424a0de 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -29,6 +29,7 @@ jobs: test: name: ${{ matrix.config.tox }} ${{ matrix.config.options }} + # Ubuntu 22.04 runner includes Python 3.10 runs-on: ubuntu-22.04 needs: skip_duplicate_runs if: needs.skip_duplicate_runs.outputs.should_skip != 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 013a8c7..d31a457 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,7 @@ jobs: python -m tox --gh-matrix-dump # for debugging test: + # Ubuntu 22.04 runner includes Python 3.10 runs-on: ubuntu-22.04 needs: get-envlist strategy: @@ -52,7 +53,7 @@ jobs: # for installing/running tox uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install tox run: | set -x diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 593dc97..d9b2bf5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,17 @@ Release history .. This extra heading level keeps the ToC from becoming unmanageably long +vNext (12.0) +------------ + +*unreleased changes* + +Breaking changes +~~~~~~~~~~~~~~~~ + +* Require **Django 4.0 or later** and Python 3.8 or later. + + v11.1 ----- diff --git a/anymail/__init__.py b/anymail/__init__.py index 6758502..8b9bc97 100644 --- a/anymail/__init__.py +++ b/anymail/__init__.py @@ -4,14 +4,3 @@ __all__ = [ "VERSION", "__version__", ] - -try: - import django -except ImportError: - # (don't require django just to get package version) - pass -else: - if django.VERSION < (3, 2, 0): - # (No longer required -- and causes deprecation warning -- in Django 3.2+) - default_app_config = "anymail.apps.AnymailBaseConfig" - __all__.append("default_app_config") diff --git a/anymail/_version.py b/anymail/_version.py index 64c9bd9..2d5c170 100644 --- a/anymail/_version.py +++ b/anymail/_version.py @@ -2,6 +2,6 @@ # Instead, load version info from the package root. #: major.minor or major.minor.patch (optionally with .devN suffix) -__version__ = "11.1" +__version__ = "12.0.dev0" VERSION = __version__.split(",") diff --git a/pyproject.toml b/pyproject.toml index be9ef7e..81c69bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -51,19 +50,17 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Intended Audience :: Developers", "Framework :: Django", - "Framework :: Django :: 3.0", - "Framework :: Django :: 3.1", - "Framework :: Django :: 3.2", "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", "Framework :: Django :: 5.0", + "Framework :: Django :: 5.1", "Environment :: Web Environment", ] requires-python = ">=3.7" dependencies = [ - "django>=2.0", + "django>=4.0", "requests>=2.4.3", "urllib3>=1.25.0", # requests dependency: fixes RFC 7578 header encoding ] diff --git a/tests/test_settings/settings_3_0.py b/tests/test_settings/settings_3_0.py deleted file mode 100644 index f424a57..0000000 --- a/tests/test_settings/settings_3_0.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Django settings for Anymail tests. - -Generated by 'django-admin startproject' using Django 3.0a1. - -For more information on this file, see -https://docs.djangoproject.com/en/dev/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/dev/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'NOT_FOR_PRODUCTION_USE' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'anymail', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'tests.test_settings.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'tests.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/dev/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/dev/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/dev/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/tests/test_settings/settings_3_1.py b/tests/test_settings/settings_3_1.py deleted file mode 100644 index 788eba6..0000000 --- a/tests/test_settings/settings_3_1.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Django settings for Anymail tests. - -Generated by 'django-admin startproject' using Django 3.1. - -For more information on this file, see -https://docs.djangoproject.com/en/dev/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/dev/ref/settings/ -""" - -import os - -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'NOT_FOR_PRODUCTION_USE' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'anymail', -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'tests.test_settings.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'tests.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/dev/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} - - -# Password validation -# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/dev/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/dev/howto/static-files/ - -STATIC_URL = '/static/' diff --git a/tox.ini b/tox.ini index fa8a25f..a035676 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = # Test lint, docs, earliest/latest Django first, to catch most errors early... lint django51-py312-all - django30-py37-all + django40-py38-all docs # ... then test all the other supported combinations: # Django 5.1: Python 3.10, 3.11, and 3.12 @@ -18,13 +18,7 @@ envlist = # Django 4.1: Python 3.8, 3.9, 3.10 django41-py{38,39,310,py38,py39}-all # Django 4.0: Python 3.8, 3.9, 3.10 - django40-py{38,39,310,py38,py39}-all - # Django 3.2: Python 3.6 (eol 2021-12-23), 3.7, 3.8, 3.9 - django32-py{37,38,39,py38,py39}-all - # Django 3.1: Python 3.6 (eol 2021-12-23), 3.7, 3.8, 3.9 (added in 3.1.3) - django31-py{37,38,39,py38,py39}-all - # Django 3.0: Python 3.6 (eol 2021-12-23), 3.7, 3.8, 3.9 (added in 3.0.11) - django30-py{38,39,py38,py39}-all + django40-py{39,310,py38,py39}-all # ... then prereleases (if available) and current development: # Django 5.2 pre-release: Python 3.10, 3.11, 3.12 and 3.13 # django52-py{310,311,312,313}-all @@ -41,9 +35,6 @@ args_are_paths = false download = true deps = -rtests/requirements.txt - django30: django~=3.0.0 - django31: django~=3.1.0 - django32: django~=3.2.0 django40: django~=4.0.0 django41: django~=4.1.0 django42: django~=4.2.0