-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
181 lines (153 loc) · 4.85 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "fancy-dataclass"
dynamic = ["version"]
description = "Spiff up your dataclasses with extra features."
readme = "docs/README.md"
requires-python = ">=3.8"
license = {text = "MIT License"}
keywords = ["dataclass", "cli", "config", "orm", "serialize", "json", "toml"]
authors = [
{ name = "Jeremy Silver", email = "[email protected]" }
]
classifiers = [
"Programming Language :: Python"
]
dependencies = [
"sqlalchemy >= 2.0",
"tomlkit >= 0.13.2",
"typing_extensions"
]
[project.urls]
Documentation = "https://fancy-dataclass.readthedocs.io"
Issues = "https://github.com/jeremander/fancy-dataclass/issues"
Source = "https://github.com/jeremander/fancy-dataclass"
Changelog = "https://fancy-dataclass.readthedocs.io/en/stable/CHANGELOG"
[tool.hatch.build.targets.sdist]
exclude = [".venv", "TODO.md"]
[tool.hatch.version]
path = "fancy_dataclass/__init__.py"
[tool.hatch.envs.doc]
dependencies = [
"mkdocs",
"mkdocs-material",
"mkdocstrings",
"mkdocs-gen-files",
"mkdocstrings-python",
"mkdocs-literate-nav",
"py-gadzooks >= 0.2.8",
]
[tool.hatch.envs.doc.scripts]
build = "mkdocs build --clean --strict --no-directory-urls {args}"
# build docs within the package, if not already up-to-date
build-pkg = "gadzooks build-docs --src-docs docs {args} -- mkdocs build --strict --no-directory-urls -d fancy_dataclass/docs"
check = "gadzooks build-docs --src-docs docs --check-only {args}"
serve = "mkdocs serve"
deploy = "mkdocs build --site-dir $READTHEDOCS_OUTPUT/html"
pre-publish = [
"build-pkg",
"cat docs/.changelog-version-regex.txt | xargs gadzooks check-version --check-tag --dist-dir dist --changelog docs/CHANGELOG.md --changelog-version-regex",
]
[tool.hatch.envs.lint]
dependencies = [
"mypy>=1.14",
"numpy",
"py-gadzooks>=0.2.9",
"pytest",
"ruff>=0.9",
"vermin>=1.6",
]
[tool.hatch.envs.lint.scripts]
# linting
run-ruff = "ruff check"
# ensure compatibility with Py3.8 and higher
run-vermin = "vermin {args:.}"
# type-checking
run-mypy = "mypy --install-types --non-interactive {args:fancy_dataclass tests}"
# print info about lines of code
run-loc-summarize = "gadzooks loc-summarize fancy_dataclass"
# print out formatter diffs
run-format = "gadzooks check-format {args:fancy_dataclass} --formatter yapf --ignore-patterns '\\s*'"
all = ["run-ruff", "run-vermin", "run-mypy", "run-loc-summarize"]
[tool.hatch.envs.test]
dependencies = [
"numpy",
"pytest",
"pytest-cov",
]
[tool.hatch.envs.test.scripts]
test = "pytest {args:tests}"
test-debug = "pytest --pdb {args:tests}"
cov-report = ["- coverage combine", "coverage report", "coverage html"]
cov = ["test", "cov-report"]
[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.badge]
dependencies = [
"coverage",
"genbadge[tests,coverage]"
]
[tool.hatch.envs.badge.scripts]
badge-cov = ["coverage xml", "genbadge coverage -i coverage.xml"]
badges = ["badge-cov"]
[tool.hatch.publish.index]
disable = true
[tool.coverage.run]
source_pkgs = ["fancy_dataclass", "tests"]
branch = true
parallel = true
omit = ["venv/*"]
[tool.coverage.report]
skip_covered = true
show_missing = true
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.commitizen]
tag_format = "v$major.$minor.$patch"
[tool.mypy]
exclude = ["docs/", "scripts/", "site/", "tmp.*"]
warn_unused_configs = true
strict = true
[[tool.mypy.overrides]]
module = "tests.*"
strict = false
disable_error_code = ["arg-type", "attr-defined", "call-arg", "comparison-overlap", "no-redef", "no-untyped-call", "no-untyped-def", "type-arg"]
[[tool.mypy.overrides]]
module = "tests.test_cli"
disable_error_code = ["assignment", "index", "operator", "union-attr"]
[[tool.mypy.overrides]]
module = "tests.test_config"
disable_error_code = ["index", "misc", "union-attr"]
[[tool.mypy.overrides]]
module = "tests.test_dict"
disable_error_code = ["assignment", "misc"]
[[tool.mypy.overrides]]
module = "tests.test_inheritance"
disable_error_code = ["assignment", "misc"]
[[tool.mypy.overrides]]
module = "tests.test_mixin"
disable_error_code = ["assignment", "call-overload", "has-type", "misc", "union-attr"]
[[tool.mypy.overrides]]
module = "tests.test_serializable"
disable_error_code = ["assignment", "misc"]
[[tool.mypy.overrides]]
module = "tests.test_subprocess"
disable_error_code = ["assignment", "misc"]
[tool.pytest.ini_options]
addopts = "--verbose --cov=fancy_dataclass"
[tool.yapf]
# NOTE: we'd like to disable vertical whitespace adjustment,
# but there appears to be no way to do that
based_on_style = "pep8"
blank_lines_between_top_level_imports_and_variables = 2
coalesce_brackets = true
column_limit = 10000
dedent_closing_brackets = true
space_between_ending_comma_and_closing_bracket = false
spaces_around_power_operator = true
split_all_top_level_comma_separated_values = true