From a3dae4dc21738e5e5fc8dafb3060c15f368b920e Mon Sep 17 00:00:00 2001 From: relikd Date: Fri, 25 Mar 2022 17:28:11 +0100 Subject: [PATCH] add pypi distribution script --- .gitignore | 25 +++++++++++++++++++++++++ Makefile | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0817f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +.DS_Store +/dist-env/ + +__pycache__/ +*.py[cod] + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3dea4e5 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +.PHONY: help +help: + @echo 'commands:' + @echo ' dist' + +dist-env: + @echo Creating virtual environment... + @python3 -m venv 'dist-env' + @source dist-env/bin/activate && pip install twine + +.PHONY: dist +dist: dist-env + [ -z "$${VIRTUAL_ENV}" ] # you can not do this inside a virtual environment. + rm -rf dist + @echo Building... + python3 setup.py sdist bdist_wheel + @echo + rm -rf ./*.egg-info/ ./build/ MANIFEST + @echo Publishing... + @echo "\033[0;31mEnter your PyPI token:\033[0m" + @source dist-env/bin/activate && export TWINE_USERNAME='__token__' && twine upload dist/*