From a8ce8a99869af8d74d0ec724d669497938bdf21f Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 18 May 2023 01:12:38 +0200 Subject: [PATCH] Packaging: Migrate build recipe to `poethepoet` definition --- Makefile | 17 +++-------------- pyproject.toml | 11 +++++++++++ requirements-release.txt | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 7601b608..b1267e5e 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ test-coverage: install-tests # ---------------------- # Linting and Formatting # ---------------------- -format: install-releasetools +format: install-tests $(poe) format @@ -53,7 +53,8 @@ format: install-releasetools # ------- # Release this piece of software -release: push build pypi-upload +release: + poe release # ------------- @@ -74,22 +75,10 @@ docs-autobuild: install-doctools # =============== # Utility targets # =============== -push: - git push && git push --tags - -build: install-releasetools - @$(python) -m build - -pypi-upload: install-releasetools - $(twine) upload --skip-existing --verbose dist/*{.tar.gz,.whl} - install-doctools: @test -e $(python) || python3 -m venv $(venvpath) $(pip) install --quiet --upgrade --requirement=docs/requirements.txt -install-releasetools: setup-virtualenv - @$(pip) install --requirement requirements-release.txt --upgrade - install-tests: setup-virtualenv @test -e $(pytest) || $(pip) install --editable=.[test,develop] --upgrade @touch $(venvpath)/bin/activate diff --git a/pyproject.toml b/pyproject.toml index 6b3a9df6..7e4b18c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,3 +128,14 @@ test = [ ] build = {cmd="python -m build"} check = ["lint", "test"] +release = [ + { cmd = "pip install --upgrade --editable=.[develop]" }, + { cmd = "pip install --upgrade --requirement requirements-release.txt" }, + # TODO: Add a basic bump step, which only runs the `git tag` and `git push` commands, + # but offers a convenience option to bump by "patch", "minor", or "major" levels. + # TODO: Remind user about updating the changelog file accordingly. Or use `towncrier`? + { cmd = "git push" }, + { cmd = "git push --tags" }, + { cmd = "python -m build" }, + { cmd = "twine upload --skip-existing --verbose dist/*" }, +] diff --git a/requirements-release.txt b/requirements-release.txt index 1feb8e8b..14b79619 100644 --- a/requirements-release.txt +++ b/requirements-release.txt @@ -1,2 +1,2 @@ -twine keyring +twine