-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
316 lines (292 loc) · 7.02 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
[project]
name = "cookiecutter-nist-python"
authors = [{ name = "William P. Krekelberg", email = "[email protected]" }]
license = { text = "NIST-PD" }
description = "Cookiecutter template for NIST python package"
# if using markdown
# long_description_content_type = text/markdown
keywords = ["cookiecutter-nist-python"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"License :: Public Domain",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
]
dynamic = ["readme"]
version = "0.1.0"
requires-python = ">=3.8"
dependencies = []
[project.urls]
homepage = "https://github.com/usnistgov/cookiecutter-nist-python"
documentation = "https://pages.nist.gov/cookiecutter-nist-python/"
[project.optional-dependencies]
test = [
"pytest", #
"pytest-sugar",
"pytest-cookies",
"cookiecutter",
]
dev-extras = [
"watchdog", #
"ipython",
"ipykernel",
]
typing-extras = [
"pytype; python_version < '3.11'", #
"mypy >= 1.4.1",
]
typing = [
"cookiecutter-nist-python[typing-extras]", #
"cookiecutter-nist-python[test]",
]
nox = [
"nox",
"noxopt", # p2c: -p
"ruamel.yaml",
]
dev = [
"cookiecutter-nist-python[test]", #
"cookiecutter-nist-python[typing-extras]",
"cookiecutter-nist-python[dev-extras]",
]
tools = [
"pre-commit", #
# "cruft",
"scriv", # p2c: -p
"pyright",
]
dev-complete = [
"cookiecutter-nist-python[dev]", #
"cookiecutter-nist-python[tools]",
"cookiecutter-nist-python[nox]",
]
docs = [
"ipython", #
"pyenchant",
"ghp-import",
"sphinx >= 5.3.0",
"sphinx-copybutton",
"sphinxcontrib-spelling",
"sphinx-autobuild",
"myst-nb",
"sphinx-book-theme",
"autodocsumm",
]
[tool.pyproject2conda]
user_config = "config/userconfig.toml"
template_python = "requirements/py{py}-{env}"
template = "requirements/{env}"
# defaults
python = ["3.10"]
channels = ["conda-forge"]
style = ["yaml", "requirements"]
default_envs = ["test", "typing", "docs", "dev", "dev-complete"]
[tool.pyproject2conda.envs.test-extras]
extras = ["test"]
[tool.pyproject2conda.envs.dev-base]
extras = ["dev"]
[[tool.pyproject2conda.overrides]]
envs = ["test-extras", "dist-conda", "dist-pypi"]
base = false
[[tool.pyproject2conda.overrides]]
envs = ["test", "typing", "test-extras"]
python = ["3.8", "3.9", "3.10", "3.11"]
[tool.aliases]
test = "pytest"
[tool.pytest.ini_options]
addopts = "--doctest-modules --doctest-glob='*.md' -s -rP --basetemp=tmp/baked --keep-baked-projects"
testpaths = ["tests", "README.md"]
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "@overload"]
omit = ["*/vendored/*"]
include = ["src/*"]
[tool.isort]
profile = "black"
skip_gitignore = true
known_first_party = ["cookiecutter_nist_python"]
[tool.ruff]
fix = true
line-length = 88
target-version = "py38"
select = [
# pyflakes
"F",
# pycodestyle
"E",
"W",
# isort
"I",
# pyupgrade
"UP",
# pydocstyle
"D",
# # flake8-2020
"YTT",
# # flake8-bugbear
# "B",
# flake8-quotes
"Q",
# # pylint
# "PLE", "PLR", "PLW",
# # misc lints
"PIE",
# # tidy imports
"TID",
# # implicit string concatenation
# "ISC",
# # type-checking imports
"TCH",
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
# fixable = ["A", "B", "C", "D", "E", "F", "..."]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"tests/",
"src/cookiecutter_nist_python/tests",
]
ignore = [
# # whitespace before ':' - doesn't work well with black
# "E203",
# module level import not at top of file
"E402",
# line too long - let black worry about that
"E501",
# do not assign a lambda expression, use a def
"E731",
# # line break before binary operator
# "W503",
# allow black line after docstring
"D202",
"D105",
"D205",
# this leads to errors with placing titles in module
# docstrings
"D400",
"D401",
"D415",
"D102",
"D103",
# these are useful, but too many errors
# due to use of docfiller
"D417",
"D107",
"D203",
"D212",
# Allow relative imports
"TID252",
]
per-file-ignores = { }
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.isort]
known-first-party = ["cookiecutter_nist_python"]
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.nbqa.addopts]
ruff = ["--fix", "--extend-ignore=D100,B018"]
[tool.flake8]
docstring-convention = "numpy"
ignore = [
# # whitespace before ':' - doesn't work well with black
"E203",
# module level import not at top of file
"E402",
# line too long - let black worry about that
"E501",
# do not assign a lambda expression, use a def
"E731",
# # line break before binary operator
"W503",
# allow black line after docstring
"D202",
"D105",
"D205",
# this leads to errors with placing titles in module
# docstrings
"D400",
"D401",
"D415",
"D102",
"D103",
# these are useful, but too many errors
# due to use of docfiller
"D417",
"D107",
"D203",
"D212",
]
[tool.scriv]
format = "md"
md_header_level = "2"
new_fragment_template = "file: changelog.d/templates/new_fragment.md.j2"
[tool.commitizen]
use_shortcuts = true
[tool.cruft]
[tool.mypy]
files = ["src/cookiecutter_nist_python"]
show_error_codes = true
warn_unused_ignores = true
warn_return_any = true
warn_unused_configs = true
exclude = [".eggs", ".tox", "doc", "docs", ".nox"]
check_untyped_defs = true
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = []
[[tool.mypy.overrides]]
ignore_errors = true
module = []
[tool.pyright]
include = ["src", "tests"]
exclude = ["**/__pycache__", ".tox/**", ".nox/**", "**/.mypy_cache"]
pythonVersion = "3.10"
typeCheckingMode = "basic"
# enable subset of "strict"
reportDuplicateImport = true
reportInvalidStubStatement = true
reportOverlappingOverload = true
reportPropertyTypeMismatch = true
reportUntypedClassDecorator = true
reportUntypedFunctionDecorator = true
reportUntypedNamedTuple = true
reportUnusedImport = true
# disable subset of "basic"
reportGeneralTypeIssues = false
reportMissingModuleSource = false
reportOptionalCall = false
reportOptionalIterable = false
reportOptionalMemberAccess = false
reportOptionalOperand = false
reportOptionalSubscript = false
reportPrivateImportUsage = false
reportUnboundVariable = false
[tool.pytype]
inputs = ["src", "tests"]