-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathpyproject.toml
245 lines (222 loc) · 6.62 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
240
241
242
243
244
245
# .. seealso:: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
[project]
name = "anyconfig"
requires-python = ">=3.8"
dynamic = [
"version",
]
description = "Library provides common APIs to load and dump configuration files in various formats"
readme = "README.rst"
authors = [
{"name" = "Satoru SATOH", email = "[email protected]"},
]
maintainers = [
{"name" = "Satoru SATOH", email = "[email protected]"},
]
license = { text = "MIT"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Environment :: Console",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
]
# .. note:: It requires nothing at minimum.
#dependencies = [
#]
[tool.setuptools.dynamic.version]
attr = "anyconfig.api.__version__"
[project.urls]
Homepage = "https://github.com/ssato/python-anyconfig"
Documentation = "http://python-anyconfig.readthedocs.org"
Repository = "https://github.com/ssato/python-anyconfig"
Issues = "https://github.com/ssato/python-anyconfig/issues"
Changelog = "https://github.com/ssato/python-anyconfig/blob/next/NEWS"
Download = "https://pypi.python.org/pypi/anyconfig"
"Download RPMs" = "https://copr.fedoraproject.org/coprs/ssato/python-anyconfig/"
CI = "https://github.com/ssato/python-anyconfig/actions"
[build-system]
requires = [
"setuptools >= 61.0",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.setuptools.package-dir]
"" = "src"
[tool.setuptools.package-data]
anyconfig = [
"py.typed",
]
[tool.setuptools.packages.find]
where = [
"src"
]
# [tool.setuptools.data_files]
# share/man/man1 = [
# "docs/anyconfig_cli.1",
# ]
[project.optional-dependencies]
yaml = [
"pyyaml",
]
toml = [
"tomli; python_version < '3.11'",
"tomli-w",
]
query = [
"jmespath",
]
schema = [
"jsonschema",
]
template = [
"Jinja2",
]
[project.scripts]
anyconfig_cli = "anyconfig.cli:main"
# .. seealso:: https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml
[tool.pytest.ini_options]
testpaths = [
"tests",
]
addopts = "--cov=src -vv -rxXs --cov --cov-report xml"
[tool.pylint."MESSAGES CONTROL"]
disable = [
"import-error",
"invalid-name",
"locally-disabled",
"too-many-ancestors",
"too-many-return-statements",
]
# .. seealso:: https://docs.astral.sh/ruff/settings/#top-level
[tool.ruff]
exclude = [
"tests/res/**/*.py",
]
src = [
"src",
"tests",
]
[tool.ruff.lint]
ignore = [
"ANN002", # https://docs.astral.sh/ruff/rules/missing-type-args/
"ANN003", # https://docs.astral.sh/ruff/rules/missing-type-kwargs/
"ANN101", # https://docs.astral.sh/ruff/rules/missing-type-self/
"ANN102", # I can't see any meaning in it as the first 'cls' argument
# should be the class itself as usual.
# https://docs.astral.sh/ruff/rules/missing-type-cls/
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports/
# https://github.com/PyCQA/isort/issues/2146
"ICN001", # https://docs.astral.sh/ruff/rules/unconventional-import-alias/
"TID252", # https://docs.astral.sh/ruff/rules/relative-imports/
# .. note:: These are disabled until py38 support is dropped.
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation/
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation/
]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"ERA", # flake8-eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PD", # flake8-vet
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLC", # Pylint - Convention
"PLE", # Pylint - Error
"PLR", # Pylint - Refactor
"PLW", # Pylint - Warning
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific rules
"RSE", # flake8-raise
"S", # flake8-bandit
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
[tool.ruff.lint.extend-per-file-ignores]
"src/anyconfig/query/default.py" = ["ARG001"]
"src/anyconfig/schema/default.py" = ["ARG001"]
# "src/anyconfig/template/__init__.py" = ["ARG001"]
"src/anyconfig/template/jinja2.py" = ["BLE001"]
# .. todo:: security hardening
# https://docs.astral.sh/ruff/rules/suspicious-xml-element-tree-usage/
"src/anyconfig/backend/xml/etree.py" = ["S314"]
#[tool.ruff.lint.flake8-annotations]
#[tool.ruff.lint.flake8-bandit]
#[tool.ruff.lint.flake8-bugbear]
#[tool.ruff.lint.flake8-builtins]
# .. note::
#
# The following options are not supported by pyproject.toml or I don't know
# how to port from setup.cfg.
#
#
# [meta]
# long_description =
# python-anyconfig is a python library provides common APIs to load and dump
# configuration files in various formats with some useful features such as
# contents merge, templates, query, schema validation and generation support.
#
# - Home: https://github.com/ssato/python-anyconfig
# - Author: Satoru SATOH <[email protected]>
# - License: MIT
#[aliases]
# dists = clean --all sdist bdist_wheel
# .. note:: It's not well supported.
# .. seealso:: https://github.com/pypa/packaging-problems/issues/72
#
# Disabled because it does not work in CentOS 8.
# [options.data_files]
# share/man/man1 =
# docs/anyconfig_cli.1
# .. seealso:: https://stackoverflow.com/a/64487610
#
# [flake8]
# per-file-ignores =
# tests/res/*/*/*/*.py: W605, B018
# tests/res/*/*/*/*/*.py: W605, B018
#
# max-complexity = 10
# select = C,E,F,W,B
#
# # .. seealso:: https://www.flake8rules.com/rules/W504.html
# ignore = W503