forked from pyOpenSci/pyos-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
189 lines (153 loc) · 4.19 KB
/
Copy pathpyproject.toml
File metadata and controls
189 lines (153 loc) · 4.19 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
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
################################################################################
# Build Configuration
################################################################################
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
################################################################################
# Project Configuration
################################################################################
[project]
name = "project_name"
dynamic = ["version"]
description = "project_description"
authors = [
{ name = "your_name", email = "your_email@somewhere.com" },
]
license = "BSD-3-Clause"
readme = {"file" = "README.md", "content-type" = "text/markdown"}
# Please consult https://pypi.org/classifiers/ for a full list.
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Typing :: Typed",
]
keywords = []
# Package dependencies
dependencies = []
[project.urls]
Homepage = ""
"Source Code" = ""
"Bug Tracker" = ""
Documentation = ""
Download = ""
# [project.scripts]
# script = "<package>.__main__:<entrypoint>"
[project.optional-dependencies]
dev = [
"hatch",
"pre-commit",
]
################################################################################
# Tool Configuration
################################################################################
# Exclude files outside package
[tool.hatch.build]
only-packages = true
[tool.hatch.build.targets.wheel]
packages = ["src/package_name"]
# [tool.hatch.build.hooks.vcs]
# version-file = "src/<package_name>/_version.py"
[tool.hatch.version]
source = "vcs"
# The default isort output conflicts with black autoformatting.
# Tell isort to behave nicely with black
# See https://pycqa.github.io/isort/docs/configuration/black_compatibility.html
# for more information.
[tool.isort]
profile = "black"
[tool.pydoclint]
style = "google" # TODO: Other styles are possible here, like 'numpy'
arg-type-hints-in-docstring = false
check-return-types = false
check-yield-types = false
exclude = "_version.py"
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = ["raises"]
[tool.coverage.paths]
source = [
"src/project_name",
]
[tool.coverage.run]
branch = true
parallel = true
omit = [
"src/project_name/_version.py",
]
[tool.coverage.report]
exclude_lines = ["pragma: no cover"]
precision = 2
################################################################################
# Hatch Environments
################################################################################
[tool.hatch.envs.default]
skip-install = true
[tool.hatch.envs.dev]
description = """
Describe the environment for local development.
"""
dependencies = []
path = ".venv"
[tool.hatch.envs.install]
description = """Test the installation the package."""
dependencies = [
"pip",
"twine",
]
detached = true
builder = true
[tool.hatch.envs.install.scripts]
check = [
"pip check",
"hatch build {args:--clean}",
"twine check dist/*",
]
[tool.hatch.envs.test]
description = """
Run test suite
"""
dependencies = [
"pytest",
"pytest-cov",
"pytest-raises",
"pytest-randomly",
"pytest-xdist",
]
[[tool.hatch.envs.test.matrix]]
python = ["3.12", "3.13", "3.14"]
[tool.hatch.envs.test.scripts]
run = "pytest {args:--cov=src/package_name --cov-report=term-missing --cov-report=xml}"
[tool.hatch.envs.style]
description = """Check the style of the codebase."""
dependencies = [
"pydoclint",
]
detached = true
[tool.hatch.envs.style.scripts]
docstrings = "pydoclint"
check = ["docstrings"]
[tool.hatch.envs.audit]
description = """Check dependencies for security vulnerabilities."""
extra-dependencies = [
"pip-audit",
]
[tool.hatch.envs.audit.scripts]
check = ["pip-audit"]
[tool.hatch.envs.types]
description = """Check the static types of the codebase."""
dependencies = [
"mypy",
]
[tool.hatch.envs.types.scripts]
check = "mypy src/package_name"
[tool.hatch.envs.docs]
description = """Build or serve the documentation."""
python = "3.14"
dependencies = []
# [tool.hatch.envs.docs.scripts]
# build = []
# serve = []