-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathpyproject.toml
More file actions
139 lines (119 loc) · 3.49 KB
/
pyproject.toml
File metadata and controls
139 lines (119 loc) · 3.49 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
[project]
name = "confuse"
version = "2.2.0"
description = "Painless YAML config files"
authors = [{ name = "Adrian Sampson", email = "adrian@radbox.org" }]
readme = "README.rst"
license = "MIT"
requires-python = ">=3.10"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"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",
]
dependencies = [
"pyyaml",
]
[dependency-groups]
dev = [
"pytest >= 8.4.2",
"pytest-cov >= 7.0.0",
]
lint = [
"docstrfmt >= 2.0.1",
"mypy >= 1.18.2",
"ruff >= 0.6.4",
"sphinx-lint >= 1.0.0",
"types-pyyaml >=6.0.12",
]
[project.optional-dependencies]
docs = ["sphinx >= 7.4.7", "sphinx-rtd-theme >= 3.0.2"]
[project.urls]
Homepage = "https://github.com/beetbox/confuse"
Repository = "https://github.com/beetbox/confuse"
"Bug Tracker" = "https://github.com/beetbox/confuse/issues"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pipx-install]
poethepoet = ">=0.26"
poetry = ">=2.1"
[tool.poetry]
include = [
{ path = "docs", format = "sdist" },
{ path = "test", format = "sdist" },
]
[tool.poe.tasks.check-docs-links]
help = "Check the documentation for broken URLs"
cmd = "make -C docs linkcheck"
[tool.poe.tasks.check-format]
help = "Check the code for style issues"
cmd = "ruff format --check --diff"
[tool.poe.tasks.check-types]
help = "Check the code for typing issues. Accepts mypy options."
cmd = "mypy"
[tool.poe.tasks.docs]
help = "Build documentation"
args = [{ name = "COMMANDS", positional = true, multiple = true, default = "html" }]
cmd = "make -C docs $COMMANDS"
[tool.poe.tasks.format]
help = "Format the codebase"
cmd = "ruff format"
[tool.poe.tasks.format-docs]
help = "Format the documentation"
# TODO: Remove --no-format-python-code-blocks once https://github.com/LilSpazJoekp/docstrfmt/issues/171 is resolved
cmd = "docstrfmt --no-format-python-code-blocks --preserve-adornments docs *.rst"
[tool.poe.tasks.lint]
help = "Check the code for linting issues. Accepts ruff options."
cmd = "ruff check"
[tool.poe.tasks.lint-docs]
help = "Lint the documentation"
shell = "sphinx-lint --enable all --disable default-role $(git ls-files '*.rst')"
[tool.poe.tasks.test]
help = "Run tests with pytest"
cmd = "pytest $OPTS"
env.OPTS.default = "-p no:cov"
[tool.poe.tasks.test-with-coverage]
help = "Run tests and record coverage"
ref = "test"
# record coverage in confuse package
# save xml for coverage upload to codecov
# save html report for local dev use
# measure coverage across logical branches
# show which tests cover specific lines in the code (see the HTML report)
env.OPTS = """
--cov=confuse
--cov-report=xml:.reports/coverage.xml
--cov-report=html:.reports/html
--cov-branch
--cov-context=test
"""
[tool.docstrfmt]
line-length = 80
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
future-annotations = true
select = [
"E", # pycodestyle
"F", # pyflakes
"G", # flake8-logging-format
"I", # isort
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PT", # flake8-pytest-style
"RUF", # ruff
"UP", # pyupgrade
"TC", # flake8-type-checking
"W", # pycodestyle
]
ignore = [
"TC006", # no need to quote 'cast's since we use 'from __future__ import annotations'
]
[tool.ruff.format]
quote-style = "double"