generated from BrianPugh/python-template
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
pyproject.toml
220 lines (192 loc) · 4.86 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
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.1"]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
[tool.poetry]
name = "cyclopts"
version = "0.0.0" # Do not change, let poetry-dynamic-versioning handle it.
homepage = "https://github.com/BrianPugh/cyclopts"
repository = "https://github.com/BrianPugh/cyclopts"
license = "Apache-2.0"
description = ""
authors = ["Brian Pugh"]
readme = "README.md"
packages = [{include = "cyclopts"}]
include = ["cyclopts/*.so", "cyclopts/*.pyd"] # Compiled extensions
[tool.poetry.build]
generate-setup-file = false
[tool.poetry.scripts]
[tool.poetry.dependencies]
# Be as loose as possible if writing a library.
python = ">=3.9"
typing-extensions = { version = ">=4.8.0", python = "<3.11" }
importlib-metadata = { version = ">=4.4", python = '<3.10' }
attrs = ">=23.1.0"
rich = ">=13.6.0"
docstring-parser = {version=">=0.15", python = "<4.0"}
rich-rst = "^1.3.1"
tomli = {version = ">=2.0.0", python = "<3.11", optional = true}
pyyaml = {version = ">=6.0.1", optional = true}
[tool.poetry.group.docs.dependencies]
sphinx = "~7.4.7"
sphinx_rtd_theme = ">=3.0.0,<4.0.0"
gitpython = ">=3.1.31"
sphinx-copybutton = "^0.5"
myst-parser = {extras = ["linkify"], version = "^3.0.1"}
sphinx-autodoc-typehints = ">=1.25.2,<3.0.0"
sphinx-rtd-dark-mode = "^1.3.0"
[tool.poetry.group.dev.dependencies]
coverage = {extras = ["toml"], version = ">=5.1"}
pre_commit = ">=2.16.0"
pytest = ">=7.1.2"
pytest-cov = ">=3.0.0"
pytest-mock = ">=3.7.0"
pydantic = "^2.7.0"
toml = "^0.10.2"
pyyaml = ">=6.0.1"
[tool.poetry.group.debug]
optional = true
[tool.poetry.group.debug.dependencies]
ipdb = ">=0.13.9"
line_profiler = ">=3.5.1"
[tool.poetry.extras]
toml = ["tomli"]
yaml = ["pyyaml"]
[tool.coverage.run]
branch = true
omit = [
"tests/*",
]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
"if self.debug:",
"if debug:",
"if DEBUG:",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"raise TypeError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if False:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if sys.version_info < (3, 10):",
"if sys.version_info >= (3, 10):",
"from typing import Annotated",
"except ImportError:",
]
omit = [
"cyclopts/protocols.py"
]
[tool.pyright]
venvPath = "."
venv = ".venv"
ignore = ["docs/", "tests/test_py3*.py"]
[tool.ruff]
target-version = 'py38'
line-length = 120
exclude = [
"migrations",
"__pycache__",
"manage.py",
"settings.py",
"env",
".env",
"venv",
".venv",
]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # Error
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"PGH", # pygrep-hooks
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"TRY", # tryceratops
"UP", # pyupgrade
"W", # Warning
"YTT", # flake8-2020
]
ignore = [
"B905", # zip strict=True; remove once python <3.10 support is dropped.
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D200",
"D401",
"E402",
"E501",
"PGH003", # Use specific rule codes when ignoring type issues
"TRY003", # Avoid specifying messages outside exception class; overly strict, especially for ValueError
"TRY300", # Consider moving this statement to an `else` block
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"chr",
"typer.Argument",
"typer.Option",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D205",
"D404",
"S102", # use of "exec"
"S106", # possible hardcoded password.
"PGH001", # use of "eval"
]
"docs/*.py" = [
"F811", # redefinition
]
"cyclopts/config/*.py" = [
"PTH123", # `open()` should be replaced by `Path.open()`. Pyright doesn't understand that it must be a Path.
]
[tool.ruff.lint.pep8-naming]
staticmethod-decorators = [
"pydantic.validator",
"pydantic.root_validator",
]
[tool.codespell]
skip = 'poetry.lock,'
[tool.creosote]
venvs=[".venv"]
paths=["cyclopts"]
deps-file="pyproject.toml"
sections=["tool.poetry.dependencies"]
exclude-deps =[
"importlib-metadata",
"typing-extensions",
"docstring-parser", # Not detected due to deferred import.
"rich-rst", # Not detected due to deferred import.
"rich", # Not detected due to deferred import.
"tomli", # Not detected due to optional feature.
]