Skip to content

Commit a6379b6

Browse files
authored
Upgrade to Python 3.10 (#40)
1 parent 13cd9d4 commit a6379b6

File tree

8 files changed

+1684
-1491
lines changed

8 files changed

+1684
-1491
lines changed

.github/hooks/.pre-commit-config.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fail_fast: true
55
repos:
66

77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.0.1
8+
rev: v4.3.0
99
hooks:
1010
- id: check-ast
1111
- id: check-case-conflict
@@ -28,40 +28,35 @@ repos:
2828
- id: absolufy-imports
2929
files: ^src/
3030

31-
- repo: https://github.com/jendrikseipp/vulture
32-
rev: v2.4
33-
hooks:
34-
- id: vulture
35-
3631
- repo: https://github.com/codespell-project/codespell
37-
rev: v2.1.0
32+
rev: v2.2.2
3833
hooks:
3934
- id: codespell
4035
types_or: [python, rst, markdown]
4136
args: [--ignore-words=.codespell]
4237

4338
- repo: https://github.com/timothycrosley/isort
44-
rev: 5.10.1
39+
rev: 5.11.4
4540
hooks:
4641
- id: isort
4742
name: isort (python)
4843

4944
- repo: https://github.com/asottile/pyupgrade
50-
rev: v2.34.0
45+
rev: v3.3.1
5146
hooks:
5247
- id: pyupgrade
53-
args: [--py39-plus]
48+
args: [--py310-plus]
5449

5550
- repo: https://github.com/asottile/yesqa
56-
rev: v1.3.0
51+
rev: v1.4.0
5752
hooks:
5853
- id: yesqa
5954

6055
- repo: https://github.com/psf/black
61-
rev: 22.8.0
56+
rev: 22.12.0
6257
hooks:
6358
- id: black
64-
language_version: python3.8
59+
language_version: python3.10
6560

6661
- repo: https://github.com/pycqa/flake8
6762
rev: 6.0.0

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
virtualenvs-in-project: true
1818
virtualenvs-path: .venv
1919

20-
- name: Set up Python 3.9
20+
- name: Set up Python 3.10
2121
uses: actions/setup-python@v4
2222
with:
23-
python-version: 3.9
23+
python-version: '3.10'
2424
cache: 'poetry'
2525

2626
- name: Cache pre-commit
@@ -39,7 +39,11 @@ jobs:
3939
4040
- name: Mypy
4141
run: |
42-
poetry run mypy --install-types --incremental --show-error-codes --pretty src
42+
poetry run mypy --incremental --show-error-codes --pretty src
43+
44+
- name: Vulture
45+
run: |
46+
poetry run vulture src
4347
4448
- name: Tests
4549
run: |

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
virtualenvs-in-project: true
4747
virtualenvs-path: .venv
4848

49-
- name: Set up Python 3.9
49+
- name: Set up Python 3.10
5050
uses: actions/setup-python@v4
5151
with:
52-
python-version: 3.9
52+
python-version: '3.10'
5353
cache: 'poetry'
5454

5555
# Initializes the CodeQL tools for scanning.

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,10 @@ cython_debug/
157157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
160+
.idea/
161+
162+
# Visual Studio Code
163+
.vscode
164+
165+
# Test artifacts
166+
junit/

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Installation
2-
setup_venv:
2+
install_venv:
33
poetry install --no-root
44

55
install_pre_commit:
66
poetry run pre-commit install -c .github/hooks/.pre-commit-config.yml
77

8-
install_dev: setup_venv install_pre_commit
8+
install_dev: install_venv install_pre_commit
99

1010
# Dev tools
1111
isort:
@@ -23,6 +23,9 @@ format: isort black
2323
mypy:
2424
poetry run mypy --incremental --install-types --show-error-codes --pretty src
2525

26+
vulture:
27+
poetry run vulture src
28+
2629
pre_commit:
2730
poetry run pre-commit run -a -c .github/hooks/.pre-commit-config.yml
2831

@@ -38,7 +41,7 @@ test_cov:
3841
compile_env:
3942
poetry lock --no-update
4043

41-
build: isort black pre_commit flake8 mypy test
44+
build: isort black pre_commit flake8 mypy vulture test
4245

4346
# Misc
4447
jupyter:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ When developing a project there's a need to automate some tedious stuff that hel
3131
- [flake8](https://github.com/PyCQA/flake8)
3232
- [isort](https://github.com/PyCQA/isort)
3333
- [mypy](https://github.com/python/mypy)
34+
- [(vulture)](https://github.com/jendrikseipp/vulture)
3435
- [poetry](https://github.com/python-poetry/poetry)
3536

3637
## [Makefile](Makefile)
@@ -41,7 +42,7 @@ To start your work, you need to set up your local environment and hooks.
4142
make install_dev
4243
```
4344

44-
You gonna put your CLI here later. It already contains calls to build tools and checks. Use `build` to run them all (`isort`, `black`, `pre_commit`, `flake8`, `mypy`, `test`).
45+
You gonna put your CLI here later. It already contains calls to build tools and checks. Use `build` to run them all (`isort`, `black`, `pre_commit`, `flake8`, `mypy`, `vulture`, `test`).
4546

4647
```sh
4748
make build
@@ -68,7 +69,6 @@ This hook is here to prevent you from committing any nasty code to your reposito
6869
- miscellaneous syntax checks and fixers
6970
- no commit to main branch (these should be only merged with PRs)
7071
- refactor relative imports [(absolufy-imports)](https://github.com/MarcoGorelli/absolufy-imports)
71-
- detect dead code [(vulture)](https://github.com/jendrikseipp/vulture)
7272
- spell checks [(codespell)](https://github.com/codespell-project/codespell)
7373
- sort imports [isort](https://github.com/timothycrosley/isort)
7474
- upgrade old syntax to newer Python version [(pyupgrade)](https://github.com/asottile/pyupgrade)

0 commit comments

Comments
 (0)