From a5f9c31fb53d35cc46fd50b200e9f74cfb7479ae Mon Sep 17 00:00:00 2001 From: ol-iver Date: Thu, 16 Mar 2023 01:35:55 +0100 Subject: [PATCH] Verify version with pyproject.toml --- .github/workflows/python-publish-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index d302ecf..7d67841 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -21,12 +21,12 @@ jobs: - name: Verify version run: | python -m pip install setuptools - setup_version="$(python setup.py -V)" + setup_version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')" branch_version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}' ) if [ "${setup_version}" == "${branch_version}" ]; then - echo "Version of tag ${branch_version} matches with version of setup.py ${setup_version}" + echo "Version of tag ${branch_version} matches with version of pyproject.toml ${setup_version}" else - echo "Version of tag ${branch_version} doesn't match with version of setup.py ${setup_version}" + echo "Version of tag ${branch_version} doesn't match with version of pyproject.toml ${setup_version}" exit 1 fi - name: Install dependencies