-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
209 lines (189 loc) · 6.39 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
[project]
name = "pytest_time"
dynamic = ["version", "readme"]
dependencies = [
"pytest",
]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"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",
"Framework :: Pytest",
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Unit",
]
requires-python = ">=3.8"
[project.entry-points.pytest11]
pytest_time = "pytest_time"
[tool.uv]
dev-dependencies = [
"coverage>=7.3.1",
"hypothesis>=6.78",
"pytest>=8.0.0",
"pytest-check>=2.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.11.1",
"types-pillow>=10.2.0.20240822",
"types-pygments>=2.18.0.20240506",
"types-colorama>=0.4.15.20240311",
"types-docutils>=0.21.0.20240724",
"types-pytz>=2024.1.0.20240417",
"types-setuptools>=73.0.0.20240822",
"mypy[reports]>=1.3.0,<2",
"pyright==1.1.391",
"codespell[toml]>=2.2.4,<3",
"rstcheck[sphinx,toml]>=6.0.0,<7",
"yamllint>=1.32.0,<2"
]
constraint-dependencies = [
# These constraints were placed here to allow lowest resolution to work.
# Some packages don't declare version requirements so we need this.
"docutils>=0.15.0",
"lxml>=4.0.0",
"pygments>=2.0.0",
]
[build-system]
requires = [
"setuptools>=67.7.2",
"setuptools_scm[toml]>=7.1"
]
build-backend = "setuptools.build_meta"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.dynamic]
readme = {file = "README.rst"}
[tool.setuptools_scm]
write_to = "src/pytest_time/_version.py"
[tool.black]
target-version = ["py38"]
[tool.codespell]
skip = ".tox,.git,build,.*_cache,__pycache__,./docs/_build,.direnv,.venv,venv"
quiet-level = 3
check-filenames = true
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = "tests"
xfail_strict = true
pytester_example_dir = "pytester"
[tool.coverage.run]
branch = true
parallel = true
omit = ["tests/**"]
[tool.coverage.report]
skip_empty = true
[tool.pyright]
strict = ["pytest_time"]
pythonVersion = "3.8"
pythonPlatform = "Linux"
[tool.mypy]
python_version = "3.8"
packages = ["pytest_time", "tests"]
warn_unused_configs = true
warn_redundant_casts = true
strict_equality = true
strict_concatenate = true
warn_return_any = true
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_any_generics = true
disallow_untyped_defs = true
no_implicit_optional = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "pytest_check"
ignore_missing_imports = true
[tool.ruff]
line-length = 88
target-version = "py38"
src = ["src", "tests"]
extend-exclude = [
"docs",
"__pycache__",
]
[tool.ruff.lint]
extend-select = [
"F", # The rules built into Flake8
"E", "W", # pycodestyle errors and warnings
"C90", # mccabe
"I", # isort checking
"N", # PEP8 naming
"D", # Implement pydocstyle checking as well.
"UP", # Pyupgrade - note that some of are excluded below due to Python versions
"YTT", # flake8-2020: Misuse of `sys.version` and `sys.version_info`
"ANN", # Type annotations.
"ASYNC", # Asynchronous stuff
"S", # flake8-bandit
"BLE", # Do not catch blind exceptions
"FBT", # Disallow boolean positional arguments (make them keyword-only)
"B", # Bugbears
"A", # Shadowing built-ins.
"C4", # Encourage comprehensions, which tend to be faster than alternatives.
"COM", # Commas
"DTZ", # Datetime
"T10", # Don't call the debugger in production code
"EM", # Error messages
"FA", # Future Annotations
"ISC", # Implicit string concatenation that can cause subtle issues
"ICN", # Only use common conventions for import aliases.
"LOG", # Logging
"G", # Logging format
"INP", # Implicit namespace packages
"PIE", # Mmm pie
"T20", # No printing
"PYI", # Linting for type stubs.
"PT", # Pytest
"Q", # Consistent quotations
"RSE", # Errors on pytest raises.
"RET", # Simpler logic after return, raise, continue or break
"SLF", # Private member access
"SLOT", # __slots__
"SIM", # Code simplification
"TID", # Tidy imports
"TCH", # Guard imports only used for type checking behind a type-checkning block.
"INT", # gettext
"ARG", # Unused arguments
"PTH", # Migrate to pathlib
"TD", # TODOs
"FIX", # FIXMEs
"ERA", # Don't check in commented out code
"PGH", # Pygrep hooks
"PL", # Pylint
"TRY", # Cleaner try/except,
"DOC", # Pydoclint
"RUF001", "RUF002", "RUF003", # Ambiguous unicode characters
"RUF005", # Encourages unpacking rather than concatenation
"RUF008", # Do not use mutable default values for dataclass attributes
"RUF100", # #noqa directive that doesn't flag anything
]
ignore = [
"COM812", "ISC001", # Conflicts with the formatter.
"ANN10", # Type annotations for `self` and `cls`
"D105", # Missing docstring in magic method (reason: magic methods already have definitions)
"D107", # Missing docstring in __init__ (reason: documented in class docstring)
"D203", # 1 blank line required before class docstring (reason: pep257 default)
"D213", # Multi-line docstring summary should start at the second line (reason: pep257 default)
"D215", # Section underline is over-indented (reason: pep257 default)
"A003", # Class attribute shadowing built-in (reason: Class attributes don't often get bare references)
]
[tool.ruff.lint.per-file-ignores]
"test_*.py" = [ # Some things we want for the moin project are unnecessary in tests.
"D", # Ignore docstring rules in tests
"ANN", # Ignore type annotations in tests
"S101", # Allow assertions in tests
"S103", # Allow `os.chmod` setting a permissive mask `0o555` on file or directory
"S108", # Allow Probable insecure usage of temporary file or directory
"PLR0913", # Allow many arguments for test functions
"PLR2004", # Allow magic values in tests
"SLF001", # Allow accessing private members from tests
]
# isort leaves init files alone by default, this makes ruff ignore them too.
"__init__.py" = ["I001"]