From 2a3b110d53146d86709a8e161d90e65d6a07f0fe Mon Sep 17 00:00:00 2001 From: meejah Date: Fri, 30 Sep 2022 16:48:23 -0600 Subject: [PATCH] simple build automation --- Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++++ 2 files changed, 48 insertions(+) diff --git a/Makefile b/Makefile index 5cbd863a3..6dd2b743b 100644 --- a/Makefile +++ b/Makefile @@ -224,3 +224,47 @@ src/allmydata/_version.py: .tox/create-venvs.log: tox.ini setup.py tox --notest -p all | tee -a "$(@)" + + +# Make a new release. TODO: +# - clean checkout necessary? garbage in tarball? +release: + @echo "Is checkout clean?" + git diff-files --quiet + git diff-index --quiet --cached HEAD -- + + @echo "Install required build software" + python3 -m pip install --editable .[build] + + @echo "Test README" + python3 setup.py check -r -s + + @echo "Update NEWS" + python3 -m towncrier build --yes --version `python3 misc/build_helpers/update-version.py --no-tag` + git add -u + git commit -m "update NEWS for release" + + @echo "Bump version and create tag" + python3 misc/build_helpers/update-version.py + + @echo "Build and sign wheel" + python3 setup.py bdist_wheel + gpg --pinentry=loopback -u meejah@meejah.ca --armor --detach-sign dist/tahoe_lafs-`git describe --abbrev=0`-py3-none-any.whl + ls dist/*`git describe --abbrev=0`* + + @echo "Build and sign source-dist" + python3 setup.py sdist + gpg --pinentry=loopback -u meejah@meejah.ca --armor --detach-sign dist/tahoe-lafs-`git describe --abbrev=0`.tar.gz + ls dist/*`git describe --abbrev=0`* + +release-test: + gpg --verify dist/tahoe-lafs-`git describe --abbrev=0`.tar.gz.asc + gpg --verify dist/tahoe_lafs-`git describe --abbrev=0`-py3-none-any.whl.asc + virtualenv testmf_venv + testmf_venv/bin/pip install dist/tahoe_lafs-`git describe --abbrev=0`-py3-none-any.whl + testmf_venv/bin/tahoe-lafs --version +# ... + rm -rf testmf_venv + +release-upload: + twine upload dist/tahoe_lafs-`git describe --abbrev=0`-py3-none-any.whl dist/tahoe_lafs-`git describe --abbrev=0`-py3-none-any.whl.asc dist/tahoe-lafs-`git describe --abbrev=0`.tar.gz dist/tahoe-lafs-`git describe --abbrev=0`.tar.gz.asc diff --git a/setup.py b/setup.py index d99831347..ffe23a7b5 100644 --- a/setup.py +++ b/setup.py @@ -380,6 +380,10 @@ setup(name="tahoe-lafs", # also set in __init__.py # https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2392 for some # discussion. ':sys_platform=="win32"': ["pywin32 != 226"], + "build": [ + "dulwich", + "gpg", + ], "test": [ "flake8", # Pin a specific pyflakes so we don't have different folks