Skip to content

Commit f73be0c

Browse files
committed
Update for python 3.13.
1 parent 14030f1 commit f73be0c

5 files changed

+45
-31
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-yaml
88
- id: check-added-large-files
99
- repo: https://github.com/psf/black
10-
rev: 24.4.2
10+
rev: 24.10.0
1111
hooks:
1212
- id: black
1313
- repo: https://github.com/charliermarsh/ruff-pre-commit
14-
rev: v0.4.9
14+
rev: v0.6.9
1515
hooks:
1616
- id: ruff
1717
- repo: https://github.com/pre-commit/mirrors-prettier

README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ A magic-free, understandable python project template using tox, ruff, pytest and
44
pip-tools. This template requires you to manage your own virtual environment,
55
but the configuration is explicit and easy to understand.
66

7-
This is a great starting point, but it is just that. There are a great many best
8-
practices with respect to packaging and distribution that are not covered here,
9-
and for which I refer you to
7+
This is a great starting point for internal tools, but it is just that. There
8+
are a great many best practices with respect to packaging and distribution that
9+
are not covered here, and for which I refer you to
1010
[Seth Michael Larson's secure-python-package-template](https://github.com/sethmlarson/secure-python-package-template).
1111

12+
Moreover, since I created this template, ruff has become a
13+
[for-profit company](https://astral.sh) and has integrated code formatting that
14+
replaces black. They have also developed [uv](https://docs.astral.sh/uv/) which
15+
has earned a strong foothold in the python workflow space. Much of this template
16+
could be simplified using those cutting edge tools, however I likely will not
17+
update it to match as I feel it is a useful reference for those who may not wish
18+
to depend entirely on a vc-backed ecosystem.
19+
1220
## Background
1321

1422
I owe a debt of gratitude to [Claudio Jolowicz](https://github.com/cjolowicz/)
@@ -147,8 +155,8 @@ tool:
147155
tox
148156
```
149157

150-
By default, this will create environments for py310, py311 and py312. This
151-
assumes all versions of python are available on your system. Take a look at
158+
By default, this will create environments for py310, py311, py312 and py313.
159+
This assumes all versions of python are available on your system. Take a look at
152160
pyenv to make this easy.
153161

154162
You can add additional python versions to test against by modifying `tox.ini`

pyproject.toml

+9-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
1920
"Programming Language :: Python :: Implementation :: CPython",
2021
]
2122
dependencies = []
@@ -53,7 +54,7 @@ fail_under = 100
5354
show_missing = true
5455

5556
[tool.mypy]
56-
python_version = "3.12"
57+
python_version = "3.13"
5758
warn_unused_configs = true
5859
warn_unused_ignores = true
5960
warn_redundant_casts = true
@@ -64,6 +65,10 @@ overrides = [{ module = [], ignore_missing_imports = true }]
6465

6566
[tool.ruff]
6667
target-version = "py312"
68+
src = ["src", "tests"]
69+
preview = true
70+
71+
[tool.ruff.lint]
6772
select = [
6873
"E", # pycodestyle
6974
"F", # pyflakes
@@ -124,18 +129,16 @@ select = [
124129
"RUF", # Ruff-specific rules
125130
]
126131
ignore = ["ANN101", "CPY001"] # annotations for self
127-
src = ["src", "tests"]
128-
preview = true
129132

130-
[tool.ruff.per-file-ignores]
133+
[tool.ruff.lint.per-file-ignores]
131134
"tests/*.py" = [
132135
"PLR2004", # magic value comparison
133136
"S101", # use of assert detected
134137
"TCH002", # third party import (for pytest)
135138
]
136139

137-
[tool.ruff.pydocstyle]
140+
[tool.ruff.lint.pydocstyle]
138141
convention = "pep257"
139142

140-
[tool.ruff.isort]
143+
[tool.ruff.lint.isort]
141144
known-first-party = ["bulletproof_python"]

requirements.txt

+18-16
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
#
55
# pip-compile --all-extras pyproject.toml
66
#
7-
black==24.4.2
7+
black==24.10.0
88
# via bulletproof-python (pyproject.toml)
9-
build==1.2.1
9+
build==1.2.2.post1
1010
# via pip-tools
1111
cfgv==3.4.0
1212
# via pre-commit
1313
click==8.1.7
1414
# via
1515
# black
1616
# pip-tools
17-
coverage==7.5.3
17+
coverage==7.6.2
1818
# via bulletproof-python (pyproject.toml)
19-
distlib==0.3.8
19+
distlib==0.3.9
2020
# via virtualenv
21-
filelock==3.15.1
21+
filelock==3.16.1
2222
# via virtualenv
23-
identify==2.5.36
23+
identify==2.6.1
2424
# via pre-commit
2525
iniconfig==2.0.0
2626
# via pytest
27-
mypy==1.10.0
27+
mypy==1.11.2
2828
# via bulletproof-python (pyproject.toml)
2929
mypy-extensions==1.0.0
3030
# via
@@ -41,27 +41,29 @@ pathspec==0.12.1
4141
# via black
4242
pip-tools==7.4.1
4343
# via bulletproof-python (pyproject.toml)
44-
platformdirs==4.2.2
44+
platformdirs==4.3.6
4545
# via
4646
# black
4747
# virtualenv
4848
pluggy==1.5.0
4949
# via pytest
50-
pre-commit==3.7.1
50+
pre-commit==4.0.1
5151
# via bulletproof-python (pyproject.toml)
52-
pyproject-hooks==1.1.0
53-
# via build
54-
pytest==8.2.0
52+
pyproject-hooks==1.2.0
53+
# via
54+
# build
55+
# pip-tools
56+
pytest==8.3.3
5557
# via bulletproof-python (pyproject.toml)
56-
pyyaml==6.0.1
58+
pyyaml==6.0.2
5759
# via pre-commit
58-
ruff==0.4.9
60+
ruff==0.6.9
5961
# via bulletproof-python (pyproject.toml)
6062
typing-extensions==4.12.2
6163
# via mypy
62-
virtualenv==20.26.2
64+
virtualenv==20.26.6
6365
# via pre-commit
64-
wheel==0.43.0
66+
wheel==0.44.0
6567
# via pip-tools
6668

6769
# The following packages are considered to be unsafe in a requirements file:

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ envlist =
55
py310
66
py311
77
py312
8+
py313
89
lint
910
type
1011

@@ -31,7 +32,7 @@ deps =
3132
ruff
3233
commands =
3334
black --check src tests
34-
ruff src tests
35+
ruff check src tests
3536

3637
[testenv:type]
3738
description = Run type checks

0 commit comments

Comments
 (0)