Skip to content

Commit 58fcbd7

Browse files
authored
Merge pull request #118 from smkent/update
Update template Python, Poetry versions, migrate to ruff
2 parents e7df558 + 08c7942 commit 58fcbd7

5 files changed

Lines changed: 62 additions & 74 deletions

File tree

{{cookiecutter.project_name}}/.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: Release
44
env:
55
ENABLE_PYPI_PUBLISH: {{ "true" if cookiecutter.enable_pypi_publish|lower == "yes" else "false" }}
66
ENABLE_TEST_PYPI_PUBLISH: false
7-
RELEASE_PYTHON_VERSION: "3.12"
8-
RELEASE_POETRY_VERSION: "2.0"
7+
RELEASE_PYTHON_VERSION: "3.14"
8+
RELEASE_POETRY_VERSION: "2.2"
99

1010
on:
1111
push:

{{cookiecutter.project_name}}/.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
- "3.11"
2626
- "3.12"
2727
- "3.13"
28+
- "3.14"
2829
poetry-version:
29-
- "2.0"
30+
- "2.2"
3031

3132
runs-on: ${{ "{{" }} matrix.os }}-latest
3233
steps:

{{cookiecutter.project_name}}/.github/workflows/container.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: Build
44
env:
55
REGISTRY: ghcr.io
66
IMAGE_NAME: ${{ "{{" }} github.repository }}
7-
RELEASE_PYTHON_VERSION: "3.12"
8-
RELEASE_POETRY_VERSION: "2.0"
7+
RELEASE_PYTHON_VERSION: "3.14"
8+
RELEASE_POETRY_VERSION: "2.2"
99

1010
on:
1111
pull_request:
Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,29 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
4-
hooks:
5-
- id: check-yaml
6-
- id: check-merge-conflict
7-
- id: debug-statements
8-
- id: end-of-file-fixer
9-
- id: trailing-whitespace
10-
- repo: https://github.com/psf/black
11-
rev: 23.1.0
12-
hooks:
13-
- id: black
14-
args: ["--config", "pyproject.toml"]
15-
- repo: https://github.com/pycqa/isort
16-
rev: 5.12.0
17-
hooks:
18-
- id: isort
19-
args: ["--show-config"]
20-
- repo: https://github.com/pycqa/bandit
21-
rev: 1.7.4
22-
hooks:
23-
- id: bandit
24-
additional_dependencies: ['.[toml]']
25-
args: ["--configfile", "pyproject.toml"]
26-
exclude: '^tests/'
27-
- repo: https://github.com/pycqa/flake8
28-
rev: 6.0.0
29-
hooks:
30-
- id: flake8
31-
additional_dependencies:
32-
- flake8-bugbear
33-
- flake8-pyproject
34-
- flake8-simplify
35-
- pep8-naming
36-
- repo: https://github.com/pycqa/autoflake
37-
rev: v2.0.1
38-
hooks:
39-
- id: autoflake
40-
- repo: https://github.com/asottile/pyupgrade
41-
rev: v3.3.1
42-
hooks:
43-
- id: pyupgrade
44-
args: ["--py39-plus", "--keep-runtime-typing"]
45-
- repo: local
46-
hooks:
47-
- id: mypy
48-
name: mypy
49-
language: python
50-
types_or: [python, pyi]
51-
entry: env -u VIRTUAL_ENV poetry run mypy
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: check-merge-conflict
7+
- id: debug-statements
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.14.11
12+
hooks:
13+
- id: ruff
14+
args: ["--fix"]
15+
- id: ruff-format
16+
- repo: https://github.com/pycqa/bandit
17+
rev: 1.9.2
18+
hooks:
19+
- id: bandit
20+
additional_dependencies: ['.[toml]']
21+
args: ["--configfile", "pyproject.toml"]
22+
exclude: '^tests/'
23+
- repo: local
24+
hooks:
25+
- id: mypy
26+
name: mypy
27+
language: python
28+
types_or: [python, pyi]
29+
entry: env -u VIRTUAL_ENV poetry run mypy

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ classifiers = [
1515
"Topic :: Software Development :: Libraries :: Python Modules",
1616
"Typing :: Typed",
1717
]
18-
requires-python = ">=3.9,<4.0"
18+
requires-python = ">=3.10,<4.0"
1919
dynamic = [ "version" ]
2020
dependencies = [
2121
]
@@ -31,21 +31,15 @@ poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
3131

3232
[tool.poetry.group.dev.dependencies]
3333
bandit = {extras = ["toml"], version = "*"}
34-
black = "*"
3534
cruft = "*"
36-
flake8 = "*"
37-
flake8-bugbear = "*"
38-
flake8-pyproject = "*"
39-
flake8-simplify = "*"
40-
isort = "*"
4135
mypy = "*"
42-
pep8-naming = "*"
4336
poethepoet = "*"
4437
pre-commit = "*"
4538
pytest = "*"
4639
pytest-cov = "*"
4740
pytest-github-actions-annotate-failures = "*"
4841
pytest-sugar = "*"
42+
ruff = "*"
4943

5044
[tool.poetry-dynamic-versioning]
5145
enable = true
@@ -67,9 +61,6 @@ help = "Run all tests"
6761
[tool.bandit]
6862
skips = ["B101"] # assert_used
6963

70-
[tool.black]
71-
line-length = 79
72-
7364
[tool.coverage.run]
7465
source = ["{{ cookiecutter.project_slug }}"]
7566

@@ -80,14 +71,6 @@ show_missing = true
8071
[tool.cruft]
8172
skip = [".git"]
8273

83-
[tool.flake8]
84-
exclude = "./.*"
85-
86-
[tool.isort]
87-
atomic = true
88-
profile = "black"
89-
line_length = 79
90-
9174
[tool.mypy]
9275
files = [ "tests", "{{ cookiecutter.project_slug }}" ]
9376
mypy_path = "types"
@@ -107,4 +90,30 @@ addopts = """\
10790
--junitxml=.pytest_results.xml \
10891
"""
10992

93+
[tool.ruff]
94+
target-version = "py310"
95+
line-length = 79
96+
fix = true
97+
98+
select = [
99+
"E", "W", # pycodestyle
100+
"F", # pyflakes
101+
"I", # isort
102+
"B", # bugbear
103+
"SIM", # flake8-simplify
104+
"N", # pep8-naming
105+
"UP", # pyupgrade
106+
]
107+
108+
exclude = [
109+
".git",
110+
".venv",
111+
"__pycache__",
112+
]
113+
114+
[tool.ruff.format]
115+
quote-style = "double"
116+
indent-style = "space"
117+
line-ending = "auto"
118+
110119
# vim: ft=cfg

0 commit comments

Comments
 (0)