-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpyproject.toml
194 lines (161 loc) · 5.63 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
[project]
name = "runenv"
description = ''
dynamic = ["version"]
readme = "README.md"
requires-python = ">=2.7"
license = "MIT"
keywords = []
authors = [{ name = "Marek Wywiał", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []
[project.urls]
Documentation = "https://github.com/onjin/runenv#readme"
Issues = "https://github.com/onjin/runenv/issues"
Source = "https://github.com/onjin/runenv"
[project.scripts]
runenv = "runenv:run"
[project.optional-dependencies]
devel-types = ["mypy"]
devel-test = ["coverage[toml]", "pytest", "pytest-cov"]
devel-docs = ["mkdocs", "mkdocs-material"]
devel = [
"runenv[devel-docs,devel-types,devel-test]",
"ruff==0.7.1",
"mkchangelog",
]
################################################################################
## Hatch Build Configuration
################################################################################
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/runenv/__about__.py"
################################################################################
## Hatch Environment Configuration
################################################################################
[tool.hatch.envs.default]
installer = "uv"
features = ["devel"]
extra-dependencies = [
"hatchling",
"packaging",
"setuptools ; python_version >= '3.12'",
]
[tool.hatch.envs.default.scripts]
lint = "ruff check --output-format=full --show-fixes {args:./src}"
format = "black {args:./src}"
typecheck = "mypy {args:.}"
test = "pytest tests/ {args}"
all = ["format", "lint", "typecheck", "test"]
[tool.hatch.envs.test]
installer = "uv"
features = ["devel-test"]
[[tool.hatch.envs.test.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
################################################################################
## PyTest Configuration
################################################################################
[tool.pytest.ini_options]
pythonpath = "."
addopts = [
"--import-mode=importlib",
"--cov-config=pyproject.toml",
"--cov=runenv",
"--cov-report=xml",
]
filterwarnings = [
"ignore::DeprecationWarning:runenv",
"ignore::DeprecationWarning:tests",
"ignore::PendingDeprecationWarning:runenv",
"ignore::PendingDeprecationWarning:tests",
]
log_level = "NOTSET"
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
log_date_format = "%H:%M:%S"
markers = []
################################################################################
## Coverage
################################################################################
[tool.coverage.paths]
runenv = ["/src/runenv"]
tests = ["/tests"]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:", # Ignore non-runnable code
"if TYPE_CHECKING:", # Ignore typing
"raise NotImplementedError", # Ignore defensive assertions
"@(abc\\.)?abstractmethod", # Ignore abstract methods
]
################################################################################
## Black
################################################################################
[tool.black]
target-version = ["py37"]
line-length = 120
skip-string-normalization = true
################################################################################
## Ruff Configuration
################################################################################
[tool.ruff]
target-version = "py37"
line-length = 120
extend-exclude = []
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D200", # Require single line docstrings to be on one line.
"D203", # Require blank line before class docstring
"D212", # Multi-line docstring summary must start at the first line
"ANN101", # `self` must be typed
"ANN102", # `cls` must be typed
"FIX002", # Forbid TODO in comments
"TD002", # Assign someone to 'TODO' comments
# The following are disabled for compatibility with the formatter
"COM812", # Enforce trailing commas
"ISC001", # Require imports to be sorted
"ANN401", # Sometimes we return Any for now
"PLR0913", # Allow too many parameters
"D107", # Do not force docstrings on __init__
"D100", # Missing docstrings
"D101", # Missing docstrings
"D102", # Missing docstrings
"D103", # Missing docstrings
"D104", # Missing docstrings
"C901", # We have complex functions
"PLR0912", # With many branches
"PTH100", # Will migrate to Path later
"PTH110", # Will migrate to Path later
"PTH116", # Will migrate to Path later
"PTH118", # Will migrate to Path later
"PTH119", # Will migrate to Path later
"PTH120", # Will migrate to Path later
"PTH123", # Will migrate to Path later
"PTH207", # Will migrate to Path later
]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["runenv"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.format]
preview = true
docstring-code-format = true
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]