Add twine-venv target in /tmp for PyPI uploads

Uses a persistent virtualenv in /tmp/twine-venv to avoid
relying on system python/twine in CI.
This commit is contained in:
Russell Ballestrini 2025-12-29 09:35:08 -05:00
parent 00edd84398
commit 9936b21467
2 changed files with 20 additions and 4 deletions

View file

@ -64,7 +64,4 @@ pypi-twine:
only:
- tags
script:
#- pip install --upgrade pip
#- pip install twine
- python3 setup.py sdist bdist_wheel
- twine upload dist/*
- make twine-upload

View file

@ -124,6 +124,25 @@ http: venv
@echo "Starting simple HTTP server on port 8000..."
$(PYTHON) -m http.server 8000
# -----------------------------------------------------------------------------
# Twine Upload Target (uses /tmp venv to avoid system python)
# -----------------------------------------------------------------------------
TWINE_VENV = /tmp/twine-venv
TWINE = $(TWINE_VENV)/bin/twine
$(TWINE_VENV)/bin/twine:
@echo "Creating twine virtualenv in $(TWINE_VENV)..."
python3 -m venv $(TWINE_VENV)
$(TWINE_VENV)/bin/pip install --upgrade pip twine
twine-venv: $(TWINE_VENV)/bin/twine
twine-upload: twine-venv
@echo "Building and uploading to PyPI..."
python3 setup.py sdist bdist_wheel
$(TWINE) upload dist/*
# -----------------------------------------------------------------------------
# Cleanup Target
# -----------------------------------------------------------------------------