-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
188 lines (160 loc) · 6.56 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
# SPDX-FileCopyrightText: Copyright © 2022 Idiap Research Institute <[email protected]>
# SPDX-FileContributor: Amir Mohammadi <[email protected]>
#
# SPDX-License-Identifier: BSD-3-Clause
[build-system]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"
[project]
name = "clapper"
dynamic = ["version"]
requires-python = ">=3.10"
description = "Configuration Support for Python Packages and CLIs"
readme = "README.md"
license = "BSD-3-Clause"
authors = [{ name = "Andre Anjos", email = "[email protected]" }, { name = "Amir Mohammadi", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["click>=8", "tomli", "tomli-w", "xdg"]
[project.urls]
documentation = "https://clapper.readthedocs.io/en/latest/"
homepage = "https://pypi.org/project/clapper"
repository = "https://github.com/idiap/clapper"
changelog = "https://github.com/idiap/clapper/releases"
[project.optional-dependencies]
qa = ["pre-commit", "reuse", "ruff"]
doc = [
"sphinx",
"furo",
"sphinx-autodoc-typehints",
"sphinxcontrib-programoutput",
"auto-intersphinx",
"sphinx-copybutton",
"sphinx-inline-tabs",
]
test = ["pytest", "pytest-cov"]
dev = ["pdbpp", "uv", "clapper[doc,qa,test]"]
[project.entry-points."clapper.test.config"]
first = "tests.data.basic_config"
first-a = "tests.data.basic_config:a"
first-b = "tests.data.basic_config:b"
second = "tests.data.second_config"
second-b = "tests.data.second_config:b"
second-c = "tests.data.second_config:c"
complex = "tests.data.complex"
complex-var = "tests.data.complex:cplx"
verbose-config = "tests.data.verbose_config"
error-config = "tests.data.doesnt_exist"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[tool.pixi.system-requirements]
linux = "4.19.0"
[tool.pixi.pypi-dependencies]
clapper = { path = ".", editable = true }
[tool.pixi.feature.py311.dependencies]
python = "~=3.11.0"
[tool.pixi.feature.py312.dependencies]
python = "~=3.12.0"
[tool.pixi.feature.qa.tasks]
qa-install = "pre-commit install"
qa = "pre-commit run --all-files"
qa-ci = "pre-commit run --all-files --show-diff-on-failure --verbose"
[tool.pixi.feature.doc.tasks]
doc-clean = "rm -rf doc/api && rm -rf html"
doc = "sphinx-build -aEW doc html"
doctest = "sphinx-build -aEb doctest doc html/doctest"
[tool.pixi.feature.test.tasks]
test = "pytest -sv tests/"
test-ci = "pytest -sv --cov-branch tests/"
[tool.pixi.environments]
default = { features = ["qa", "doc", "test", "py312"], solve-group = "default" }
qa = { features = ["qa", "py312"], solve-group = "default" }
test = { features = ["test", "py312"], solve-group = "default" }
doc = { features = ["doc", "py312"], solve-group = "default" }
dev = { features = ["dev", "qa", "doc", "test", "py312"], solve-group = "default" }
alternative = { features = ["qa", "doc", "test", "py311"], solve-group = "alternative" }
test-alternative = { features = ["test", "py311"], solve-group = "alternative" }
[tool.hatch.version]
source = "versioningit"
[tool.versioningit.next-version]
method = "smallest"
[tool.versioningit.format]
# Example formatted version: 1.2.4.dev42+ge174a1f
distance = "{next_version}.dev{distance}+{vcs}{rev}"
# Example formatted version: 1.2.4.dev42+ge174a1f.d20230922
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
[tool.hatch.build.targets.sdist]
include = [
"src/**/*.py",
"tests/**/*.py",
"tests/**/*.cfg",
"doc/**/*.rst",
"doc/**/*.txt",
"doc/**/*.py",
"LICENSES/*.txt",
]
[tool.hatch.build.targets.wheel]
packages = ["src/clapper"]
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"COM", # https://docs.astral.sh/ruff/rules/#flake8-commas-com
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"E", # https://docs.astral.sh/ruff/rules/#error-e
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # https://docs.astral.sh/ruff/rules/#warning-w
#"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
#"ICN", # https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
]
ignore = [
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"D100", # https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D102", # https://docs.astral.sh/ruff/rules/undocumented-public-method/
"D104", # https://docs.astral.sh/ruff/rules/undocumented-public-package/
"D105", # https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D107", # https://docs.astral.sh/ruff/rules/undocumented-public-init/
"D203", # https://docs.astral.sh/ruff/rules/one-blank-line-before-class/
"D202", # https://docs.astral.sh/ruff/rules/no-blank-line-after-function/
"D205", # https://docs.astral.sh/ruff/rules/blank-line-after-summary/
"D212", # https://docs.astral.sh/ruff/rules/multi-line-summary-first-line/
"D213", # https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/
"E302", # https://docs.astral.sh/ruff/rules/blank-lines-top-level/
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
]
[tool.ruff.lint.isort]
# Use a single line between direct and from import.
lines-between-types = 1
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "E501"]
"doc/conf.py" = ["D"]
[tool.pytest.ini_options]
addopts = ["--cov=clapper", "--cov-report=term-missing", "--import-mode=append"]
[tool.coverage.run]
relative_files = true