Skip to content

Commit 3a9ebc1

Browse files
committed
Update quality and setup ruff
1 parent 3fcaba1 commit 3a9ebc1

File tree

3 files changed

+52
-44
lines changed

3 files changed

+52
-44
lines changed

pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
[build-system]
22
requires = ['setuptools>=61.0']
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.doc8]
6+
max-line-length = 120
7+
allow-long-titles = true
8+
9+
[tool.mypy]
10+
ignore_missing_imports = true
11+
disallow_untyped_defs = true
12+
disallow_incomplete_defs = true
13+
warn_redundant_casts = true
14+
warn_return_any = true
15+
warn_unreachable = true
16+
warn_unused_ignores = true
17+
18+
[[tool.mypy.overrides]]
19+
module = "recuair_cli.tests.*"
20+
disallow_untyped_defs = false
21+
check_untyped_defs = true
22+
23+
[tool.ruff]
24+
target-version = "py39"
25+
line-length = 120
26+
27+
[tool.ruff.lint]
28+
select = ["E4", "E7", "E9", "F", "W", "C90", "I", "D", "S", "C", "UP", "B", "ISC", "G", "RSE"]
29+
ignore = ["D105", "D106", "D107", "UP032", "ISC001"]
30+
31+
[tool.ruff.lint.per-file-ignores]
32+
"**/tests/*" = ["D1", "S101", "S105", "S106", "S107", "B015", "B018"]
33+
34+
[tool.ruff.lint.isort]
35+
combine-as-imports = true
36+
37+
[tool.ruff.lint.mccabe]
38+
max-complexity = 10
39+
40+
[tool.ruff.lint.pycodestyle]
41+
max-doc-length = 120
42+
43+
[tool.ruff.lint.pydocstyle]
44+
convention = "google"

setup.cfg

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,9 @@ console_scripts =
3838

3939
[options.extras_require]
4040
quality =
41-
bandit
4241
doc8
43-
flake8
44-
isort
4542
mypy
46-
pydocstyle
43+
ruff
4744
tests =
4845
respx
4946
testfixtures
50-
types =
51-
52-
[doc8]
53-
max-line-length = 120
54-
allow-long-titles = true
55-
56-
[flake8]
57-
max-line-length=120
58-
59-
[isort]
60-
line_length = 120
61-
combine_as_imports = true
62-
default_section = THIRDPARTY
63-
known_first_party = recuair_cli
64-
65-
[pydocstyle]
66-
convention = google
67-
68-
[mypy]
69-
disallow_untyped_defs = true
70-
disallow_incomplete_defs = true
71-
ignore_missing_imports = true
72-
warn_redundant_casts = true
73-
warn_return_any = true
74-
warn_unreachable = true
75-
warn_unused_ignores = true
76-
77-
[mypy-recuair_cli.tests.*]
78-
disallow_untyped_defs = false

tox.ini

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22
envlist =
33
quality
44
clear-coverage
5-
py{38,39,310,311,312}
5+
py{39,310,311,312,313}
66
compute-coverage
77

88
[testenv]
99
depends = clear-coverage
1010
extras =
1111
tests
1212
deps =
13-
coverage
13+
coverage[toml] # remove '[toml]' when Python 3.9 is no longer used
1414
skip_install =
1515
coverage: true
1616
setenv =
17-
PYTHONWARNINGS = {env:PYTHONWARNINGS:all}
17+
py{39,310,311,312,313}: PYTHONWARNINGS = {env:PYTHONWARNINGS:all}
1818
commands =
1919
coverage run --parallel-mode --source=recuair_cli --branch -m unittest {posargs:discover}
20+
constrain_package_deps = true
21+
use_frozen_constraints = true
22+
uv_python_preference = only-system
2023

2124
[testenv:clear-coverage]
2225
depends =
@@ -25,7 +28,7 @@ commands =
2528

2629
[testenv:compute-coverage]
2730
depends =
28-
py{38,39,310,311,312}
31+
py{39,310,311,312,313}
2932
parallel_show_output = true
3033
commands =
3134
coverage combine
@@ -36,15 +39,11 @@ commands =
3639
depends =
3740
extras =
3841
quality
39-
types
40-
# Disable pythonwarnings
41-
setenv =
42+
tests
4243
# Do not fail on first error, but run all the checks
4344
ignore_errors = true
4445
commands =
45-
isort --check-only --diff recuair_cli
46-
flake8 --format=pylint recuair_cli
47-
bandit --recursive recuair_cli
46+
ruff check
47+
ruff format --check
4848
mypy recuair_cli
49-
pydocstyle recuair_cli
5049
doc8 CHANGELOG.rst README.rst

0 commit comments

Comments
 (0)