generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 14
/
pyproject.toml
246 lines (219 loc) · 7.84 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
245
246
[tool.poetry]
name = "fawltydeps"
version = "0.17.0"
description = "Find undeclared and unused 3rd-party dependencies in your Python project."
authors = [
"Maria Knorps <[email protected]>",
"Nour El Mawass <[email protected]>",
"Johan Herland <[email protected]>",
"Vince Reuter <[email protected]>",
"Zhihan Zhang <[email protected]>",
]
readme = "README.md"
license = "MIT"
repository = "https://github.com/tweag/FawltyDeps"
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Intended Audience :: Developers",
"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",
"Topic :: Utilities",
"Typing :: Typed",
]
[tool.poetry.scripts]
fawltydeps = "fawltydeps.main:main"
[tool.poetry.dependencies]
# These are the main dependencies for fawltydeps at runtime.
# Do not add anything here that is only needed by CI/tests/linters/developers
python = ">=3.7.2"
importlib_metadata = [
# v6.8.0 drops support for Python v3.7:
{version = ">=6.6.0", python = ">=3.8"},
{version = ">=6.6.0,<6.8.0", python = "<3.8"},
]
isort = [
# v5.12.0 drops support for Python v3.7:
{version = "^5.10", python = ">=3.8"},
{version = ">=5.10,<5.12.0", python = "<3.8"},
]
packaging = ">=24.0"
pip-requirements-parser = ">=32.0.1"
pydantic = ">=1.10.4,<3.0.0"
tomli = {version = "^2.0.1", python = "<3.11"}
typing-extensions = {version = ">=4.4.0", python = "<3.8"}
# Optional dependencies, covered by .extras below:
uv = {version = ">=0.1.6", python = ">=3.8", optional = true}
[tool.poetry.extras]
uv = ["uv"]
[tool.poetry.group.nox]
optional = true
[tool.poetry.group.nox.dependencies]
nox = [
{version="^2024.03.02", python = "<3.8"},
{version="^2024.03.02", extras=["uv"], python = ">=3.8"},
]
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
hypothesis = "^6.68.2"
pytest = "^7.1.0"
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
hypothesis = "^6.68.2"
mypy = "^1.0.1"
nox = "^2024.03.02"
pytest = "^7.1.0"
ruff = ">=0.3"
[tool.poetry.group.format]
optional = true
[tool.poetry.group.format.dependencies]
codespell = "^2.2.4"
ruff = ">=0.3"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
# The dev group is a convenience group for FawltyDeps developers. When adding
# something to the above groups (i.e. something that targets a specific purpose
# (e.g. a CI action), consider whether it's also useful to have this available
# in a developers environment
codespell = "^2.2.4"
hypothesis = "^6.68.2"
mypy = "^1.0.1"
nox = [
{version="^2024.03.02", python = "<3.8"},
{version="^2024.03.02", extras=["uv"], python = ">=3.8"},
]
pytest = "^7.1.0"
ruff = ">=0.3"
[tool.mypy]
files = ['*.py', 'fawltydeps/*.py', 'tests/*.py']
plugins = ["pydantic.mypy"]
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
enable_error_code = ["ignore-without-code"]
[[tool.mypy.overrides]]
module = "fawltydeps.*"
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_any_unimported = true
disallow_any_explicit = true
disallow_any_generics = true
disallow_subclassing_any = true
implicit_optional = false
strict_optional = true
[tool.pytest.ini_options]
minversion = 7.0
markers = [
"integration: marks integration tests (disabled by default, enable with '-m integration')",
]
addopts = "-m 'not integration'"
cache_dir = "~/.cache/pytest"
[tool.ruff]
target-version = "py37"
extend-include = ["*.ipynb"]
extend-exclude = [
"tests/sample_projects/legacy_encoding/big5.py", # Fails with E902 (not UTF-8)
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Ignore some unwanted checks:
"ANN10", # Deprecated: Missing type annotation for self/cls in (class)method
"ANN204", # Missing return type annotation for special method
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D203", # one-blank-line-before-class conflicts with D211: no-blank-line-before-class
"D213", # multi-line-summary-second-line conflicts with D212: multi-line-summary-first-line
"EM", # Exception must not use a (f-)string literal, assign to variable first
# Probably not fixed so soon:
"FIX002", # Line contains TODO, consider resolving the issue
"G004", # Logging statement uses f-string
"PERF203", # `try`-`except` within a loop incurs performance overhead
"TD", # Ignore checks on TODO comments
"TRY003", # Avoid specifying long messages outside the exception class
"TRY301", # Abstract `raise` to an inner function
"TRY400", # Use `logging.exception` instead of `logging.error`
# To be fixed in a larger refactoring of our type annotations
"FA100", # Missing `from __future__ import annotations`, but uses `typing.*`
"TCH002", # Move third-party import `...` into a type-checking block
"TCH003", # Move standard library import `...` into a type-checking block
"UP006", # Use `list` instead of `List` for type annotation
"UP007", # Use `X | Y` for type annotations
# Ruff recommends avoiding these checks when using `ruff format`.
# Details: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"E501", # line-too-long
]
[tool.ruff.lint.per-file-ignores]
"noxfile.py" = [
"ANN", # Missing type annotations
"D", # Missing docstrings
]
"tests/sample_projects/*" = [
"F401", # Allow unused imports in sample projects
"ICN001", # `<module>` should be imported as `<mod>`
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`.
]
"tests/*" = [
# Ignore some groups of checks in our test code
"ANN", # Type annotations
"D10", # Missing docstrings
"TCH00", # Imports and type checking blocks
# Ignore some more specific checks in our test code
"C408", # Unnecessary `dict` call (rewrite as a literal)
"D401", # First line of docstring should be in imperative mood
"N802", # Function name `...` should be lowercase
"N806", # Variable `...` in function should be lowercase
"PLR0913", # Too many arguments in function definition
"PT018", # Assertion should be broken down into multiple parts
"S101", # Use of `assert` detected
"S603", # `subprocess` call: check for execution of untrusted input
"T201", # `print` found
]
[tool.codespell]
skip = ".git,.mypy_cache,.nox,.vscode,__pycache__,poetry.lock"
builtin = "clear,rare,informal,usage,code,names"
ignore-words-list = "jupyter,iff" # prevent jupyter -> jupiter, iff -> if
check-filenames = true
uri-ignore-words-list = "*"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.fawltydeps]
code = ["fawltydeps"]
deps = ["pyproject.toml"]
ignore_unused = [
"codespell",
"hypothesis",
"mypy",
"nox",
"pytest",
"ruff",
"uv",
]