-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
pyproject.toml
179 lines (159 loc) · 4.76 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
# https://peps.python.org/pep-0517/
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
# https://peps.python.org/pep-0621/
[project]
name = "enzyme"
description = "Video metadata parser"
requires-python = ">=3.8"
license = { text = "MIT" }
authors = [{ name = "Antoine Bertin", email = "[email protected]" }]
maintainers = [{ name = "Antoine Bertin", email = "[email protected]" }]
keywords = ["video", "metadata", "parser", "mkv", "matroska", "ebml"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Multimedia :: Video",
]
dynamic = ["version"]
readme = "README.md"
dependencies = ["importlib_resources>=4.6; python_version=='3.8'"]
# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
docs = ["sphinx", "sphinx-rtd-theme", "myst-parser"]
test = [
"PyYAML",
"requests",
"mypy",
"pytest>=6.0",
"importlib_metadata>=4.6; python_version<'3.10'",
]
dev = ["doc8", "mypy", "ruff", "typos", "validate-pyproject", "tox"]
[project.urls]
homepage = "https://github.com/Diaoul/enzyme"
repository = "https://github.com/Diaoul/enzyme"
documentation = "https://enzyme.readthedocs.org"
[tool.setuptools.package-data]
"enzyme.parsers.ebml" = ["specs/matroska.xml"]
[tool.setuptools.dynamic]
version = { attr = "enzyme.__version__" }
# https://docs.astral.sh/ruff/
[tool.ruff]
line-length = 120
src = ["subliminal", "tests"]
exclude = ["_version.py"]
[tool.ruff.lint]
pydocstyle = { convention = "pep257" }
select = [
"E", # style errors
"F", # flakes
"W", # warnings
"D", # pydocstyle
"D417", # Missing argument descriptions in Docstrings
"I", # isort
"UP", # pyupgrade
"S", # bandit
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"TCH", # flake8-typecheck
"TID", # flake8-tidy-imports
"RUF", # ruff-specific rules
"ISC", # flake8-implicit-str-concat
"PT", # flake8-pytest-style
"FA", # flake8-future-annotations
"BLE", # flake8-blind-except
"RET", # flake8-return
"SIM", # flake8-simplify
"DTZ", # flake8-datetimez
"A", # flake8-builtins
"FBT", # flake8-boolean-trap
"ANN0", # flake8-annotations
"ANN2",
"ASYNC", # flake8-async
"TRY", # tryceratops
]
ignore = [
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D401", # First line should be in imperative mood
]
[tool.ruff.lint.per-file-ignores]
"docs/conf*.py" = ["ALL"]
"subliminal/__init__.py" = ["E402"]
"tests/*.py" = ["D", "S", "RUF012", "ANN", "FBT"]
# https://docs.astral.sh/ruff/formatter/
[tool.ruff.format]
docstring-code-format = true
# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
addopts = "--doctest-glob='*.rst'"
doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
# https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.report]
exclude_also = [
"pragma: no.cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"\\.\\.\\.",
"raise NotImplementedError()",
"if __name__ == .__main__.:",
]
show_missing = true
skip_covered = true
fail_under = 80
[tool.coverage.run]
source = ["enzyme"]
relative_files = true
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "enzyme/**/*.py"
exclude = ['build', 'dist', 'docs']
# global-only flags
pretty = true
show_error_codes = true
namespace_packages = false
warn_redundant_casts = true
# global per-module flags
check_untyped_defs = true
strict_equality = true
disallow_any_generics = false
disallow_subclassing_any = false
[[tool.mypy.overrides]]
module = ["enzyme.*"]
warn_return_any = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false
disallow_untyped_calls = false
warn_return_any = false
disable_error_code = ["var-annotated"]
# https://github.com/PyCQA/doc8
[tool.doc8]
allow-long-titles = true
max-line-length = 120
# https://github.com/crate-ci/typos/blob/master/docs/reference.md
[tool.typos.files]
extend-exclude = ["tests/"]
[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*#\\s*spellchecker:\\s*disable-line$",
"#\\s*spellchecker:off\\s*\\n.*\\n\\s*#\\s*spellchecker:on",
]