forked from python-semantic-release/python-semantic-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
391 lines (356 loc) · 8.97 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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# Ref: https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
# and https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "python-semantic-release"
version = "8.1.2"
description = "Automatic Semantic Versioning for Python projects"
requires-python = ">=3.7"
license = { text = "MIT" }
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
readme = "README.rst"
authors = [{ name = "Rolf Erik Lekang", email = "[email protected]" }]
dependencies = [
"click>=8,<9",
"gitpython>=3.0.8,<4",
"requests>=2.25,<3",
"jinja2>=3.1.2,<4",
"python-gitlab>=2,<4",
"tomlkit~=0.10",
"dotty-dict>=1.3.0,<2",
"importlib-resources>=5.7,<7",
"pydantic>=2,<3",
"rich>=12.5.1",
"shellingham>=1.5.0.post1",
]
[project.scripts]
semantic-release = "semantic_release.cli:main"
psr = "semantic_release.cli:main"
[project.urls]
changelog = "https://github.com/python-semantic-release/python-semantic-release/blob/master/CHANGELOG.md"
documentation = "https://python-semantic-release.readthedocs.io"
homepage = "https://python-semantic-release.readthedocs.io"
issues = "https://github.com/python-semantic-release/python-semantic-release/issues"
repository = "http://github.com/python-semantic-release/python-semantic-release.git"
[project.optional-dependencies]
docs = [
"Sphinx<=6.0.0",
"sphinxcontrib-apidoc==0.3.0",
"sphinx-autobuild==2021.03.14",
"furo>=2023.3.27",
]
test = [
"coverage[toml]>=6,<8",
"pytest>=7,<8",
"pytest-xdist>=2,<4",
"pytest-mock>=3,<4",
"pytest-lazy-fixture~=0.6.3",
"pytest-cov>=4,<5",
"pytest-pretty>=1.2.0,<2",
"pytest-clarity>=1.0.1",
"responses==0.23.3",
"requests-mock>=1.10.0,<2",
"types-pytest-lazy-fixture>=0.6.3.3",
]
dev = ["pre-commit", "tox", "black", "ruff==0.0.292"]
mypy = ["mypy", "types-requests"]
[tool.pytest.ini_options]
addopts = [
"-nauto",
"-ra",
"--cache-clear",
"--cov=semantic_release",
"--cov-report",
"html:coverage-html",
"--cov-report",
"term",
]
python_files = ["tests/test_*.py", "tests/**/test_*.py"]
[tool.coverage.run]
omit = ["*/tests/*"]
[tool.bandit]
targets = ["semantic_release"]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
mypy,
py{37,38,39,310,311,312},
coverage
ruff
skipsdist = True
[testenv]
passenv = CI
setenv =
PYTHONPATH = {toxinidir}
TESTING = True
PYTHONHASHSEED = 123456
deps = .[test]
commands =
coverage run -p --source=semantic_release -m pytest {posargs:tests}
[testenv:mypy]
deps = .[mypy]
commands =
mypy semantic_release
[testenv:coverage]
deps = coverage[toml]
commands =
coverage combine
coverage report -m
coverage xml
[testenv:ruff]
deps = .[dev]
commands =
ruff check . --statistics --format=text
"""
[tool.mypy]
python_version = 3.7
packages = ["semantic_release"]
show_column_numbers = true
show_error_context = true
pretty = true
error_summary = true
follow_imports = "normal"
ignore_missing_imports = true # gitpython is very dynamic
disallow_untyped_calls = true
# warn_return_any = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
# warn_unused_ignores = true
warn_unused_configs = true
# warn_unreachable = true
disallow_untyped_defs = true
check_untyped_defs = true
cache_dir = "/dev/null"
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true
allow_incomplete_defs = true
allow_untyped_calls = true
[tool.ruff]
select = ["ALL"]
# See https://beta.ruff.rs/docs/rules
ignore = [
# attribute shadows builtin (e.g. Foo.list())
"A003",
# Annotations (flake8-annotations)
# missing "self" type-hint
"ANN101",
# missing "cls" type-hint
"ANN102",
# no typing.Any
"ANN401",
# flake8-bugbear
# no functools.lru_cache
"B019",
# flake8-commas
"COM",
# Missing docstrings. These would be nice to enable
# but not done yet
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
# class docstrings must be preceded by a newline
"D203",
# one blank line between summary and description for docstrings
"D205",
# multiline summary should start on first line of docstring
"D212",
# first line should end with a period
"D400",
# "an imperative mood"
"D401",
# First word of docstring should be "This"
"D404",
"D415",
# flake8-datetimez
"DTZ",
# flake8-errmsg
"EM",
# don't compare types, use isinstance()
# sometimes using type(x) == y is deliberately chosen to exclude
# subclasses
"E721",
# flake8-fixme
"FIX",
# flake8-boolean-trap
"FBT",
# No implicit packages
"INP001",
# Errors should end with "Error"
"N818",
# flake8-pytest-style, values rowtype (list|tuple)
"PT007",
# pytest.raises needs a match - eventually want to enable
"PT011",
# pytest.raises must be alone in a with-block
"PT012",
# use only simple "import pytest"
"PT013",
# pylint
"PLR",
"PLE1507",
# flake8-use-pathlib
"PTH",
# flake8-raise
"RSE",
# ruff
# This seems to flag a load of false-positives, thinking that the # noqa's are
# unneeded and trying to fix them even though ruff then flags the errors that
# were previously ignored
"RUF100",
# flake8-todos
"TD002",
"TD003",
# tryceratops
"TRY003",
"TRY401",
]
external = ["V"]
target-version = "py37"
force-exclude = true
line-length = 88
format = "grouped"
ignore-init-module-imports = true
show-source = true
show-fixes = true
src = ["semantic_release", "tests"]
task-tags = ["NOTE", "TODO", "FIXME", "XXX"]
[tool.ruff.per-file-ignores]
# Imported but unused
"__init__.py" = ["F401"]
# pydantic 1 can't handle __future__ annotations-enabled syntax on < 3.10
"semantic_release/cli/config.py" = ["UP", "TCH"]
"semantic_release/commit_parser/*" = ["UP", "FA", "TCH"]
# Method argument not used. This is mostly a base class
# anyway
"semantic_release/hvcs/_base.py" = ["ARG002"]
# from tests.fixtures import * is deliberate
"tests/conftest.py" = ["F403"]
"tests/fixtures/__init__.py" = ["F403"]
"tests/*" = [
# unused arguments - likely fixtures to be moved to
# @pytest.mark.usefixtures
"ARG001",
# "assert" used
"S101",
# possible hard-coded password assigned to argument
# because we use "prerelease_token=..." and bandit panics
# when it sees *_token variables
"S105",
"S106",
"S107",
# pseudo-random generators not suitable for cryptographic purposes
# (e.g. random.choice used)
"S311",
# Private member access
"SLF001",
# Annotations
"ANN",
]
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.flake8-implicit-str-concat]
allow-multiline = true
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.flake8-type-checking]
strict = true
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "csv"
[tool.ruff.isort]
# required-imports = ["from __future__ import annotations"]
combine-as-imports = true
known-first-party = ["semantic_release"]
forced-separate = ["tests"]
relative-imports-order = "closest-to-furthest"
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"tests",
"local-folder",
]
sections = { "tests" = ["tests"] }
[tool.semantic_release]
logging_use_named_masks = true
tag_format = "v{version}"
commit_parser = "angular"
commit_author = "semantic-release <semantic-release>"
commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
build_command = """
python -m pip install build~=0.10.0
python -m build .
"""
major_on_zero = true
assets = []
version_variables = ["semantic_release/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"style",
"refactor",
"test",
]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = []
[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = true
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease = false
prerelease_token = "rc"
[tool.semantic_release.branches."8.0.x"]
match = "8.0.x"
prerelease = true
prerelease_token = "rc"
[tool.semantic_release.remote]
name = "origin"
type = "github"
ignore_token_for_push = false
token = { env = "GH_TOKEN" }
[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true