Skip to content

CI: Enable testing with Python 3.12 #1759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -r ./requirements.txt
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt

- name: Run mypy on plugin code
run: mypy --strict mypy_django_plugin
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
shard: [0, 1, 2, 3]
fail-fast: false
steps:
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -r ./requirements.txt
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt

# Must match `shard` definition in the test matrix:
- name: Run tests
Expand All @@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
python-version: ['3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -r ./requirements.txt
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt

- name: Run stubtest
run: bash ./scripts/stubtest.sh
Expand All @@ -101,10 +101,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
django-version: ['3.2', '4.2']
include:
- python-version: '3.11'
- python-version: '3.12'
django-version: '4.1'
steps:
- uses: actions/checkout@v4
Expand All @@ -119,7 +119,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -r ./requirements.txt
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
pip install "Django==${{ matrix.django-version }}"
pip check

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.11
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ source .venv/bin/activate
Then install the dev requirements:

```bash
pip install -r ./requirements.txt
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
```

Finally, install the pre-commit hooks:
Expand Down Expand Up @@ -88,7 +88,7 @@ We have two special files to allow errors:
You might also want to disable `incremental` mode while working on `stubtest` changes.
This mode leads to several known problems (stubs do not show up or have strange errors).

**Important**: right now we only run `stubtest` on Python 3.11 (because it is the latest released version at the moment), any other versions might generate different outputs. Any work to create per-version allowlists is welcome.
**Important**: right now we only run `stubtest` on Python 3.12 (because it is the latest released version at the moment), any other versions might generate different outputs. Any work to create per-version allowlists is welcome.

## Submission Guidelines

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ We rely on different `django` and `mypy` versions:

| django-stubs | Mypy version | Django version | Django partial support | Python version |
|----------------|--------------|----------------|------------------------|----------------|
| (next release) | 1.5.x | 4.2 | 4.1, 3.2 | 3.8 - 3.12 |
| 4.2.4 | 1.5.x | 4.2 | 4.1, 3.2 | 3.8 - 3.11 |
| 4.2.3 | 1.4.x | 4.2 | 4.1, 3.2 | 3.8 - 3.11 |
| 4.2.2 | 1.4.x | 4.2 | 4.1, 3.2 | 3.8 - 3.11 |
Expand Down
1 change: 1 addition & 0 deletions ext/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
"Framework :: Django",
"Framework :: Django :: 3.2",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ known-first-party = ["django_stubs_ext", "mypy_django_plugin"]
split-on-trailing-comma = false

[build-system]
requires = ["setuptools<64", "wheel"]
requires = ["setuptools", "wheel"]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def find_stub_files(name: str) -> List[str]:
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
"Framework :: Django",
"Framework :: Django :: 3.2",
Expand Down