Skip to content

Commit abbdcdf

Browse files
committed
Add make target for making a PyPI release
1 parent a139a18 commit abbdcdf

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ Copy the documentation from `doc/_build/html` to a temporary directory, switch t
6565
Fedora builds are automated using Packit. After tagging a new release Packit will open PRs against all supported versions of Fedora in Pagure. Fedora maintainer will review and merge those PRs, afterwards, Packit will do the builds and Bodhi updates as well.
6666

6767
## PyPI Build Procedure
68-
Prepare archive for PyPI: `python3 setup.py sdist bdist_wheel`
6968

70-
Check the archive: `twine check dist/*`
71-
72-
Upload to Test PyPI (optional): `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
73-
74-
Upload to PyPI: `twine upload dist/*`
69+
```
70+
make release-pypi
71+
```

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ rpm: local
173173
rpmbuild -bb --nodeps $(SPECFILE) --define "_sourcedir `pwd`"
174174
rm -f $(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)-tests.tar.gz
175175

176+
release-pypi:
177+
if ! $(PYTHON) -m build --sdist --wheel; then \
178+
echo ""; \
179+
echo Distribution package build failed! Please verify that you have \'python3-build\' and \'python3-setuptools\' installed. >&2; \
180+
exit 1; \
181+
fi
182+
if ! $(PYTHON) -m twine upload dist/*; then \
183+
echo ""; \
184+
echo Package upload failed! Make sure the \'twine tool\' is installed and you are registered >&2; \
185+
exit 1; \
186+
fi
187+
176188
ci: check coverage
177189

178190
.PHONY: check clean pylint pep8 install tag archive local

0 commit comments

Comments
 (0)