Skip to content

Commit

Permalink
Switch to twine to publish Python packages on PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
nitmir committed Jul 26, 2023
1 parent f0978cd commit 38b397b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.PHONY: clean build install dist uninstall
VERSION=`python3 setup.py -V`

WHL_FILES := $(wildcard dist/*.whl)
WHL_ASC := $(WHL_FILES:=.asc)
DIST_FILE := $(wildcard dist/*.tar.gz)
DIST_ASC := $(DIST_FILE:=.asc)

build:
python3 setup.py build

Expand Down Expand Up @@ -47,9 +52,6 @@ man_files:
dist:
python3 setup.py sdist

publish_pypi_release:
python setup.py sdist upload --sign

test_venv/bin/python:
python3 -m venv test_venv
test_venv/bin/pip3 install -U -r requirements-dev.txt
Expand All @@ -61,3 +63,14 @@ coverage: clean_coverage test_venv
export PATH=test_venv/bin/:$$PATH; echo $$PATH; pytest
test_venv/bin/coverage html
test_venv/bin/coverage report

sign_release: $(WHL_ASC) $(DIST_ASC)

dist/%.asc:
gpg --detach-sign -a $(@:.asc=)

test_venv/bin/twine: test_venv
test_venv/bin/pip install twine

publish_pypi_release: test_venv test_venv/bin/twine dist sign_release
test_venv/bin/twine upload --sign dist/*

0 comments on commit 38b397b

Please sign in to comment.