Skip to content

Commit bb7d2dd

Browse files
authored
Bump minimal Python version to 3.10 (#19)
* Bump minimal Python version to 3.10 * Add `pyupgrade` to CI
1 parent efd4db8 commit bb7d2dd

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.github/workflows/test-pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: 'Install Python'
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: '3.8'
19+
python-version: '3.10'
2020
- name: 'Install cookiecutter'
2121
run: pip install cookiecutter
2222
- name: 'Install Poetry'
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
python-version: ['3.8', '3.10']
40+
python-version: ['3.10', '3.11']
4141
steps:
4242
- name: 'Install Python'
4343
uses: actions/setup-python@v4
@@ -52,6 +52,8 @@ jobs:
5252
key: test-project-${{ github.run_id }}
5353
- name: 'Run tests'
5454
run: make -C test-project all
55+
- name: 'Run pyupgrade'
56+
run: make -C test-project pyupgrade
5557

5658
nix-build:
5759
name: 'Build with Nix'

{{cookiecutter.project_slug}}/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,11 @@ black: poetry-install
8282

8383
check-black: poetry-install
8484
$(POETRY_RUN) black --check src
85+
86+
87+
# Optional tools
88+
89+
SRC_FILES := $(shell find src -type f -name '*.py')
90+
91+
pyupgrade: poetry-install
92+
$(POETRY_RUN) pyupgrade --py310-plus $(SRC_FILES)

{{cookiecutter.project_slug}}/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
poetry2nix.overlay
1212
(final: prev: {
1313
{{ cookiecutter.project_slug }} = prev.poetry2nix.mkPoetryApplication {
14-
python = prev.python39;
14+
python = prev.python310;
1515
projectDir = ./.;
1616
groups = [];
1717
# We remove `dev` from `checkGroups`, so that poetry2nix does not try to resolve dev dependencies.

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
]
1212

1313
[tool.poetry.dependencies]
14-
python = "^3.8"
14+
python = "^3.10"
1515

1616
[tool.poetry.group.dev.dependencies]
1717
autoflake = "*"
@@ -28,6 +28,7 @@ pytest = "*"
2828
pytest-cov = "*"
2929
pytest-mock = "*"
3030
pytest-xdist = "*"
31+
pyupgrade = "*"
3132

3233
[tool.isort]
3334
profile = "black"

0 commit comments

Comments
 (0)