Repository navigation
Expand file tree
/
Copy pathtbump.toml
More file actions
84 lines (67 loc) · 3.43 KB
/
Copy pathtbump.toml
File metadata and controls
84 lines (67 loc) · 3.43 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
github_url = "https://github.com/pylint-dev/pylint"
[version]
current = "4.2.0-dev0"
regex = '''
^(?P<major>0|[1-9]\d*)
\.
(?P<minor>0|[1-9]\d*)
\.
(?P<patch>0|[1-9]\d*)
(?:-?(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
'''
[git]
message_template = "Bump pylint to {new_version}, update changelog"
tag_template = "v{new_version}"
# For each file to patch, add a [[file]] config
# section containing the path of the file, relative to the
# tbump.toml location.
[[file]]
src = "pylint/__pkginfo__.py"
# You can specify a list of commands to
# run after the files have been patched
# and before the git commit is made
[[before_commit]]
name = "Clean-up / normalize functional tests output"
cmd = "python tests/test_functional.py --update-functional-output"
[[before_commit]]
name = "Normalize file ending"
# Staging the deletions first, or renormalize fails on a removed expected output
cmd = "git add --update && git add --renormalize ."
[[before_commit]]
name = "Upgrade changelog"
cmd = "python3 script/bump_changelog.py {new_version}"
[[before_commit]]
name = "Upgrade and check doc"
cmd = "tox -e docs||echo 'Hack so this command does not fail'"
[[before_commit]]
name = "Upgrade the pylintrc examples"
# Independent of the machine: a fixed py-version, and no spelling dictionaries
# listed
cmd = '''python3 -c "import sys; sys.modules['enchant'] = None; from pylint import run_pylint; run_pylint()" --rcfile=/dev/null --py-version=3.14 --generate-rcfile > examples/pylintrc'''
[[before_commit]]
name = "Upgrade the toml examples"
cmd = '''python3 -c "import sys; sys.modules['enchant'] = None; from pylint import run_pylint; run_pylint()" --rcfile=/dev/null --py-version=3.14 --generate-toml-config > examples/pyproject.toml'''
[[before_commit]]
name = "Normalize the contributors-txt configuration"
cmd = "contributors-txt-normalize-configuration -a script/.contributors_aliases.json -o script/.contributors_aliases.json"
[[before_commit]]
name = "Upgrade the contributors list"
cmd = "python3 script/create_contributor_list.py"
[[before_commit]]
name = "Update primer commit pins to latest (minor releases only, not on a maintenance branch)"
cmd = "case {new_version} in *.0) python3 script/update_primer_commits.py ;; esac"
[[before_commit]]
name = "Apply pre-commit"
cmd = "pre-commit run --all-files||echo 'Hack so this command does not fail'"
[[before_commit]]
name = "Write the GitHub release notes to release_notes.md (not committed)"
# The release highlights of a minor version follow its release date
cmd = '''awk -v v={new_version} 'FNR==1{{f=0; s=0; h=""}} /^\.\. towncrier release notes start/{{s=0}} s{{h=h $0 "\n"}} /^Summary -- Release highlights$/{{s=1; getline}} /^What.s new in Pylint /{{f=($0=="What\047s new in Pylint " v "?")}} f; f && /^Release date/ && v ~ /\.0$/{{printf "%s", h}}' doc/whatsnew/*/*/index.rst | sed -E 's/`((pylint-dev\/astroid)?#[0-9]+) <[^>]+>`__/\1/g; s/`([^`<]*[^`< ]) <([^>]+)>`__?/[\1](\2)/g; s/:[a-z]+(:[a-z]+)?:`([^`<]*[^`< ]) <[^>]+>`/``\2``/g; s/:[a-z]+(:[a-z]+)?:`([^`]+)`/``\2``/g' | awk -f script/code_blocks_to_markdown.awk > release_notes.md'''
[[before_commit]]
name = "Confirm changes"
cmd = "read -p 'Continue (y)? ' -n 1 -r; echo; [[ ! $REPLY =~ ^[Yy]$ ]] && exit 1 || exit 0"
# Or run some commands after the git tag and the branch
# have been pushed:
# [[after_push]]
# name = "publish"
# cmd = "./publish.sh"