Skip to content

Commit

Permalink
Packaging: Migrate build recipe to poethepoet definition
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed May 17, 2023
1 parent 399ba03 commit a8ce8a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
17 changes: 3 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test-coverage: install-tests
# ----------------------
# Linting and Formatting
# ----------------------
format: install-releasetools
format: install-tests
$(poe) format


Expand All @@ -53,7 +53,8 @@ format: install-releasetools
# -------

# Release this piece of software
release: push build pypi-upload
release:
poe release


# -------------
Expand All @@ -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
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*" },
]
2 changes: 1 addition & 1 deletion requirements-release.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
twine
keyring
twine

0 comments on commit a8ce8a9

Please sign in to comment.