-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
146 lines (132 loc) · 3.29 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
[tool.poetry]
name = "pkgtst"
version = "0.1.0"
description = "Python template with some awesome tools to quickstart any Python project"
authors = ["Eric Lopes <[email protected]>"]
maintainers = ["Eric Lopes <[email protected]>"]
license = "MIT"
repository = "https://github.com/nullhack/pkgtst"
documentation = "https://github.com/nullhack/pkgtst/tree/main/docs/api/"
readme = "README.md"
packages = [
{ include = "pkgtst" },
]
[tool.poetry.dependencies]
python = "^3.10"
[tool.poetry.group.dev.dependencies]
pre-commit = "^2.18.1"
black = {version = "^22.3.0", allow-prereleases = true}
xdoctest = "^1.0.0"
poethepoet = "^0.16.4"
ruff = "^0.0.253"
pytest = "7.1.1"
pytest-html = "^3.1.1"
pytest-sugar = "^0.9.6"
pytest-reverse = "^1.5.0"
pytest-cov = "^3.0.0"
pytest-bdd = "^6.1.1"
mkdocs = "^1.4.2"
mkdocs-material = "^8.5.10"
mkdocs-gen-files = "^0.4.0"
mkdocs-awesome-pages-plugin = "^2.8.0"
mkapi = "^1.0.14"
[tool.poetry.scripts]
-c = "poethepoet:main"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 79
target-version = ['py310']
include = '\.pyi?$'
[tool.ruff]
ignore = ["E501"]
line-length = 79
select = [
"C9",
"E",
"F",
"W",
"D",
"G",
"A",
"PT",
"S",
"B",
"ANN",
"SIM",
"I",
"N",
]
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = """
--verbose \
--maxfail=1 \
--reverse \
--color=yes \
--cov=pkgtst \
--html=docs/pytest_report.html \
--self-contained-html \
--cov-fail-under=0 \
--cov-report term-missing \
--cov-report html:docs/cov-report \
--doctest-modules \
--cov-config=pyproject.toml"""
testpaths = [
"tests",
"pkgtst"
]
python_files = ["*_test.py"]
python_functions = ["test_*"]
render_collapsed = true
bdd_features_base_dir = "bdd-features"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:"
]
[tool.poe.tasks]
install = "poetry install --only main"
install-dev = "poetry install"
run = "python -m pkgtst.pkgtst"
test = "pytest"
install-pre-commit = "pre-commit install"
run-pre-commit = "pre-commit run --all-files"
pre-commit = ["install-pre-commit", "run-pre-commit"]
lint-ruff = "ruff check **/*.py --fix"
lint-black = "black **/*.py"
lint = ["lint-black", "lint-ruff"]
doc = "mkdocs serve --use-directory-urls -f docs/mkdocs.yaml"
doc-html = "mkdocs build --no-directory-urls -f docs/mkdocs.yaml"
doc-publish = """mkdocs gh-deploy \
--config-file docs/mkdocs.yaml \
--no-directory-urls \
--remote-branch docs"""
[tool.poe.tasks.docker-build]
cmd = """
docker build
--build-arg TESTBUILD=$no_test \
--build-arg BUILDTAG=$build_tag \
--build-arg BUILDPLATFORM=$build_platform \
--target $target \
-t pkgtst:$target-$build_tag ."""
help = "Build a docker image to test the project in an isolated environment"
args = [
{ name = "no-test", default = true, type = "boolean" },
{ name = "build-tag", default = "3-alpine" },
{ name = "build-platform", default = "linux/amd64" },
{ name = "target", default = "prod" },
]