diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b9247e..f00d6d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/Makefile b/Makefile index 5ddd7f0..5708859 100644 --- a/Makefile +++ b/Makefile @@ -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 # -----------------------------------------------------------------------------