diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7a192d..afcc5e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,10 @@ jobs: python-version: 3 - name: Install dependencies - run: python -m pip install --upgrade setuptools wheel + run: python -m pip install --upgrade build - name: Build Python package - run: python setup.py bdist_wheel sdist + run: python -m build - name: Upload Python packages artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd529d3..be597e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,27 +19,25 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python }} - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install --upgrade tox tox-gh-actions coverage codecov + - name: Tox tests run: tox -v - env: - DJANGO: ${{ matrix.django-version }} - WAGTAIL: ${{ matrix.wagtail-version }} - name: Upload coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: - name: Python ${{ matrix.python-version }} + name: Python ${{ matrix.python }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 302eedd..608b086 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,29 +1,17 @@ default_language_version: - node: system - python: python3.12 + python: python3.13 repos: - - repo: https://github.com/python/black - rev: 25.1.0 + - repo: https://github.com/psf/black + rev: 26.5.1 hooks: - id: black exclude: migrations/ - repo: https://github.com/PyCQA/isort - rev: 6.0.1 + rev: 8.0.1 hooks: - id: isort - repo: https://github.com/pycqa/flake8 # flake8 config is in setup.cfg - rev: 7.1.2 + rev: 7.3.0 hooks: - id: flake8 - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.3.2 - hooks: - - id: prettier - - repo: https://github.com/awebdeveloper/pre-commit-stylelint - rev: c4c991cd38b0218735858716b09924f8b20e3812 - hooks: - - id: stylelint - additional_dependencies: - - stylelint@10.1.0 - - stylelint-config-torchbox@0.5.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8588097..2ad2f6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +Wagtail 7.4 LTS maintenance + +- Support matrix narrowed to Wagtail 7.0–7.4, Django 5.2–6.0, Python 3.10–3.14 +- Tox testing add Wagtail 7.2, 7.3 and 7.4 and Django 6.0 +- Tox testing add Python 3.14 +- Tox testing drop Wagtail 5.2, 6.3 and 6.4 (EOL), Django 4.2 and 5.1 (EOL) +- Tox testing drop Python 3.9 (EOL) +- Fix `wagtail.core.middleware.SiteMiddleware` import in test settings (renamed in Wagtail 5) +- Consolidate `setup.cfg` so `setup.py` is the single source of packaging metadata +- Release workflow switched from `python setup.py` to `python -m build` + Wagtail 7.0 maintenance - Tox testing add Wagtail 7.0, 7.1 and Django 5.2 diff --git a/setup.cfg b/setup.cfg index e1ee070..bf3c368 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,25 +1,4 @@ -[metadata] -description-file = README.md -author = Kevin Howbrook -description = Replace all your images with files from unsplash -version = 1.0.0 -url = https://github.com/kevinhowbrook/wagtail-makeup -keywords = - wagtail - django -long_description = file:README.md -long_description_content_type = text/markdown -license_files = - LICENSE.txt - -[options] -python_requires = >= 3.9 -setup_requires = - setuptools >= 40.6 - pip >= 10 -include_package_data = true -packages = find: -install_requires = - Django>=4.2 - wagtail>=5.2 - python-unsplash>=1.1.0, <1.2 +[flake8] +max-line-length = 88 +extend-ignore = E203 +exclude = .tox,.venv,venv,build,dist,*.egg-info,migrations diff --git a/setup.py b/setup.py index 36a2a85..b1e38f6 100644 --- a/setup.py +++ b/setup.py @@ -13,13 +13,13 @@ long_description = f.read() testing_extras = [ - "coverage>=4.5", + "coverage>=7.0", ] development_extras = [ - "black==25.1.0", - "flake8==7.1.2", - "isort==6.0.1", + "black==26.5.1", + "flake8==7.3.0", + "isort==8.0.1", ] setup( @@ -33,7 +33,12 @@ license="MIT", packages=find_packages(exclude=["tests*"]), include_package_data=True, - install_requires=["wagtail>=5.2", "python-unsplash>=1.1.0"], + python_requires=">=3.10", + install_requires=[ + "Django>=5.2", + "wagtail>=7.0", + "python-unsplash>=1.1.0", + ], extras_require={ "testing": testing_extras, "development": development_extras, @@ -42,12 +47,17 @@ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 4.2", - "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", + "Framework :: Django :: 6.0", "Framework :: Wagtail", - "Framework :: Wagtail :: 5", - "Framework :: Wagtail :: 6", "Framework :: Wagtail :: 7", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ], ), diff --git a/tox.ini b/tox.ini index e007b61..c204338 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +1,28 @@ [gh-actions] python = - 3.9: py39 3.10: py310 3.11: py311 3.12: py312 3.13: py313 + 3.14: py314 [gh-actions:env] DJANGO = - 4.2: dj42 - 5.1: dj51 5.2: dj52 + 6.0: dj60 WAGTAIL = - 5.2: wt52 - 6.3: wt63 - 6.4: wt64 7.0: wt70 - 7.1: wt71 + 7.3: wt73 + 7.4: wt74 [tox] skipsdist = True usedevelop = True envlist = - py{39,310,311,312}-dj42-wt{52,63,64,70,71} - py{310,311,312,313}-dj{51,52}-wt{63,64,70,71} + py{310,311,312,313,314}-dj52-wt{70,73,74} + py{313,314}-dj60-wt{73,74} [testenv] description = Unit tests @@ -33,18 +30,15 @@ install_command = pip install -e ".[testing]" -U {opts} {packages} commands = coverage run --source=wagtailmakeup runtests.py basepython = - py39: python3.9 py310: python3.10 py311: python3.11 py312: python3.12 py313: python3.13 + py314: python3.14 deps = - dj42: Django>=4.2,<4.3 - dj51: Django>=5.1,<5.2 dj52: Django>=5.2,<5.3 - wt52: wagtail>=5.2,<5.3 - wt63: wagtail>=6.3,<6.4 - wt64: wagtail>=6.4,<6.5 + dj60: Django>=6.0,<6.1 wt70: wagtail>=7.0,<7.1 - wt71: wagtail>=7.1,<7.2 \ No newline at end of file + wt73: wagtail>=7.3,<7.4 + wt74: wagtail>=7.4,<7.5 diff --git a/wagtailmakeup/management/commands/make_up.py b/wagtailmakeup/management/commands/make_up.py index ef4f230..087067c 100644 --- a/wagtailmakeup/management/commands/make_up.py +++ b/wagtailmakeup/management/commands/make_up.py @@ -40,10 +40,8 @@ def save_image(self, unsplash_photo): photo = api.photo.get(unsplash_photo.id) url = photo.urls.raw # loop the images and save'em - print( - f"Downloading image {photo.id} > \ - {MEDIA_ROOT}/unsplash-{photo.id}" - ) + print(f"Downloading image {photo.id} > \ + {MEDIA_ROOT}/unsplash-{photo.id}") r = requests.get(url, stream=True) if r.status_code == 200: with open(MEDIA_ROOT + f"/unsplash-{photo.id}", "wb") as f: diff --git a/wagtailmakeup/tests/settings.py b/wagtailmakeup/tests/settings.py index 35574f9..4efd2c7 100644 --- a/wagtailmakeup/tests/settings.py +++ b/wagtailmakeup/tests/settings.py @@ -47,7 +47,7 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - "wagtail.core.middleware.SiteMiddleware", + "wagtail.middleware.SiteMiddleware", ] ROOT_URLCONF = "wagtailmakeup.tests.urls"