-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathpyproject.toml
More file actions
167 lines (146 loc) · 4.77 KB
/
Copy pathpyproject.toml
File metadata and controls
167 lines (146 loc) · 4.77 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/tyro/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/tyro"]
[project]
name = "tyro"
authors = [
{name = "brentyi", email = "brentyi@berkeley.edu"},
]
description = "CLI interfaces & config objects, from types"
dynamic = ["version"]
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
dependencies = [
"typeguard>=4.0.0",
"docstring-parser>=0.16",
"typing-extensions>=4.13.0",
"eval_type_backport>=0.1.3; python_version<'3.10'",
]
[project.optional-dependencies]
dev = [
"PyYAML>=6.0",
"pytest>=7.1.2",
"pytest-cov>=3.0.0",
"pytest-xdist>=3.5.0",
"omegaconf>=2.2.2",
"attrs>=21.4.0",
"pyright>=1.1.349,!=1.1.379",
"ty>=0.0.33",
"mypy>=1.4.1",
"pydantic>=2.5.2,!=2.10.0",
"coverage[toml]>=6.5.0",
"eval_type_backport>=0.1.3",
"ml_collections>=0.1.0",
"msgspec>=0.18.6",
"shtab>=1.5.6",
"universal-pathlib>=0.2.0",
]
dev-nn = [
"tyro[dev]",
"flax>=0.6.9;python_version>='3.10' and python_version<='3.13'",
"numpy>=1.20.0",
"torch>=1.10.0;python_version>='3.9' and python_version<='3.13'",
]
[project.urls]
Repository = "https://github.com/brentyi/tyro"
Documentation = "https://brentyi.github.io/tyro/"
[tool.mypy]
python_version = "3.12"
ignore_missing_imports = true
warn_unused_configs = true
exclude = ["^tests/test_py311_generated/.*", "_argparse\\.py"]
[tool.coverage.run]
omit = ["**/_argparse.py", "**/_completion_script.py"]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't compute coverage for abstract methods, properties
"@abstract",
"@abc\\.abstract",
# or warnings
"warnings",
# or empty function bodies
"pass",
"\\.\\.\\.",
# or typing imports
"TYPE_CHECKING",
# or assert statements & errors
"assert",
"raise AssertionError",
# or anything that's not implemented
"NotImplementedError()",
# or fallback imports
"except ImportError:",
# or anything that's deprecated
"deprecated"
]
[tool.ruff]
src = ["src"] # Needed to recognize first-party import location in GitHub action.
lint.select = [
"E", # pycodestyle errors.
"F", # Pyflakes rules.
"PLC", # Pylint convention warnings.
"PLE", # Pylint errors.
"PLR", # Pylint refactor recommendations.
"PLW", # Pylint warnings.
"I" # Import sorting.
]
lint.ignore = [
"E741", # Ambiguous variable name. (l, O, or I)
"E501", # Line too long.
"E731", # Do not assign a lambda expression, use a def.
"PLC0415", # `import` should be at the top of the file.
"PLR2004", # Magic value used in comparison.
"PLR0915", # Too many statements.
"PLR0913", # Too many arguments.
"PLR0917", # Too many positional arguments. (stabilized in ruff 0.16.0)
"PLC0414", # Import alias does not rename variable. (this is used for exporting names)
"PLC0415", # Import should be placed at the top of the file.
"PLC1901", # Use falsey strings.
"PLR5501", # Use `elif` instead of `else if`.
"PLR0911", # Too many return statements.
"PLR0912", # Too many branches.
"PLW0603", # Global statement updates are discouraged.
"PLW1641", # Object does not implement `__hash__` method.
"PLW2901" # For loop variable overwritten.
]
extend-exclude = ["**/_argparse.py"]
target-version = "py312"
[tool.pyright]
pythonVersion = "3.13"
ignore = ["**/_argparse.py", "./docs/**/*"]
[tool.ty.environment]
python-version = "3.13"
[[tool.ty.overrides]]
# Generated tests are reformatted from the originals; ruff sometimes moves
# `# ty: ignore` comments off the line where the diagnostic actually fires.
# The originals are checked strictly, so suppressing on the generated copies
# is safe.
include = ["tests/test_py311_generated/**"]
rules = { invalid-type-form = "ignore", invalid-assignment = "ignore", unused-ignore-comment = "ignore" }
[tool.ty.rules]
# `# type: ignore` comments are written for mypy/pyright; ty's narrower set
# of diagnostics often makes them redundant from its POV.
unused-type-ignore-comment = "ignore"
# `get_parser` is intentionally exercised by helptext tests.
deprecated = "ignore"
redundant-cast = "ignore"
possibly-missing-submodule = "ignore"