chore: add bump python version tool

This commit is contained in:
jo 2022-04-14 11:01:35 +02:00 committed by Kyle Robbertze
parent 1b5ccd3f65
commit 0a6ed33d96
2 changed files with 25 additions and 1 deletions

View File

@ -18,8 +18,11 @@ shell-check:
VERSION: VERSION:
tools/version.sh tools/version.sh
bump-python-version: VERSION
tools/bump-python-version.sh
.PHONY: tarball .PHONY: tarball
tarball: VERSION tarball: VERSION bump-python-version
$(MAKE) -C legacy build $(MAKE) -C legacy build
cd .. && tar -czf libretime-$(shell cat VERSION | tr -d [:blank:]).tar.gz \ cd .. && tar -czf libretime-$(shell cat VERSION | tr -d [:blank:]).tar.gz \
--owner=root --group=root \ --owner=root --group=root \

21
tools/bump-python-version.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Bump the version in the setup.py files.
set -u
error() {
echo >&2 "error: $*"
exit 1
}
command -v sed > /dev/null || error "sed command not found!"
version="$(cat VERSION)"
for setup_path in */setup.py; do
sed --in-place \
"s/version=\".*\",/version=\"$version\",/" \
"$setup_path" ||
error "could not bump version for $setup_path!"
done