-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathpyproject.toml
More file actions
264 lines (234 loc) · 6.6 KB
/
Copy pathpyproject.toml
File metadata and controls
264 lines (234 loc) · 6.6 KB
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "jsonargparse"
dynamic = ["version"]
description = "Minimal effort CLIs derived from type hints and parse from command line, config files and environment variables."
authors = [
{name = "Mauricio Villegas", email = "mauricio@omnius.com"},
]
readme = "README.rst"
license = "MIT"
license-files = ["LICENSE.rst"]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
]
dependencies = [
"PyYAML>=3.13",
]
[project.optional-dependencies]
all = [
"jsonargparse[signatures]",
"jsonargparse[jsonschema]",
"jsonargparse[jsonnet]",
"jsonargparse[toml]",
"jsonargparse[urls]",
"jsonargparse[fsspec]",
"jsonargparse[ruamel]",
"jsonargparse[omegaconf]",
"jsonargparse[typing-extensions]",
]
signatures = [
"jsonargparse[typing-extensions]",
"docstring-parser>=0.17",
"typeshed-client>=2.8.2",
]
jsonschema = [
"jsonschema>=3.2.0",
]
jsonnet = [
"jsonnet>=0.21.0",
]
toml = [
"toml>=0.10.2",
]
urls = [
"requests>=2.18.4",
]
fsspec = [
"fsspec>=0.8.4",
]
shtab = [
"shtab>=1.7.1",
]
argcomplete = [
"argcomplete>=3.5.1",
]
ruamel = [
"ruamel.yaml>=0.18.15",
]
ruyaml = [
"jsonargparse[ruamel]",
]
omegaconf = [
"omegaconf>=2.1.1",
]
typing-extensions = [
"typing-extensions>=4.12.0; python_version < '3.11'",
]
test = [
"jsonargparse[test-no-urls]",
"jsonargparse[shtab]",
"jsonargparse[argcomplete]",
"types-PyYAML>=6.0.11",
"types-requests>=2.28.9,<2.34",
"requests<2.34",
"responses>=0.12.0",
"pydantic>=2.3.0",
"attrs>=22.2.0",
]
test-no-urls = [
"pytest>=6.2.5",
"pytest-subtests>=0.8.0",
]
coverage = [
"jsonargparse[test-no-urls]",
"pytest-cov>=4.0.0",
]
dev = [
"jsonargparse[test]",
"jsonargparse[coverage]",
"jsonargparse[doc]",
"pre-commit>=2.19.0",
"tox>=3.25.0",
"build>=0.10.0",
]
doc = [
"Sphinx>=1.7.9",
"sphinx-rtd-theme>=1.2.2",
"autodocsumm>=0.1.10",
"sphinx-autodoc-typehints>=1.19.5",
]
maintainer = [
"bump2version>=0.5.11",
"twine>=4.0.2",
]
[project.urls]
Documentation-stable = "https://jsonargparse.readthedocs.io/en/stable/"
Documentation-latest = "https://jsonargparse.readthedocs.io/en/latest/"
Changes = "https://jsonargparse.readthedocs.io/en/stable/changelog.html"
GitHub = "https://github.com/mauvilsa/jsonargparse"
PyPI = "https://pypi.org/project/jsonargparse"
SonarCloud = "https://sonarcloud.io/dashboard?id=mauvilsa_jsonargparse"
Codecov = "https://codecov.io/gh/mauvilsa/jsonargparse"
[tool.setuptools]
platforms = ["Any"]
packages = ["jsonargparse"]
[tool.setuptools.dynamic]
version = {attr = "jsonargparse.__version__"}
[tool.setuptools.package-data]
jsonargparse = ["py.typed"]
[tool.pytest.ini_options]
addopts = "-s"
testpaths = ["jsonargparse_tests"]
[tool.coverage.run]
relative_files = true
source = ["jsonargparse"]
[tool.mypy]
allow_redefinition = true
warn_unused_ignores = true
disable_error_code = "annotation-unchecked"
[tool.ruff]
fix = true
line-length = 120
[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
"F", # pyflakes
"I", # isort
]
extend-select = [
"RUF100", # unused-noqa
]
ignore = [
"E731", # Do not convert lambda assigns to a def
"E721", # Allow comparing types with type()
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.typos.default.extend-identifiers]
Villegas = "Villegas"
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{310,311,312,313,314}-{all-extras,no-extras,argparse},omegaconf,pydantic-v1,without-pyyaml,without-future-annotations
skip_missing_interpreters = true
[testenv]
extras =
all-extras: test,coverage,all
no-extras: coverage
argparse: coverage
changedir = jsonargparse_tests
allowlist_externals = rm
commands =
all-extras: python -m pytest {posargs}
no-extras: python -m pytest {posargs}
argparse: rm -f tests_argparse_{env_name}.py
argparse: ./argparse_tests_generate.py --output_file tests_argparse_{env_name}.py --verbose false
argparse: python -m pytest -W ignore::pytest.PytestUnknownMarkWarning --tb=no -m "not (not_supported or implementation_specific or investigate)" tests_argparse_{env_name}.py {posargs}
usedevelop = true
[testenv:omegaconf]
extras = test,coverage,all
changedir = jsonargparse_tests
setenv =
JSONARGPARSE_OMEGACONF_FULL_TEST = true
commands =
python -m pytest {posargs}
[testenv:pydantic-v1]
extras = coverage
deps = ./jsonargparse_tests
commands =
# Test with pydantic<2
python -c "\
from pathlib import Path; \
from shutil import copy; \
copy('conftest.py', Path(r'{envtmpdir}', 'conftest.py')); \
copy('test_pydantic.py', Path(r'{envtmpdir}', 'test_pydantic.py'))\
"
pip install "pydantic<2"
python -m pytest {posargs} {envtmpdir}/test_pydantic.py
# Test with pydantic>=2 importing from pydantic.v1
python -c "\
import re, pathlib; \
path = pathlib.Path(r'{envtmpdir}', 'test_pydantic.py'); \
content = path.read_text(); \
content = re.sub(r'import pydantic', 'import pydantic.v1 as pydantic', content); \
content = re.sub(r'^annotated = [^\\n]*', 'annotated = False', content, flags=re.MULTILINE); \
path.write_text(content)\
"
pip install "pydantic>=2"
python -m pytest {posargs} {envtmpdir}/test_pydantic.py
[testenv:without-pyyaml]
extras = test,coverage,all
commands =
pip uninstall -y argcomplete omegaconf pyyaml responses ruamel.yaml ruamel.yaml.clib types-PyYAML
python -m pytest {posargs}
[testenv:without-future-annotations]
extras = test,coverage,all
deps = ./jsonargparse_tests
allowlist_externals = sh
commands =
sh -c "\
rm -rf /tmp/_without_future_annotations; \
mkdir /tmp/_without_future_annotations; \
cp *.py /tmp/_without_future_annotations; \
sed -i -e '/^from __future__ import annotations$/d' /tmp/_without_future_annotations/*.py; \
"
python -m pytest /tmp/_without_future_annotations {posargs}
commands_post =
sh -c "rm -rf /tmp/_without_future_annotations"
"""