Skip to content

Commit df47d56

Browse files
committed
Adds Python 3.13 support. Modernizes tooling.
1 parent ca2a967 commit df47d56

10 files changed

Lines changed: 272 additions & 64 deletions

File tree

.bumpversion.cfg

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/python-pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
11+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
1212

1313
steps:
1414
- uses: actions/checkout@v4
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install tox tox-gh-actions
24+
pip install tox tox-gh-actions tox-uv
2525
2626
- name: Test with tox without uploading coverage
2727
run: tox

.github/workflows/python-tox.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
11+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
1212

1313
steps:
1414
- uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install dependencies
3636
run: |
3737
python -m pip install --upgrade pip
38-
pip install tox tox-gh-actions
38+
pip install tox tox-gh-actions tox-uv
3939
4040
- name: Test with tox and upload coverage results
4141
run: tox -- --codecov --codecov-token=${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
exclude: '^(.bumpversion.cfg)$'
@@ -13,20 +13,25 @@ repos:
1313
hooks:
1414
- id: rst-linter
1515
files: '^[A-Z]+\.rst$'
16-
additional_dependencies:
17-
- types_requests
1816
- repo: https://github.com/seantis/pre-commit-hooks
1917
rev: v1.1.0
2018
hooks:
2119
- id: nocheckin
2220
exclude: .pre-commit-config.yaml
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: v0.9.1
23+
hooks:
24+
- id: ruff
25+
args: [ "--fix" ]
2326
- repo: https://github.com/PyCQA/flake8
2427
rev: 7.1.1
2528
hooks:
2629
- id: flake8
30+
additional_dependencies:
31+
- flake8-type-checking
2732
files: '^(sedate/.*|tests/.*)\.py$'
2833
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.11.1
34+
rev: v1.14.1
3035
hooks:
3136
- id: mypy
3237
files: '^sedate/.*\.py$'

HISTORY.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
---------
33

4+
- Adds support for Python 3.13. Drops support for Python 3.8
5+
[Daverball]
6+
47
1.1.1 (2024-08-13)
58
~~~~~~~~~~~~~~~~~~~
69

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Run the Tests
3737

3838
Install tox and run it::
3939

40-
pip install tox
40+
pip install tox tox-uv
4141
tox
4242

4343
Limit the tests to a specific python version::
4444

45-
tox -e py37
45+
tox -e py311
4646

4747
Conventions
4848
-----------
@@ -59,9 +59,9 @@ Development
5959

6060
Setup your local development environment::
6161

62-
python3.8 -m venv venv
62+
python3 -m venv venv
6363
source venv/bin/activate
64-
pip install .[dev]
64+
pip install -e .[dev]
6565
pre-commit install
6666

6767
License

pyproject.toml

Lines changed: 212 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,32 @@ exclude_lines = [
2828
"raise NotImplementedError"
2929
]
3030

31+
[tool.bumpversion]
32+
current_version = "1.1.1"
33+
commit = true
34+
message = "Release {new_version}"
35+
tag = true
36+
tag_message = "Release {new_version}"
37+
38+
[[tool.bumpversion.files]]
39+
filename = "sedate/__init__.py"
40+
search= "__version__ = '{current_version}'"
41+
replace= "__version__ = '{new_version}'"
42+
43+
[[tool.bumpversion.files]]
44+
filename = "HISTORY.rst"
45+
search = """
46+
---------
47+
"""
48+
replace = """
49+
---------
50+
51+
{new_version} ({now:%d.%m.%Y})
52+
~~~~~~~~~~~~~~~~~~~
53+
"""
54+
3155
[tool.mypy]
32-
python_version = 3.8
56+
python_version = 3.9
3357
follow_imports = "silent"
3458
warn_redundant_casts = true
3559
warn_unreachable = true
@@ -38,27 +62,192 @@ disallow_any_generics = true
3862
disallow_untyped_defs = true
3963
mypy_path = "$MYPY_CONFIG_FILE_DIR"
4064

41-
[[tool.mypy.overrides]]
42-
module = []
43-
ignore_missing_imports = true
65+
[tool.ruff]
66+
exclude = [
67+
".bzr",
68+
".direnv",
69+
".eggs",
70+
".git",
71+
".git-rewrite",
72+
".hg",
73+
".ipynb_checkpoints",
74+
".mypy_cache",
75+
".nox",
76+
".pants.d",
77+
".pyenv",
78+
".pytest_cache",
79+
".pytype",
80+
".ruff_cache",
81+
".svn",
82+
".tox",
83+
".venv",
84+
".vscode",
85+
"__pypackages__",
86+
"_build",
87+
"buck-out",
88+
"build",
89+
"dist",
90+
"node_modules",
91+
"site-packages",
92+
"venv",
93+
]
94+
src = ["src", "tests"]
95+
include = [
96+
"pyproject.toml",
97+
"sedate/**/*.py",
98+
"tests/**/*.py",
99+
"stubs/**/*.pyi"
100+
]
101+
line-length = 79
102+
indent-width = 4
103+
target-version = "py39"
104+
105+
[tool.ruff.lint]
106+
select = [
107+
"B0",
108+
"B904",
109+
"B909",
110+
"C4",
111+
"COM818",
112+
"D2",
113+
"D301",
114+
"D4",
115+
"E",
116+
"F",
117+
"FLY002",
118+
"I002",
119+
"ISC",
120+
"N",
121+
"PERF",
122+
"PGH004",
123+
"PIE",
124+
"PYI",
125+
"Q",
126+
"RUF",
127+
"SIM",
128+
"SLOT",
129+
"UP",
130+
"W"
131+
]
132+
ignore = [
133+
"B007",
134+
"C420",
135+
"D200",
136+
"D201",
137+
"D202",
138+
"D204",
139+
"D205",
140+
"D209",
141+
"D210",
142+
"D211",
143+
"D400",
144+
"D401",
145+
"D412",
146+
"E226",
147+
"E402",
148+
"E711",
149+
"E712",
150+
"E741",
151+
"N818",
152+
"PYI019",
153+
"PYI041",
154+
"RUF012",
155+
"RUF013",
156+
"RUF021",
157+
"RUF022",
158+
"RUF023",
159+
"RUF031",
160+
"RUF052",
161+
"RUF056",
162+
"SIM103",
163+
"SIM105",
164+
"SIM108",
165+
"SIM110",
166+
"SIM118",
167+
"SIM210",
168+
"SIM910",
169+
"UP009",
170+
"UP012",
171+
"UP032",
172+
"UP038",
173+
]
174+
unfixable = []
175+
external = ["TC"]
176+
allowed-confusables = ["×"]
177+
preview = true
178+
179+
[tool.ruff.lint.extend-per-file-ignores]
180+
"tests/**/*.py" = [
181+
"C4",
182+
"D",
183+
"FLY002",
184+
"I002",
185+
"ISC",
186+
"N",
187+
"Q",
188+
"PERF",
189+
"PGH",
190+
"PIE",
191+
"PYI",
192+
"RUF",
193+
"SIM",
194+
"UP",
195+
]
196+
197+
[tool.ruff.lint.isort]
198+
required-imports = ["from __future__ import annotations"]
199+
200+
[tool.ruff.lint.pep8-naming]
201+
extend-ignore-names = [
202+
"afterFlowable",
203+
"HSTORE",
204+
"sortKey",
205+
"URL",
206+
"UUID"
207+
]
208+
classmethod-decorators = [
209+
# NOTE: We can potentially get rid some of these with SQLAlchemy 2.0
210+
# since they should cleanly combine with classmethod
211+
"declared_attr",
212+
"expression",
213+
"comparator",
214+
]
215+
216+
[tool.ruff.lint.pydocstyle]
217+
convention = "pep257"
218+
ignore-decorators = ["typing.overload"]
219+
220+
[tool.ruff.lint.flake8-quotes]
221+
avoid-escape = true
222+
docstring-quotes = "double"
223+
inline-quotes = "single"
224+
multiline-quotes = "double"
225+
226+
[tool.ruff.format]
227+
quote-style = "single"
228+
indent-style = "space"
229+
skip-magic-trailing-comma = false
230+
line-ending = "lf"
231+
docstring-code-format = true
232+
docstring-code-line-length = "dynamic"
44233

45234
[tool.tox]
46235
legacy_tox_ini = """
47236
[tox]
48237
isolated_build = True
49-
envlist = py37,py38,py39,py310,lint,bandit,mypy
238+
envlist = py39,py310,py311,py312,py313,lint,bandit,mypy
50239
51240
[gh-actions]
52241
python =
53-
3.8: py38,flake8,bandit,mypy
54242
3.9: py39
55243
3.10: py310
56-
3.11: py310
57-
3.12: py310
244+
3.11: py311,flake8,bandit,mypy
245+
3.12: py312
246+
3.13: py313
58247
59248
[testenv]
60249
setenv =
61-
py{38,39,310,311,312}: COVERAGE_FILE = .coverage.{envname}
250+
py{39,310,311,312,313}: COVERAGE_FILE = .coverage.{envname}
62251
deps =
63252
coverage[toml]
64253
pytest
@@ -67,20 +256,29 @@ deps =
67256
commands = py.test --cov={envsitepackagesdir}/sedate --cov-report= {posargs}
68257
69258
[testenv:lint]
70-
basepython = python3.8
259+
basepython = python3.11
71260
deps =
72261
flake8
73-
commands = flake8 sedate/ tests/
262+
flake8-type-checking
263+
ruff
264+
commands =
265+
ruff check
266+
flake8 sedate/ tests/
74267
75268
[testenv:mypy]
76-
basepython = python3.8
269+
basepython = python3.11
77270
deps =
78271
mypy
79272
types-pytz
80-
commands = mypy -p sedate
273+
commands =
274+
mypy -p sedate --python-version 3.9
275+
mypy -p sedate --python-version 3.10
276+
mypy -p sedate --python-version 3.11
277+
mypy -p sedate --python-version 3.12
278+
mypy -p sedate --python-version 3.13
81279
82280
[testenv:bandit]
83-
basepython = python3.8
281+
basepython = python3.11
84282
deps =
85283
bandit[toml]
86284
commands = bandit -q -c pyproject.toml -r sedate/

0 commit comments

Comments
 (0)