Skip to content

Commit 4eeadac

Browse files
committed
fix: update version extraction in publish workflow
- Replace Python import-based version extraction with grep/sed - Avoids ModuleNotFoundError when dependencies not yet installed - Fixes 'Bump version and create release' step failure - Uses simple text parsing instead of module import
1 parent 5192815 commit 4eeadac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
if: github.event_name == 'workflow_dispatch'
7373
id: create_release
7474
run: |
75-
# Get current version from __init__.py
76-
CURRENT_VERSION=$(python -c "import sys; sys.path.insert(0, 'src'); from apihub_client import __version__; print(__version__)")
75+
# Get current version from __init__.py using grep/sed (avoid importing)
76+
CURRENT_VERSION=$(grep -E "^__version__ = " src/apihub_client/__init__.py | sed -E 's/__version__ = "(.*)"/\1/')
7777
echo "Current version: $CURRENT_VERSION"
7878
7979
# Calculate new version based on input
@@ -141,7 +141,7 @@ jobs:
141141
# Verify the version was updated correctly
142142
- name: Verify version update
143143
run: |
144-
PACKAGE_VERSION=$(python -c "import sys; sys.path.insert(0, 'src'); from apihub_client import __version__; print(__version__)")
144+
PACKAGE_VERSION=$(grep -E "^__version__ = " src/apihub_client/__init__.py | sed -E 's/__version__ = "(.*)"/\1/')
145145
echo "Package version: $PACKAGE_VERSION"
146146
echo "Target version: ${{ steps.version.outputs.version }}"
147147
if [ "$PACKAGE_VERSION" != "${{ steps.version.outputs.version }}" ]; then

0 commit comments

Comments
 (0)