-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
244 lines (215 loc) · 7 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "repo_review"
authors = [
{ name = "Henry Schreiner", email = "henryfs@princeton.edu" },
]
description = "Framework that can run checks on repos"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Environment :: Console",
"Environment :: WebAssembly :: Emscripten",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"markdown-it-py",
"pyyaml",
"tomli; python_version < '3.11'",
"typing-extensions; python_version < '3.11'",
]
[project.urls]
Changelog = "https://github.com/scientific-python/repo-review/releases"
Demo = "https://scientific-python.github.io/repo-review"
Documentation = "https://repo-review.readthedocs.io"
Homepage = "https://repo-review.readthedocs.io"
Source = "https://github.com/scientific-python/repo-review"
[project.scripts]
repo-review = "repo_review.__main__:main"
[project.entry-points."repo_review.fixtures"]
pyproject = "repo_review.fixtures:pyproject"
list_all = "repo_review.fixtures:list_all"
[project.entry-points."validate_pyproject.tool_schema"]
repo-review = "repo_review.schema:get_schema"
[project.optional-dependencies]
cli = [
"click >=8",
"rich >=12.2",
"rich-click",
]
[dependency-groups]
test = [
"pytest >=7",
"sp-repo-review >=2024.08.19",
"validate-pyproject >=0.14",
]
dev = [
{ include-group = "test" },
"sp-repo-review[cli]",
"validate-pyproject-schema-store[all]",
]
docs = [
"furo",
"myst_parser >=0.13",
"repo-review[cli]",
"sphinx >=4.0",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinxcontrib-programoutput",
"sphinxext-opengraph",
"sphinx-github-changelog",
]
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/repo_review/_version.py"
[tool.hatch.envs.default]
installer = "uv"
[tool.hatch.envs.hatch-test]
features = ["cli"]
# duplicated since hatch doesn't support groups yet
dependencies = [
"pytest >=7",
"sp-repo-review >=2024.08.19",
"validate-pyproject >=0.14",
]
env-vars.PYTHONWARNDEFAULTENCODING = "1"
[tool.hatch.envs.lint]
dependencies = ["pre-commit"]
skip-install = true
scripts.lint = "pre-commit run --all-files --show-diff-on-failure {args}"
[tool.hatch.envs.pylint]
features = ["cli"]
dependencies = ["pylint>=3.2"]
scripts.lint = "pylint repo_review {args}"
[tool.hatch.envs.docs]
# duplicated since hatch doesn't support groups yet
dependencies = [
"furo",
"myst_parser >=0.13",
"repo-review[cli]",
"sphinx >=4.0",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinxcontrib-programoutput",
"sphinxext-opengraph",
"sphinx-github-changelog",
"sphinx-autobuild",
]
scripts.linkcheck = "sphinx-build -b=linkcheck docs docs/_build/linkcheck {args}"
scripts.html = "sphinx-build --keep-going -n -T -b=html docs docs/_build/html {args}"
scripts.serve = "sphinx-autobuild -n -T -b=html docs docs/_build/html {args}"
scripts.man = "sphinx-build --keep-going -n -T -b=man docs docs/_build/man {args}"
[tool.hatch.envs.api-docs]
skip-install = true
dependencies = ["sphinx"]
scripts.build = "sphinx-apidoc -o docs/api/ --module-first --no-toc --force src/repo_review"
[tool.hatch.envs.example]
features = ["cli"]
post-install-commands = ["$HATCH_UV pip install -e tests/test_utilities"]
[tool.hatch.envs.webapp]
skip-install = true
scripts.serve = "cd docs && echo 'Serving on http://localhost:8080' && python -m http.server 8080"
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.13", "3.12", "3.11", "3.10"]
[tool.pytest.ini_options]
minversion = "7.0"
addopts = ["-ra", "--strict-markers", "--strict-config", "--import-mode=importlib"]
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
"error",
"ignore:OptionHighlighter:DeprecationWarning", # rich-click triggers its own warning
"ignore:`highlighter`:DeprecationWarning", # rich-click triggers its own warning
]
testpaths = ["tests"]
pythonpath = ["tests/test_utilities"]
[tool.mypy]
mypy_path = ["src"]
files = ["src", "web", "tests"]
python_version = "3.10"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = "repo_review.*"
disallow_untyped_defs = true
[tool.pylint]
py-version = "3.10"
ignore-paths = ["src/repo_review/_version.py"]
ignored-modules = ["pyodide"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
"design",
"fixme",
"line-too-long",
"wrong-import-position",
"redefined-builtin",
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"invalid-name",
"redefined-outer-name",
"no-member", # better handled by mypy, etc.
"used-before-assignment", # False positive on conditional import
"unnecessary-ellipsis", # Not correct for typing
"import-outside-toplevel", # better handled elsewhere
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"TID251", # flake8-tidy-imports.banned-api
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
]
ignore = [
"ISC001", # May collide with formatter
"PLR09", # Too many X
"PLR2004", # Magic value in comparison
]
typing-modules = ["repo_review._compat.typing"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"typing.Callable".msg = "Use collections.abc.Callable instead."
"typing.Iterator".msg = "Use collections.abc.Iterator instead."
"typing.Mapping".msg = "Use collections.abc.Mapping instead."
"typing.Sequence".msg = "Use collections.abc.Sequence instead."
"typing.Set".msg = "Use collections.abc.Set instead."
"typing.assert_never".msg = "Use repo_review._compat.typing.assert_never instead."
"importlib.abc".msg = "Use repo_review._compat.importlib.resources.abc instead."
"importlib.resources.abc".msg = "Use repo_review._compat.importlib.resources.abc instead."
[tool.ruff.lint.per-file-ignores]
"src/repo_review/_compat/**.py" = ["TID251"]
"src/**/__main__.py" = ["T20"]