diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 60336a2..e65ac01 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -110,7 +110,10 @@ jobs: id: app_version_bump run: | pip install pybump - echo "app_version=$(pybump bump --level patch --file pyproject.toml)" >> $GITHUB_OUTPUT + # Bump patch, then set commit SHA as metadata (+sha) for unique test.pypi.org versions + # Using --metadata flag for PEP 440 compatibility (+ instead of -) + pybump bump --level patch --file pyproject.toml + echo "app_version=$(pybump set --auto --metadata --file pyproject.toml)" >> $GITHUB_OUTPUT - name: Install uv uses: astral-sh/setup-uv@v5 with: diff --git a/pyproject.toml b/pyproject.toml index 7d96d26..2b10125 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ dependencies = {file = ["requirements.txt"]} [project] name = "pybump" -version = "1.13.2" +version = "1.14.0" dynamic = ["dependencies"] authors = [ diff --git a/src/pybump.py b/src/pybump.py index c06809c..4cc4d39 100644 --- a/src/pybump.py +++ b/src/pybump.py @@ -10,7 +10,17 @@ except ImportError: from pybump_version import PybumpVersion -regex_version_pattern = re.compile(r"((?:__)?version(?:__)? ?= ?[\"'])(.+?)([\"'])") +# Regex to match version strings like: version = "1.0.0" or __version__ = '1.0.0' +# (?") + # test invalid version set test_set_auto = simulate_set_version("test/test_content_files/test_valid_setup.py", version='V123.x.4') self.assertEqual('Invalid semantic version format: V123.x.4\nMake sure to comply with https://semver.org/ '