-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
pyproject.toml
206 lines (170 loc) · 5.34 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
[tool.poetry]
name = "poethepoet"
version = "0.30.0"
description = "A task runner that works well with poetry."
authors = ["Nat Noordanus <[email protected]>"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/nat-n/poethepoet"
homepage = "https://github.com/nat-n/poethepoet"
documentation = "https://poethepoet.natn.io/"
keywords = ["automation", "tasks", "task-runner", "plugin", "poetry", "poe"]
classifiers = ["Topic :: Software Development :: Build Tools"]
[tool.poetry.dependencies]
python = ">=3.8"
pastel = "^0.2.1"
tomli = { version = ">=1.2.2", python = "<3.11" }
poetry = { version = "^1.0", allow-prereleases = true, optional = true }
pyyaml = "^6.0.2"
[tool.poetry.group.ci.dependencies]
black = "^23.3.0"
mypy = "^1.1.1"
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
rstcheck = { version = "^6.2.4", python = "<4" }
ruff = "^0.0.291"
types-pyyaml = "^6.0.12.20240808"
virtualenv = "^20.14.1"
poe_test_helpers = { path = "./tests/fixtures/packages/poe_test_helpers" }
[tool.poetry.group.dev.dependencies]
bpython = "^0.24"
[tool.poetry.group.docs.dependencies]
furo = "^2023.3.27"
livereload = "^2.6.3"
sphinx = "^6.1.3"
sphinx-copybutton = "^0.5.1"
sphinxext-opengraph = "^0.9.0"
[tool.poetry.extras]
poetry_plugin = ["poetry"]
[tool.poetry.scripts]
poe = "poethepoet:main"
[tool.poetry.plugins."poetry.application.plugin"]
poethepoet = "poethepoet.plugin:PoetryPlugin"
[tool.poe.tasks]
_clean_docs.script = "shutil:rmtree('docs/_build', ignore_errors=1)"
[tool.poe.tasks.format]
help = "Run all formatting tools on the code base"
sequence = ["format-ruff", "format-black"]
[tool.poe.tasks.format-ruff]
help = "Run ruff fixer on code base"
cmd = "ruff check . --fix-only"
[tool.poe.tasks.format-black]
help = "Run black on the code base"
cmd = "black ."
[tool.poe.tasks.docs]
help = "Build the docs using Sphinx"
cmd = "sphinx-build docs docs/_build"
deps = ["_clean_docs"]
[tool.poe.tasks.docs-serve]
help = "Serves the docs locally with livereload"
script = "docs:serve"
cwd = "./docs"
deps = ["docs"]
[tool.poe.tasks.docs-check]
help = "Validate rst syntax in the docs"
sequence = [
{ cmd = "rstcheck -r docs --ignore-roles bash,toml,sh,python --ignore-substitutions V --ignore-directives autofunction" },
"docs -b linkcheck"
]
[tool.poe.tasks.clean]
help = "Remove generated files"
script = """
poethepoet.scripts:rm(
".coverage",
".mypy_cache",
".pytest_cache",
"./**/__pycache__",
"dist",
"htmlcov",
"./docs/_build",
"./tests/fixtures/**/.venv",
"./tests/fixtures/simple_project/venv",
"./tests/fixtures/venv_project/myvenv",
"./tests/temp",
verbosity=environ.get('POE_VERBOSITY'),
dry_run=_dry_run
)
"""
[tool.poe.tasks.test]
help = "Run unit and feature tests"
cmd = "pytest"
[tool.poe.tasks.test-quick]
help = "Run unit and feature tests, excluding slow ones"
cmd = "pytest -m 'not slow'"
[tool.poe.tasks.types]
help = "Run the type checker"
cmd = "mypy poethepoet --ignore-missing-imports"
[tool.poe.tasks.lint]
help = "Run linting tools on the code base"
cmd = "ruff check ."
[tool.poe.tasks.style]
help = "Validate black code style"
cmd = "black . --check --diff"
[tool.poe.tasks.check]
help = "Run all checks on the code base"
sequence = ["docs-check", "style", "types", "lint", "test"]
[tool.poe.tasks.install-poetry-plugin]
help = "Install or update this project as a plugin in poetry"
sequence = [
{ cmd = "poetry self remove poethepoet"},
{ cmd = "poetry self add \"${POE_ROOT}[poetry_plugin]\""}
]
ignore_fail = true
[tool.poe.tasks.poe]
help = "Execute poe from this repo (useful for testing)"
script = "poethepoet:main"
[tool.rstcheck]
ignore_messages = [
"Unknown directive type \"autoclass\"",
"Hyperlink target \"shell-completion\" is not referenced.",
"Hyperlink target \"envfile-option\" is not referenced.",
"Hyperlink target \"ref-env-vars\" is not referenced.",
"Hyperlink target \"sequence-composition\" is not referenced.",
"Hyperlink target \"graph-composition\" is not referenced.",
"No directive entry for \"autoclass\" in module \"docutils.parsers.rst.languages.en\""
]
ignore_directives = [
"include"
]
[tool.coverage.report]
omit = ["**/site-packages/**", "poethepoet/completion/*", "poethepoet/plugin.py"]
[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]
[tool.ruff]
select = [
"E", # error
"F", # pyflakes
"I", # isort
"W", # warning
"N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"ASYNC", # flake8-async
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"G", # flake8-logging-format
"PIE", # flake8-pie
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"PGH", # pygrep-hooks
"PERF", # perflint
"RUF", # ruff-specific rules
]
ignore = [
"C408", # unnecessary-collection-call
"PT015", # pytest-assert-always-false
"SIM118", # in-dict-keys
"PTH109", # os-getcwd
"PTH123", # builtin-open
"RUF012", # mutable-class-default
]
fixable = ["E", "F", "I"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"