|
11 | 11 | export BROWSER_PYSCRIPT
|
12 | 12 | BROWSER := python -c "$$BROWSER_PYSCRIPT"
|
13 | 13 |
|
14 |
| -help: |
15 |
| - @echo "clean - remove all build, test, coverage and Python artifacts" |
16 |
| - @echo "clean-build - remove build artifacts" |
17 |
| - @echo "clean-pyc - remove Python file artifacts" |
18 |
| - @echo "clean-test - remove test and coverage artifacts" |
19 |
| - @echo "lint - check style with ruff" |
20 |
| - @echo "test - run tests quickly with the default Python" |
21 |
| - @echo "test-all - run tests on every Python version with tox" |
22 |
| - @echo "coverage - check code coverage quickly with the default Python" |
23 |
| - @echo "docs - generate Sphinx HTML documentation, including API docs" |
24 |
| - @echo "release - package and upload a release" |
25 |
| - @echo "dist - package" |
26 |
| - @echo "install - install the package to the active Python's site-packages" |
27 |
| - |
28 | 14 | clean: clean-build clean-pyc clean-test
|
29 | 15 |
|
30 | 16 | clean-build:
|
@@ -81,24 +67,41 @@ docs:
|
81 | 67 | servedocs: docs
|
82 | 68 | watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
|
83 | 69 |
|
84 |
| -readme.html: README.rst |
85 |
| - rst2html.py README.rst > readme.html |
86 |
| - |
87 | 70 | .PHONY: authors
|
88 | 71 | authors:
|
89 | 72 | git shortlog --numbered --summary --email | cut -f 2 > AUTHORS
|
90 | 73 |
|
91 | 74 | dist: clean
|
92 |
| - python setup.py sdist |
93 |
| - python setup.py bdist_wheel |
| 75 | + python -m build |
| 76 | + ls -l dist |
94 | 77 |
|
95 | 78 | install: clean
|
96 | 79 | python setup.py install
|
97 | 80 |
|
98 |
| -bump: |
99 |
| - bumpversion --tag-name "{new_version}" patch |
100 |
| - |
101 |
| -deploy-prep: clean authors readme.html docs dist |
| 81 | +# build newsfragments into release notes and verify docs build correctly |
| 82 | +notes: check-bump validate-newsfragments |
| 83 | + # Let UPCOMING_VERSION be the version that is used for the current bump |
| 84 | + $(eval UPCOMING_VERSION=$(shell bump-my-version bump --dry-run $(bump) -v | awk -F"'" '/New version will be / {print $$2}')) |
| 85 | + # Now generate the release notes to have them included in the release commit |
| 86 | + towncrier build --yes --version $(UPCOMING_VERSION) |
| 87 | + # Before we bump the version, make sure that the towncrier-generated docs will build |
| 88 | + make docs |
| 89 | + git commit -m "Compile release notes for v$(UPCOMING_VERSION)" |
| 90 | + |
| 91 | +deploy-prep: clean authors docs dist |
102 | 92 | @echo "Did you remember to bump the version?"
|
103 | 93 | @echo "If not, run 'bumpversion {patch, minor, major}' and run this target again"
|
104 | 94 | @echo "Don't forget to update HISTORY.rst"
|
| 95 | + |
| 96 | +# helpers |
| 97 | + |
| 98 | +# verify that newsfragments are valid and towncrier can build them |
| 99 | +validate-newsfragments: |
| 100 | + python ./newsfragments/validate_files.py |
| 101 | + towncrier build --draft --version preview |
| 102 | + |
| 103 | +# verify that a bump argument is set to be passed to bump-my-version |
| 104 | +check-bump: |
| 105 | +ifndef bump |
| 106 | + $(error bump must be set, typically: major, minor, patch, or devnum) |
| 107 | +endif |
0 commit comments