Skip to content

Commit

Permalink
⬆️ Adds Django 5.1 and Python 3.12 support (#196)
Browse files Browse the repository at this point in the history
* ⬆️ Adds Django 5.1 and Python 3.12 support

🔥 Drops Django 3.2 and 4.1
🔥 Drops Python 3.7 support

* 📝 Updates python-versions

* ⚙️ Updates exclude matrix

* 📝 Updates CI

* 🔥 CI cleanup

* 📝 Updates README copy
  • Loading branch information
jefftriplett authored Aug 16, 2024
1 parent f8ee1c6 commit 593d63b
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,48 @@ jobs:
strategy:
matrix:
django-version:
- "3.2"
- "4.1"
- "4.2"
- "5.0"
- "5.1"
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
# Django 5.0 is compatible with Python 3.10+
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.0"
# Django 5.1 is compatible with Python 3.10+
- python-version: "3.8"
django-version: "5.1"
- python-version: "3.9"
django-version: "5.1"

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
cache-dependency-path: '**/setup.cfg'
cache: 'pip'
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install uv
- name: Upgrade django version
run: |
python -m pip install "Django~=${{ matrix.django-version }}.0"
python -m uv pip install "Django~=${{ matrix.django-version }}.0"
- name: Install dependencies
run: |
python -m pip install -e ".[test]"
python -m uv pip install --system -e ".[test]"
- name: Run django-friendship tests
run: |
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ This application enables you to create and manage follows, blocks and bi-directi

## Requirements

** Django 3.2 since v1.9.1 **
Django 5.0 and 5.1 + Python 3.11 and Python 3.12 support added **>v1.9.6**

Previously: **Django 1.11+** since v1.7.0 (latest release supporting **Django 1.10** is v1.6.0)
Previously:

- **Django 3.2 since v1.9.1**
- **Django 1.11+** since v1.7.0 (latest release supporting **Django 1.10** is v1.6.0)

## Installation

Expand Down
12 changes: 8 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
@_default:
just --list

@bootstrap:
python -m pip install --upgrade pip uv nox
uv pip install --upgrade --requirement requirements.in

@fmt:
just --fmt --unstable

@lint:
python -m nox --reuse-existing-virtualenvs --session "lint"

@nox *ARGS:
python -m nox --no-install --reuse-existing-virtualenvs {{ ARGS }}

@pip-compile:
python -m piptools compile --resolver=backtracking
python -m uv pip compile --resolver=backtracking

@pre-commit:
git ls-files -- . | xargs pre-commit run --config=.pre-commit-config.yaml --files
Expand All @@ -21,6 +28,3 @@
python -m nox --reuse-existing-virtualenvs \
--session "test_python_version" \
{{ ARGS }}

lint:
python -m nox --reuse-existing-virtualenvs --session "lint"
7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
# and should *not* appear in DJANGO_VERSIONS

DJANGO_STABLE_VERSION = "4.2"
DJANGO_VERSIONS = ["3.2", "4.1", "main"]
DJANGO_VERSIONS = ["4.2", "5.0", "5.1", "main"]

# PYTHON_STABLE_VERSION should be set to the latest stable Python version
# and should *not* appear in PYTHON_VERSIONS

PYTHON_STABLE_VERSION = "3.11"
PYTHON_VERSIONS = ["3.8", "3.9", "3.10"]
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]

nox.options.default_venv_backend = "uv|venv"
nox.options.reuse_existing_virtualenvs = True


@nox.session
Expand Down
3 changes: 1 addition & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ DJANGO_SETTINGS_MODULE=sample.settings
addopts = --reuse-db
norecursedirs = build dist docs .eggs/* *.egg-info htmlcov test_plus .git .nox .*
python_files = test*.py
site_dirs = example/
testpaths = friendship
pythonpath = example/
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bumpversion
check-manifest
Django<5.0
Django<5.2
factory-boy
flake8
nox
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.1
Framework :: Django :: 4.2
Framework :: Django :: 5.0
Framework :: Django :: 5.1
Framework :: Pytest
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
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

[options]
packages = find:
Expand Down

0 comments on commit 593d63b

Please sign in to comment.