-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
199 lines (170 loc) · 3.99 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
[build-system]
requires = ["poetry-core>=2.0,<3.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.requires-plugins]
poetry-plugin-export = ">=1.8,<2.0"
[project]
name = "python_template"
version = "0.0.0"
description = "python_template"
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.10"
authors = [
{name = "Vladislav Punko", email = "iam.vlad.punko@gmail.com"},
]
maintainers = []
classifiers = [] # see information: https://pypi.org/classifiers
keywords = []
dependencies = [ # see information: https://python-poetry.org/docs/dependency-specification
"loguru (>=0.7,<1.0)",
"numpy (>=2.2,<3.0)",
]
[project.optional-dependencies]
cpu = [
"torch (>=2.6,<2.7) ; sys_platform == 'darwin'",
"torch (>=2.6+cpu,<2.7+cpu) ; sys_platform == 'linux'",
]
cuda = [
"torch (>=2.6+cu126,<2.7+cu126) ; sys_platform == 'linux'",
]
[project.urls]
"Issue tracker" = "https://github.com/vladpunko/python-template/issues"
"Source code" = "https://github.com/vladpunko/python-template"
[tool.poetry]
package-mode = true
packages = [
{include = "python_template", from = "src"},
]
include = ["CHANGELOG.md", "LICENSE", "README.md"]
[tool.poetry.dependencies]
python = ">=3.10,<3.13"
# ---
torch = [
{markers = "extra == 'cpu' and extra != 'cuda'", platform = "linux", source = "pytorch_cpu"},
{markers = "extra == 'cuda' and extra != 'cpu'", platform = "linux", source = "pytorch_cuda"},
# ---
{platform = "darwin", source = "pypi_public"},
]
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
numpydoc = "^1.8"
sphinx = "^8.1"
sphinx_rtd_theme = "^3.0"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
bandit = "^1.8"
black = "^25.1"
deptry = "^0.23"
isort = "^6.0"
jupyter = "^1.1"
mypy = "^1.14"
pre-commit = "^4.1"
ruff = "^0.9"
twine = "^6.1"
[tool.poetry.group.tests]
optional = true
[tool.poetry.group.tests.dependencies]
coverage = "^7.6"
pyfakefs = "^5.7"
pytest = "^8.3"
pytest-cov = "^6.0"
pytest-html = "^4.1"
pytest-mock = "^3.14"
snakeviz = "^2.2"
tox = "^4.24"
[[tool.poetry.source]]
name = "pypi_public"
priority = "primary"
url = "https://pypi.org/simple/"
[[tool.poetry.source]]
name = "pytorch_cpu"
priority = "explicit"
url = "https://download.pytorch.org/whl/cpu"
[[tool.poetry.source]]
name = "pytorch_cuda"
priority = "explicit"
url = "https://download.pytorch.org/whl/cu126"
[tool.pytest.ini_options]
addopts = [
"-vv",
"-x", # exit instantly on first error or failed test
# ---
"--cov-report=html",
"--cov-report=term",
"--cov",
"--doctest-modules",
"--durations=10",
"--failed-first",
"--import-mode=importlib",
"--new-first",
# ---
"--html=./.pytest_report/index.html",
]
testpaths = ["src/python_template", "tests"]
[tool.coverage.run]
branch = true
omit = [
"src/python_template/__about__.py",
]
parallel = true
source = ["src/python_template"]
[tool.coverage.report]
exclude_lines = [
"@abc.abstractmethod",
# We have to re-enable the standard pragma.
"pragma: no cover",
# Do not complain about missing debug-only code.
"def __repr__",
"if self.debug:",
# No need to complain if tests do not hit defensive assertion code.
"pass",
"raise AssertionError",
"raise NotImplementedError",
"return NotImplemented",
# Do not complain if non-runnable code is not run.
"if __name__ == .__main__.:",
"if 0:",
"if False:",
]
show_missing = true
[tool.black]
target-version = ["py310", "py311", "py312"]
[tool.bandit]
exclude_dirs = [
"docs/",
"tests/",
]
[tool.deptry]
extend_exclude = [
"^docs/",
"^examples/",
"^tests/",
]
[tool.isort]
profile = "black"
known_first_party = []
known_local_folder = ["python_template"]
[tool.mypy]
disallow_untyped_defs = true
exclude = [
".pyi$",
"^docs/",
"^examples/",
"^tests/",
]
ignore_missing_imports = true
plugins = "pydantic.mypy"
strict_optional = true
[tool.ruff]
exclude = [
"*.pyi",
"docs/",
"tests/",
]
line-length = 88
select = ["A", "B", "C", "E", "F", "N", "W"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"