Skip to content

Commit 073a771

Browse files
committed
Chore: Format pyproject.toml using pyproject-fmt
1 parent 0a03da3 commit 073a771

3 files changed

Lines changed: 51 additions & 64 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ lint: ## lint the project
3737
ruff format --check .
3838

3939
format: ## Run code formatting
40+
pyproject-fmt --keep-full-version pyproject.toml
4041
ruff format .
4142
# Configure Ruff not to auto-fix (remove!):
4243
# Ignore unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001).

pyproject.toml

Lines changed: 49 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,94 @@
1-
# ==================
2-
# Build system setup
3-
# ==================
4-
51
[build-system]
2+
build-backend = "setuptools.build_meta"
63
requires = [
74
"setuptools>=42", # At least v42 of setuptools required!
85
"versioningit",
96
]
10-
build-backend = "setuptools.build_meta"
11-
12-
[tool.pytest.ini_options]
13-
minversion = "2.0"
14-
addopts = """
15-
-rsfEX -p pytester --strict-markers --verbosity=3
16-
--cov=epo_ops tests --cov-report=term-missing --cov-report=xml
17-
"""
18-
log_level = "DEBUG"
19-
log_cli_level = "DEBUG"
20-
testpaths = ["tests"]
21-
xfail_strict = true
22-
markers = []
237

248
[tool.ruff]
259
line-length = 80
26-
10+
extend-exclude = [ "__init__.py" ]
2711
lint.select = [
28-
# Bandit
29-
"S",
30-
# Bugbear
31-
"B",
3212
# Builtins
3313
"A",
14+
# Bugbear
15+
"B",
16+
"B9",
3417
# comprehensions
3518
"C",
19+
# Pycodestyle
20+
"E",
3621
# eradicate
3722
"ERA",
38-
# flake8-2020
39-
"YTT",
23+
# Pyflakes
24+
"F",
4025
# isort
4126
"I",
4227
# pandas-vet
4328
"PD",
44-
# print
45-
"T20",
46-
# Pycodestyle
47-
"E",
48-
"W",
49-
# Pyflakes
50-
"F",
5129
# return
5230
"RET",
31+
# Bandit
32+
"S",
5333
# from `.flake8` file
54-
"T", # T4
55-
"B9",
34+
"T", # T4
35+
# print
36+
"T20",
37+
"W",
38+
# flake8-2020
39+
"YTT",
5640
]
57-
58-
extend-exclude = ["__init__.py"]
59-
6041
lint.ignore = [
61-
"B905", # B905 `zip()` without an explicit `strict=` parameter
42+
"B905", # B905 `zip()` without an explicit `strict=` parameter
6243
"E203",
6344
"E266",
6445
"E501",
6546
"ERA001", # Found commented-out code
6647
"RET505", # Unnecessary `else` after `return` statement
6748
# "W503", # Unknown rule selector
6849
]
69-
50+
# FIXME: Improve this situation wrt. SQL injection, even it is not be an actual attack vector.
51+
lint.per-file-ignores."*sqlite.py" = [
52+
"S608", # Possible SQL injection vector through string-based query construction
53+
]
54+
lint.per-file-ignores."epo_ops/api.py" = [
55+
"A001", # Variable `range` is shadowing a Python builtin
56+
"A002", # Argument `input` is shadowing a Python builtin
57+
"C408", # Unnecessary `dict` call (rewrite as a literal)
58+
]
59+
lint.per-file-ignores."tests/*" = [
60+
"S101", # Use of `assert` detected
61+
]
62+
lint.per-file-ignores."tests/middlewares/throttle/conftest.py" = [
63+
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
64+
]
7065
# from `.isort.cfg` file
71-
[tool.ruff.lint.isort]
72-
combine-as-imports = true
73-
force-wrap-aliases = true
74-
known-third-party = [
66+
lint.isort.combine-as-imports = true
67+
lint.isort.force-wrap-aliases = true
68+
lint.isort.known-third-party = [
7569
"dateutil",
7670
"dogpile",
7771
"dotenv",
7872
"pytest",
7973
"requests",
8074
"six",
8175
]
82-
split-on-trailing-comma = false
83-
76+
lint.isort.split-on-trailing-comma = false
8477
# from `.flake8` file
85-
[tool.ruff.lint.mccabe]
8678
# Flag errors (`C901`) whenever the complexity level exceeds the configured value.
87-
max-complexity = 7
88-
89-
90-
[tool.ruff.lint.per-file-ignores]
91-
"tests/*" = [
92-
"S101", # Use of `assert` detected
93-
]
94-
"epo_ops/api.py" = [
95-
"A001", # Variable `range` is shadowing a Python builtin
96-
"A002", # Argument `input` is shadowing a Python builtin
97-
"C408", # Unnecessary `dict` call (rewrite as a literal)
98-
]
99-
# FIXME: Improve this situation wrt. SQL injection, even it is not be an actual attack vector.
100-
"*sqlite.py" = [
101-
"S608", # Possible SQL injection vector through string-based query construction
102-
]
103-
"tests/middlewares/throttle/conftest.py" = [
104-
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
105-
]
79+
lint.mccabe.max-complexity = 7
10680

81+
[tool.pytest]
82+
ini_options.minversion = "2.0"
83+
ini_options.addopts = """
84+
-rsfEX -p pytester --strict-markers --verbosity=3
85+
--cov=epo_ops tests --cov-report=term-missing --cov-report=xml
86+
"""
87+
ini_options.log_level = "DEBUG"
88+
ini_options.log_cli_level = "DEBUG"
89+
ini_options.testpaths = [ "tests" ]
90+
ini_options.xfail_strict = true
91+
ini_options.markers = []
10792

10893
[tool.versioningit]
10994
vcs.method = "git-archive"

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
],
3838
extras_require={
3939
"develop": [
40+
"pyproject-fmt<3",
4041
"ruff<0.16; python_version >= '3.7'",
4142
"twine<7",
4243
"wheel<1",

0 commit comments

Comments
 (0)