Skip to content

Commit 2c8a08f

Browse files
adapt release actions to pyproject.toml
1 parent 5d711a2 commit 2c8a08f

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

.github/scripts/prepare_release.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
The following preparation steps are executed:
55
6-
- update version numbers in _version.py and setup.py
6+
- update version numbers in _version.py and pyproject.toml
77
- purge the "Unreleased" section of CHANGELOG.md and rename it to the new version number
88
99
All changes are immediately commited to the repository.
@@ -117,10 +117,10 @@ def update_version(nvn):
117117
return update_file(file_with_version, regex, nvn)
118118

119119

120-
def update_setup(new_version_number):
121-
"""Update the setup.py file"""
122-
file_with_version = "setup.py"
123-
regex = r"(^\s+version\s*=\s*[\'\"]).*([\'\"]\s*,\s*$)"
120+
def update_pyproject(new_version_number):
121+
"""Update the pyproject.toml file"""
122+
file_with_version = "pyproject.toml"
123+
regex = r"(^version\s*=\s*[\'\"]).*([\'\"]\s*$)"
124124
return update_file(file_with_version, regex, new_version_number)
125125

126126

@@ -211,7 +211,7 @@ def prepare_new_release(level):
211211
raise
212212
new_version_number = bump_version_number(last_version_number, level)
213213

214-
update_setup(new_version_number).gitadd()
214+
update_pyproject(new_version_number).gitadd()
215215
update_version(new_version_number).gitadd()
216216
update_changelog(new_version_number).gitadd()
217217

.github/scripts/setup_devbranch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
The following preparation steps are executed:
55
6-
- update version numbers in _version.py and setup.py: append a -dev suffix
6+
- update version numbers in _version.py and pyproject.toml: append a -dev suffix
77
- insert a vanilla "unreleased" section on top of CHANGELOG.md
88
99
The changes are not commited to the repository. This is dealt with in the bash script
@@ -75,10 +75,10 @@ def update_version(nvn):
7575
return update_file(file_with_version, regex, nvn)
7676

7777

78-
def update_setup(new_version_number):
79-
"""Update the setup.py file"""
80-
file_with_version = "setup.py"
81-
regex = r"(^\s+version\s*=\s*[\'\"]).*([\'\"]\s*,\s*$)"
78+
def update_pyproject(new_version_number):
79+
"""Update the pyproject.toml file"""
80+
file_with_version = "pyproject.toml"
81+
regex = r"(^version\s*=\s*[\'\"]).*([\'\"]\s*$)"
8282
return update_file(file_with_version, regex, new_version_number)
8383

8484

@@ -110,7 +110,7 @@ def setup_devbranch():
110110
semver[-1] = f"{int(semver[-1]) + 1}-dev"
111111
dev_version = ".".join(semver)
112112

113-
update_setup(dev_version)
113+
update_pyproject(dev_version)
114114
update_version(dev_version)
115115
update_changelog()
116116

.github/scripts/setup_devbranch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ git checkout develop
1010
git pull
1111

1212
git checkout origin/main \
13-
setup.py \
13+
pyproject.toml \
1414
CHANGELOG.md \
1515
*/_version.py
1616

1717
release=`python .github/scripts/setup_devbranch.py`
1818

1919
git add \
20-
setup.py \
20+
pyproject.toml \
2121
CHANGELOG.md \
2222
*/_version.py
2323

.github/workflows/make-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will create a new release from main
22

33
# the new version number is the old one increased by 1 in the given level [major, minor, patch]
4-
# first, some files are modified (_version.py, setup.py and CHANGELOG.md
4+
# first, some files are modified (_version.py, pyproject.toml and CHANGELOG.md
55
# then, a new release is created on GitHub, tagged with v[new version number]
66

77
name: Create a new release

.github/workflows/postrelease-setup-devbranch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow will re-initialize the develop branch after a release was published
22

3-
# the version number of setup.py and _version.py will be taken from main, but have a "-dev" appendix
3+
# the version number of pyproject.toml and _version.py will be taken from main, but have a "-dev" appendix
44
# the CHANGELOG.md file will be updated and have a vanila "Unreleased" section
55

66
name: Post-release develop setup

0 commit comments

Comments
 (0)