Skip to content

Commit 3d7c79b

Browse files
committed
cd
1 parent f03bb74 commit 3d7c79b

3 files changed

Lines changed: 19 additions & 30 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
name: Publish to PyPI / TestPyPI
1+
name: Publish to PyPI
22

33
on:
44
push:
55
branches:
66
- main
7-
- dev
87

98
jobs:
109
build:
@@ -22,25 +21,6 @@ jobs:
2221
python -m pip install --upgrade pip
2322
pip install build
2423
25-
# Bump version for main (PyPI)
26-
- name: Bump patch version for PyPI
27-
if: github.ref == 'refs/heads/main'
28-
run: python scripts/bump_version.py
29-
30-
# Set dev version for TestPyPI
31-
- name: Set dev version for TestPyPI
32-
if: github.ref == 'refs/heads/dev'
33-
run: |
34-
BASE_VERSION=$(grep -oP "__version__ = '\K[^']+" src/PTLF/_version.py)
35-
DATE=$(date +%Y%m%d%H%M%S%N)
36-
GIT_HASH=$(git rev-parse --short HEAD)
37-
DEV_VERSION="${BASE_VERSION}.dev${DATE}"
38-
echo "__version__ = '${DEV_VERSION}'" > src/PTLF/_version.py
39-
echo "✅ Set dev version: $DEV_VERSION"
40-
41-
# Show current version file for debugging
42-
- name: Show current version
43-
run: cat src/PTLF/_version.py
4424
4525
# Clean old builds before build
4626
- name: Clean old builds
@@ -77,12 +57,7 @@ jobs:
7757
env:
7858
TWINE_USERNAME: __token__
7959
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
80-
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
8160
run: |
82-
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
83-
echo "🚀 Publishing to PyPI"
84-
twine upload --verbose -u __token__ -p "$PYPI_TOKEN" dist/*
85-
elif [ "${GITHUB_REF}" = "refs/heads/dev" ]; then
86-
echo "🧪 Publishing to TestPyPI"
87-
twine upload --verbose --repository-url https://test.pypi.org/legacy/ -u __token__ -p "$TEST_PYPI_TOKEN" dist/*
88-
fi
61+
echo "🚀 Publishing to PyPI"
62+
twine upload --verbose -u __token__ -p "$PYPI_TOKEN" dist/*
63+

setup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@
1515

1616
from setuptools import setup, find_packages
1717

18+
def get_version():
19+
version_file = os.path.join('src', 'plf', '_version.py')
20+
with open(version_file) as f:
21+
for line in f:
22+
if line.strip().startswith('__version__'):
23+
# Extract the version string between quotes
24+
parts = line.split('=', 1)
25+
if len(parts) == 2:
26+
version_str = parts[1].strip().strip('"\'')
27+
return version_str
28+
break
29+
raise RuntimeError("Unable to find version string in _version.py.")
30+
1831
setup(
1932
name='PyLabFlow',
20-
version='0.2.1',
33+
version=get_version(),
2134
package_dir={'': 'src'},
2235
packages=find_packages(where='src'),
2336
include_package_data=True,

src/plf/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.2.1.1"

0 commit comments

Comments
 (0)