Skip to content

Commit 6064d9c

Browse files
authored
Merge pull request #81 from DataFog/chore/pypi
fixed pypi
2 parents f178871 + 02f1365 commit 6064d9c

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.github/workflows/publish-pypi.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,34 @@ jobs:
8383
id: beta_version
8484
run: |
8585
# Read current version from setup.py
86-
CURRENT_VERSION=$(grep -o '__version__ = "[^"]*"' setup.py | cut -d"" -f2)
86+
CURRENT_VERSION=$(grep -o '__version__ = "[^"]*"' setup.py | sed 's/__version__ = "\(.*\)"/\1/')
8787
echo "Current version in files: $CURRENT_VERSION"
8888
8989
# Split version into components
90-
IFS='.' read -r MAJOR MINOR PATCH_FULL <<< "$CURRENT_VERSION"
90+
IFS='.' read -r MAJOR MINOR PATCH_FULL <<< "$CURRENT_VERSION" || true
91+
92+
# Validate we got valid version components
93+
if [[ -z "$MAJOR" || -z "$MINOR" || -z "$PATCH_FULL" ]]; then
94+
echo "Error: Could not parse version components from $CURRENT_VERSION"
95+
echo "Using default version 0.0.1b1"
96+
MAJOR=0
97+
MINOR=0
98+
PATCH_FULL=1
99+
fi
91100
92101
# Handle beta suffix if it exists
93102
if [[ $PATCH_FULL == *b* ]]; then
94103
# Extract the numeric part before 'b'
95104
PATCH_NUM=${PATCH_FULL%%b*}
96105
# Extract the beta number and increment it
97106
BETA_NUM=${PATCH_FULL#*b}
98-
BETA_NUM=$((BETA_NUM + 1))
107+
# Ensure beta number is a valid integer
108+
if ! [[ $BETA_NUM =~ ^[0-9]+$ ]]; then
109+
echo "Warning: Invalid beta number format. Resetting to beta1."
110+
BETA_NUM=1
111+
else
112+
BETA_NUM=$((BETA_NUM + 1))
113+
fi
99114
else
100115
# If not already a beta, use the patch number and start with beta1
101116
PATCH_NUM=$PATCH_FULL

datafog/__about__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.1.0b4"
1+
__version__ = "4.1.0b5"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
long_description = f.read()
66

77
# Use a single source of truth for the version
8-
__version__ = "4.1.0b4"
8+
__version__ = "4.1.0b5"
99

1010
project_urls = {
1111
"Homepage": "https://datafog.ai",

0 commit comments

Comments
 (0)