Skip to content

Commit

Permalink
CI: Enable testing with Python 3.12 (#478)
Browse files Browse the repository at this point in the history
* CI: Enable testing with Python 3.12
* SETUPTOOLS_ENABLE_FEATURES=legacy-editable
* pre-commit default_language_version

Need to use `SETUPTOOLS_ENABLE_FEATURES=legacy-editable` due to setuptools v64 changes: pypa/setuptools#3518
  • Loading branch information
intgr authored Oct 6, 2023
1 parent 89602d2 commit 9881214
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,7 +22,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_drf_plugin
- name: Run mypy on scripts and utils
Expand All @@ -34,7 +34,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']
steps:
- uses: actions/checkout@v4
- name: Setup system dependencies
Expand All @@ -48,7 +48,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 tests
run: pytest
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +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.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ split-on-trailing-comma = false
extra-standard-library = ["_typeshed"]

[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 @@ -59,6 +59,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",
],
Expand Down

0 comments on commit 9881214

Please sign in to comment.