-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
239 lines (218 loc) · 6.22 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
[project]
name = "hydraclick"
dynamic = ["version"]
description = "Develop CLI tools with top-notch config management like a boss."
authors = [
{ name = "Guillem Duran Ballester", email = "[email protected]" },
]
maintainers = [{ name = "Guillem Duran Ballester", email = "[email protected]" }]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.10"
packages = [
{ include = "hydraclick", from = "src" }
]
include = [
"tests/**/*",
"tests/**/.*",
]
homepage = "https://github.com/FragileTech/hydraclick"
repository = "https://github.com/FragileTech/hydraclick"
documentation = "https://github.com/FragileTech/hydraclick"
keywords = ["CLI", "config", "hydra", "omegaconf"]
classifiers = [
"Development Status :: 3 - Alpha",
"Topic :: Software Development :: Libraries :: Python Modules"
]
dependencies = [
"click>=8.1.7",
"hydra-core",
]
[project.optional-dependencies]
flogging = ["flogging>=0.0.22"]
terminaltexteffects = ["terminaltexteffects>=0.11.0"]
all = ["flogging>=0.0.22", "terminaltexteffects>=0.11.0"]
test = [
"psutil>=5.8.0",
"pytest>=6.2.5",
"pytest-cov>=3.0.0",
"pytest-xdist>=2.4.0",
"pytest-rerunfailures>=10.2",
"pyvirtualdisplay>=1.3.2",
"tomli>=1.2.3",
"hypothesis>=6.24.6"
]
[project.scripts]
hydraclick = "hydraclick.__main__:cli"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.rye]
managed = true
universal = true
dev-dependencies = [
"autoapi>=2.0.1",
"ruff",
"sphinx",
"linkify-it-py",
"myst-parser",
"myst-nb",
"ruyaml",
"sphinx-autoapi",
"pydata-sphinx-theme",
"sphinx-autodoc2",
"sphinxcontrib-mermaid",
"sphinx_book_theme",
"sphinx_rtd_theme",
"jupyter-cache",
"sphinx-copybutton",
"sphinx-togglebutton",
"sphinxext-opengraph",
"sphinxcontrib-bibtex",
]
[tool.hatch.version]
path = "src/hydraclick/version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/hydraclick"]
[tool.rye.scripts]
style = { chain = ["ruff check --fix-only --unsafe-fixes tests src", "ruff format tests src"] }
check = { chain = ["ruff check tests src", "ruff format --diff tests src"]} #,"mypy src tests" ] }
# test = { chain = ["test:parallel", "test:doctest"] }
test = { chain = ["test:parallel"] }
codecov = { chain = ["codecov:parallel"] }
"test:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info tests" }
"test:doctest" = { cmd = "pytest --doctest-modules -n 0 -s -o log_cli=true -o log_cli_level=info src" }
"codecov:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml --cov-config=pyproject.toml tests" }
docs = {chain = ["build-docs", "serve-docs"]}
build-docs = { cmd = "sphinx-build -b html docs/source docs/build"}
serve-docs = { cmd = "python3 -m http.server --directory docs/build" }
[tool.ruff]
# Assume Python 3.10
target-version = "py310"
preview = true
include = ["*.py", "*.pyi", "**/pyproject.toml"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".idea",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"output",
"venv",
"experimental",
".pytest_cache",
"**/.ipynb_checkpoints/**",
"**/proto/**",
"data",
"config",
]
# Same as Black.
line-length = 99
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
select = [
"ARG", "C4", "D", "E", "EM", "F", "FBT",
"FLY", "FIX", "FURB", "N", "NPY",
"INP", "ISC", "PERF", "PIE", "PL",
"PTH", "RET", "RUF", "S", "T10",
"TD", "T20", "UP", "YTT", "W",
]
ignore = [
"D100", "D211", "D213", "D104", "D203", "D301", "D407", "S101",
"FBT001", "FBT002", "FIX002", "ISC001", "PLR0913", "RUF012", "TD003",
"PTH123", "PLR6301", "PLR0917", "S311", "S403", "PLR0914", "PLR0915", "S608",
"EM102", "PTH111", "FIX004", "UP035", "PLW2901", "S318", "S408", 'S405',
'E902', "TD001", "TD002", "FIX001",
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
# unfixable = ["I"]
[tool.ruff.lint.flake8-import-conventions.aliases]
# Declare the default aliases.
altair = "alt"
"matplotlib.pyplot" = "plt"
numpy = "np"
pandas = "pd"
seaborn = "sns"
scipy = "sp"
holoviews = "hv"
panel = "pn"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
"cli.py" = ["PLC0415", "D205", "D400", "D415"]
"**/docs/**" = ["INP001", "PTH100"]
"**/{tests,docs}/*" = [
"E402", "F401", "F811", "D", "S101", "PLR2004", "S105",
"PLW1514", "PTH123", "PTH107", "N811", "PLC0415", "ARG002",
]
# Enable reformatting of code snippets in docstrings.
[tool.ruff.format]
docstring-code-line-length = 80
docstring-code-format = true
indent-style = "space"
line-ending = "auto"
preview = true
quote-style = "double"
[tool.isort]
profile = "black"
line_length = 99
multi_line_output = 3
order_by_type = false
force_alphabetical_sort_within_sections = true
force_sort_within_sections = true
combine_as_imports = true
include_trailing_comma = true
color_output = true
lines_after_imports = 2
honor_noqa = true
skip = [".venv", "venv"]
skip_glob = ["*.pyx"]
[tool.ruff.lint.isort]
known-first-party = ["src", "hydraclick"]
[tool.mypy]
exclude = ["experimental.*", "deprecated.*"]
ignore_missing_imports = true
[tool.pylint.master]
ignore = 'tests'
load-plugins =' pylint.extensions.docparams'
[tool.pylint.messages_control]
disable = 'all,'
enable = """,
missing-param-doc,
differing-param-doc,
differing-type-doc,
missing-return-doc,
"""
[tool.pytest.ini_options]
# To disable a specific warning --> action:message:category:module:line
filterwarnings = ["ignore::UserWarning", 'ignore::DeprecationWarning']
addopts = "--ignore=scripts --doctest-continue-on-failure"
# Code coverage config
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_lines =["no cover",
'raise NotImplementedError',
'if __name__ == "__main__":']
ignore_errors = true
omit = ["tests/*"]