-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
144 lines (117 loc) · 3.22 KB
/
Copy pathpyproject.toml
File metadata and controls
144 lines (117 loc) · 3.22 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
140
141
142
143
144
[project]
name = "blueprint-project"
version = "0.1.0"
description = "Blueprint template for Python projects."
requires-python = ">=3.11"
readme = "README.md"
dependencies = ["poethepoet>=0.22.1,<0.23"]
[project.scripts]
poe = "poethepoet:main"
[project.entry-points."poetry.application.plugin"]
poethepoet = "poethepoet.plugin:PoetryPlugin"
[dependency-groups]
lint = [
"ruff>=0.11.8",
"pycodestyle>=2.11.0,<3",
"pylint>=2.17.5,<3",
"isort>=5.12.0,<6",
]
types = [
"ty>=0.0.31",
]
test = [
"pytest>=7.1.2,<8",
"pytest-cov>=3.0.0,<4",
]
dev = [
"prek",
{include-group = "lint"},
{include-group = "types"},
{include-group = "test"}
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["blueprint_project"]
[tool.poe.tasks]
_clean_docs.script = "shutil:rmtree('docs/_build', ignore_errors=1)"
[tool.poe.tasks.dev-setup]
help = "Setup the project for development"
cmd = "uv sync --all-groups"
[tool.poe.tasks.typing]
help = "Run ty type checker on the code base"
cmd = "ty check blueprint_project"
[tool.poe.tasks.lint]
help = "Run Ruff linter"
cmd = "ruff check"
[tool.poe.tasks.lint-fix]
help = "Fix linting and import errors"
cmd = "ruff check --fix"
[tool.poe.tasks.format]
help = "Format code using Ruff"
cmd = "ruff format"
[tool.poe.tasks.isort-fix]
help = "Sort imports. This affects the code base as this makes changes to affected files."
cmd = "isort blueprint_project"
[tool.poe.tasks.isort]
help = "Validate isort code style"
cmd = "isort blueprint_project --check --diff"
[tool.poe.tasks.tests]
help = "Run unit and feature tests"
cmd = "pytest tests --cov=blueprint_project"
[tool.poe.tasks.ci]
help = "Execute all CI tasks"
sequence = ["typing", "lint", "isort", "tests"]
ignore_fail = true
[tool.poe.tasks.clean]
help = "Remove generated files"
cmd = """
# multiline commands including comments work too!
rm -rf .coverage
.mypy_cache
.pytest_cache
./**/__pycache__
.ruff_cache
dist
htmlcov
./docs/_build
./tests/fixtures/simple_project/venv
./tests/fixtures/venv_project/myvenv
./tests/fixtures/poetry_plugin_project/**/.venv
./tests/temp
"""
[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.ruff]
line-length = 120
src = ["blueprint_project"]
[tool.ruff.lint]
select = ["E", "F", "I"]
extend-select = ["I"]
[tool.isort]
profile = "black"
py_version = 311
[tool.black]
line-length = 120
target-version = ["py311"]
skip-string-normalization = true
[tool.mypy]
python_version = "3.11"
ignore_missing_imports = true
[tool.pylint]
max-line-length = 120
disable = [
"C0103", # invalid-name
"C0114", # missing-module-docstring
"W1203", # logging-fstring-interpolation
"E0213", # no-self-argument
"E1101", # no-member
"W0511", # To-Dos
"R0903" # too-few-public-methods
]