Skip to content

Commit

Permalink
Makefile.pypi & twine
Browse files Browse the repository at this point in the history
  • Loading branch information
parmentelat committed Jun 4, 2021
1 parent 337b2fa commit 44c4c41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile.pypi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GIT-TAG-ALREADY-SET = $(shell git tag | grep '^$(VERSIONTAG)$$')
GIT-CHANGES = $(shell echo $$(git diff HEAD | wc -l))

# run this only once the sources are in on the right tag
pypi: cleanpypi
pypi: twine cleanpypi
@if [ $(GIT-CHANGES) != 0 ]; then echo "You have uncommitted changes - cannot publish"; false; fi
@if [ -n "$(GIT-TAG-ALREADY-SET)" ] ; then echo "tag $(VERSIONTAG) already set"; false; fi
@if ! grep -q ' $(VERSION)' CHANGELOG.md ; then echo no mention of $(VERSION) in CHANGELOG.md; false; fi
Expand All @@ -25,11 +25,14 @@ pypi: cleanpypi
./setup.py sdist bdist_wheel
twine upload dist/*

twine:
@type -p twine >& /dev/null || { echo ==== installing twine; pip install twine; }

testpypi: cleanpypi
./setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

cleanpypi:
rm -rf build dist

.PHONY: pypi testpypi cleanpypi
.PHONY: pypi testpypi cleanpypi twine

0 comments on commit 44c4c41

Please sign in to comment.