Switch back to setup.cfg in release script

This commit is contained in:
ChillerDragon 2023-04-07 09:27:49 +02:00
parent 8d0725d527
commit a11a3cbb42

View file

@ -186,7 +186,7 @@ then
exit 1
fi
# Do not update pyproject.toml
# Do not update setup.cfg
# if the build fails anyways
if ! python -m build
then
@ -194,14 +194,14 @@ then
exit 1
fi
echo "[*] updating version in pyproject.toml ..."
echo "[*] updating version in setup.cfg ..."
# can safely be ran multiple times
sed -i "s/^version =.*/version = \"${tag_name:1}\"/" pyproject.toml
sed -i "s/^version =.*/version = ${tag_name:1}/" setup.cfg
echo "[*] wiping old dist ..."
[[ -d dist ]] && rm -rf dist
# Try build again after pyproject.toml update
# Try build again after setup.cfg update
if ! python -m build
then
echo "Error: build failed"
@ -260,16 +260,16 @@ cp dist/twnet_parser-"${tag_name:1}".tar.gz /tmp/twnet_parser_test/
echo "[*] venv tests passed."
if ! git add pyproject.toml
if ! git add setup.cfg
then
echo "Error: git add failed"
exit 1
fi
if [ "$(git diff HEAD --name-only)" != "pyproject.toml" ]
if [ "$(git diff HEAD --name-only)" != "setup.cfg" ]
then
echo "Error: unexpected files would be included in the commit"
git diff HEAD --name-only | grep -v '^pyproject.toml$' | awk '{ print " " $0 }'
git diff HEAD --name-only | grep -v '^setup.cfg$' | awk '{ print " " $0 }'
exit 1
fi