-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
311 lines (238 loc) · 10.4 KB
/
pyproject.toml
File metadata and controls
311 lines (238 loc) · 10.4 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
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
# SPDX-FileCopyrightText: 2026 Daniel Balparda <balparda@github.com>
# SPDX-License-Identifier: Apache-2.0
# pyproject.toml (preferred for new projects, PEP 621)
# TODO: FIRST pick PYTHON VERSION; there are AT LEAST 6 places in this file that depend on this
####################################################################################################
[build-system]
requires = [ "poetry-core>=2.3" ]
build-backend = "poetry.core.masonry.api"
####################################################################################################
[project]
name = "mycli" # TODO: app name, and also rename src/mycli directory to match
version = "0.1.0" # also update src/mycli/__init__.py # TODO: app initial version
description = "Python CLI app" # TODO: app description
license = "Apache-2.0" # TODO: correct license? if not, change: LICENSE and here and README.md
authors = [
{ name = "Daniel Balparda", email = "balparda@github.com" },
{ name = "BellaKeri", email = "BellaKeri@github.com" },
# TODO: ... add authors ...
]
keywords = [
"python",
"poetry",
"typer",
"rich",
"transcrypto",
"crypto",
"cli",
"template",
]
classifiers = [ # see: https://pypi.org/classifiers/
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12", # TODO: python VERSION; pick correct ones
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Topic :: Utilities"
# TODO: ... add others ...
]
requires-python = ">=3.12" # TODO: python VERSION; pick correct one
readme = "README.md"
license-files = [ "LICENSE" ]
dependencies = [
"transcrypto>=2.6.0",
# best place for project dependencies, if possible
# development-only dependencies go in the [tool.poetry.group.dev.dependencies] section below
]
####################################################################################################
[project.scripts]
# console scripts that will be installed when installing the package;
# if you change/add a line here also edit [tool.poetry.scripts] below and re-run `poetry sync`
mycli = "mycli.mycli:Run" # TODO: rename `mycli` part
####################################################################################################
[tool.poetry.scripts]
# poetry/poetry-core still relies on this section for wheel entry points in some versions;
# keep this in sync with [project.scripts] above
mycli = "mycli.mycli:Run" # TODO: rename `mycli` part
####################################################################################################
[project.urls]
Homepage = "https://github.com/balparda/mycli"
Repository = "https://github.com/balparda/mycli"
Issues = "https://github.com/balparda/mycli/issues"
Changelog = "https://github.com/balparda/mycli/blob/main/CHANGELOG.md"
# PyPI = "https://pypi.org/project/transcrypto/"
####################################################################################################
[tool.poetry]
requires-poetry = "^2.1"
packages = [{ include = "mycli", from = "src" }] # TODO: rename `mycli` part
include = [
{ path = "src/mycli/py.typed", format = "sdist" }, # TODO: rename `mycli` part
{ path = "src/mycli/py.typed", format = "wheel" }, # TODO: rename `mycli` part
]
####################################################################################################
[tool.poetry.dependencies]
# prefer to add dependencies inside the [project.dependencies] section
python = "^3.12" # if version changes, remember to change README.md # TODO: python VERSION; pick correct one
[tool.poetry.group.dev.dependencies]
# basic, all projects should have
ruff = "^0.15.10"
mypy = "^1.20"
pytest = "^9.0"
pytest-cov = "^7.1"
pytest-flakefinder = "^1.1"
pyright = "^1.1"
pre-commit = "^4.5"
pyinstrument = "^5.1"
typeguard = "^4.5"
# project-specific dev-only
# TODO: add dev-only deps here
[tool.poetry.requires-plugins]
poetry-plugin-export = "^1.10"
####################################################################################################
[tool.ruff]
target-version = "py312" # TODO: python VERSION; pick correct one
line-length = 100
indent-width = 2
src = [ "scripts", "src", "tests", "tests_integration" ]
extend-exclude = [
"typings/**/__init__.pyi", # typically stub files created by pyright
]
# Strongly recommended if you run Ruff via pre-commit (or any tool that passes
# file paths explicitly): ensures excluded files stay excluded even when passed
# on the command line.
force-exclude = true
[tool.ruff.format]
quote-style = "single"
indent-style = "space"
docstring-code-format = true
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
####################################################################################################
[tool.ruff.lint]
select = [
"ALL", # ALL rules --- if too strict comment this out and pick the ones you need below
# "E", # pycodestyle "errors" (basic correctness-ish style checks)
# "F", # pyflakes (unused imports/vars, undefined names, etc.)
# "I", # isort rules (import sorting)
# "UP", # pyupgrade (suggest modern Python syntax)
# "B", # flake8-bugbear (common bug patterns / footguns)
# "SIM", # flake8-simplify (suggest simpler expressions)
# "A", # (builtins shadowing; e.g. naming a var list)
# "N", # (naming conventions)
# "S", # (security-ish checks from Bandit; can be noisy but useful)
# "DTZ", # (timezone-naive datetime pitfalls)
# "TRY", # (exception-handling best practices)
# "PERF", # (performance footguns)
# "TCH", # (type-checking import hygiene)
# "D", # (docstring conventions / pydocstyle — only if you want docstring policing)
]
ignore = [
"N802", # allow PascalCase in method names
"E111", # allow 2-space indentation
"E114", # allow 2-space indentation
"D203", # incorrect-blank-line-before-class: may cause conflicts when used with the formatter
"D213", # multi-line-summary-second-line b/c conflicts w/ multi-line-summary-first-line D212
"COM812", # missing-trailing-comma: may cause conflicts when used with the formatter
"TC001", # Move application import `X` into a type-checking block
"TC002", # checks for third-party imports that are only used for type annotations
"TC003", # Move standard library import `X` into a type-checking block
"E731", # Do not assign a `lambda` expression, use a `def`
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # allows boolean positional value in function call
"PLR0913", # Too many arguments in function definition (N > 5)
"PLR0917", # Too many positional arguments (N/5)
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving this statement to an `else` block
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"TD002", # allow TODOs without authors
"TD003", # allow TODOs without bugs
"FIX002", # fix the todos... if you want to still see them in VSCode: "Todo Tree" extension (Gruntfuggly) # TODO: remove this line: you usually want this
"PGH003", # allow ignoring type issues without giving extra codes
"LOG015", # allows for calls into top-level logging methods
"G004", # allows logging statements to use f-string
]
task-tags = ["noqa", "cspell", "type", "pragma", "pyright"]
preview = true # if you want new features being previewed
[tool.ruff.lint.per-file-ignores]
"scripts*/**/*.py" = [
"S101", # Use of `assert` detected
"PT018", # Assertion should be broken down into multiple parts
"SLF001", # Private member accessed
"PLR2004", # Magic value used in comparison, consider replacing <V> with a constant variable
"T201", # `print` found
]
"tests*/**/*.py" = [
"S101", # Use of `assert` detected
"PT018", # Assertion should be broken down into multiple parts
"SLF001", # Private member accessed
"PLR2004", # Magic value used in comparison, consider replacing <V> with a constant variable
]
####################################################################################################
[tool.mypy]
python_version = "3.12" # TODO: python VERSION; pick correct one
mypy_path = [ "src", "typings" ]
warn_unused_ignores = false # VSCode always has more to say, so this is important
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unreachable = true
show_error_codes = true
check_untyped_defs = true
no_implicit_reexport = true
strict = true
####################################################################################################
[tool.pyright]
typeCheckingMode = "strict"
pythonVersion = "3.12" # TODO: python VERSION; pick correct one
venvPath = "."
venv = ".venv"
include = [ "scripts", "src", "tests", "tests_integration" ]
extraPaths = [ ".", "src" ] # needed to find tests/ directory modules
exclude = [
"**/.*",
"**/.venv",
"**/__pycache__",
"**/.mypy_cache",
"**/.pytest_cache",
"**/.ruff_cache",
"**/dist",
"**/build",
"**/node_modules",
]
executionEnvironments = [
# Any tests* trees: disable the private-usage diagnostic.
{ root = "tests", reportPrivateUsage = "none" },
{ root = "tests_integration", reportPrivateUsage = "none" },
]
####################################################################################################
[tool.pytest.ini_options]
pythonpath = [ "src" ]
testpaths = [ "tests", "tests_integration" ]
addopts = [
"-q",
"--strict-markers",
]
markers = [
"slow: test is slow (> 1s)",
"flaky: AVOID! - test is known to be flaky",
"stochastic: test is capable of failing (even if very unlikely)",
"integration: integration test (installs wheel + runs console script)",
# define your own tags here; to run and de-select/select a tag do: `-m \"not slow\"` or `-m slow`
# mark python tests with decorator @pytest.mark.slow / @pytest.mark.<tag-name>
]
typeguard-packages = [ "mycli", "scripts" ] # TODO: rename `mycli` part
typeguard-forward-ref-policy = "ERROR"
typeguard-collection-check-strategy = "ALL_ITEMS"
####################################################################################################
[tool.coverage.run]
omit = [
"*/__init__.py", # keep these free of real code!
"*/__main__.py",
"*/template.py",
]