@@ -5,87 +5,109 @@ CURRENT_SIGN_SETTING := $(shell git config commit.gpgSign)
5
5
help :
6
6
@echo " clean-build - remove build artifacts"
7
7
@echo " clean-pyc - remove Python file artifacts"
8
+ @echo " clean - run clean-build and clean-pyc"
9
+ @echo " dist - build package and cat contents of the dist directory"
8
10
@echo " lint - fix linting issues with pre-commit"
9
11
@echo " test - run tests quickly with the default Python"
10
12
@echo " docs - generate docs and open in browser (linux-docs for version on linux)"
11
- @echo " notes - consume towncrier newsfragments/ and update release notes in docs/"
12
- @echo " release - package and upload a release (does not run notes target)"
13
- @echo " dist - package"
14
-
15
- clean : clean-build clean-pyc
13
+ @echo " autobuild-docs - live update docs when changes are saved"
14
+ @echo " package-test - build package and install it in a venv for manual testing"
15
+ @echo " notes - consume towncrier newsfragments and update release notes in docs - requires bump to be set"
16
+ @echo " release - package and upload a release (does not run notes target) - requires bump to be set"
16
17
17
18
clean-build :
18
19
rm -fr build/
19
20
rm -fr dist/
21
+ rm -fr * .egg-info
20
22
21
23
clean-pyc :
22
24
find . -name ' *.pyc' -exec rm -f {} +
23
25
find . -name ' *.pyo' -exec rm -f {} +
24
26
find . -name ' *~' -exec rm -f {} +
25
27
find . -name ' __pycache__' -exec rm -rf {} +
26
28
29
+ clean : clean-build clean-pyc
30
+
31
+ dist : clean
32
+ python -m build
33
+ ls -l dist
34
+
27
35
lint :
28
36
@pre-commit run --all-files --show-diff-on-failure || ( \
29
37
echo " \n\n\n * pre-commit should have fixed the errors above. Running again to make sure everything is good..." \
30
38
&& pre-commit run --all-files --show-diff-on-failure \
31
39
)
32
40
33
41
test :
34
- pytest tests
42
+ python -m pytest tests
35
43
36
- build-docs :
37
- sphinx-apidoc -o docs/ . setup.py " *conftest*"
38
- $(MAKE ) -C docs clean
39
- $(MAKE ) -C docs html
40
- $(MAKE ) -C docs doctest
44
+ # docs commands
41
45
42
- build-docs-ci :
43
- $(MAKE ) -C docs latexpdf
44
- $(MAKE ) -C docs epub
46
+ docs : check-docs
47
+ open docs/_build/html/index.html
48
+
49
+ linux-docs : check-docs
50
+ xdg-open docs/_build/html/index.html
51
+
52
+ autobuild-docs :
53
+ sphinx-autobuild --open-browser docs docs/_build/html
54
+
55
+ # docs helpers
45
56
46
57
validate-newsfragments :
47
58
python ./newsfragments/validate_files.py
48
59
towncrier build --draft --version preview
49
60
50
61
check-docs : build-docs validate-newsfragments
51
62
63
+ build-docs :
64
+ sphinx-apidoc -o docs/ . setup.py " *conftest*"
65
+ $(MAKE ) -C docs clean
66
+ $(MAKE ) -C docs html
67
+ $(MAKE ) -C docs doctest
68
+
52
69
check-docs-ci : build-docs build-docs-ci validate-newsfragments
53
70
54
- docs : check-docs
55
- open docs/_build/html/index.html
71
+ build-docs-ci :
72
+ $(MAKE ) -C docs latexpdf
73
+ $(MAKE ) -C docs epub
56
74
57
- linux-docs : check-docs
58
- xdg-open docs/_build/html/index.html
75
+ # release commands
59
76
60
- check-bump :
61
- ifndef bump
62
- $(error bump must be set, typically: major, minor, patch, or devnum)
63
- endif
77
+ package-test : clean
78
+ python -m build
79
+ python scripts/release/test_package.py
64
80
65
- notes : check-bump validate-newsfragments
81
+ notes : check-bump
66
82
# Let UPCOMING_VERSION be the version that is used for the current bump
67
- $(eval UPCOMING_VERSION=$(shell bumpversion $( bump ) --dry-run --list | grep new_version= | sed 's/new_version=//g ') )
83
+ $(eval UPCOMING_VERSION=$(shell bump-my-version bump --dry-run $( bump ) -v | awk -F"'" '/New version will be / {print $$2} ') )
68
84
# Now generate the release notes to have them included in the release commit
69
85
towncrier build --yes --version $(UPCOMING_VERSION )
70
86
# Before we bump the version, make sure that the towncrier-generated docs will build
71
87
make build-docs
72
88
git commit -m " Compile release notes for v$( UPCOMING_VERSION) "
73
89
74
- release : check-bump clean
75
- # require that upstream is configured for ethereum/eth-typing
76
- @git remote -v
| grep
" upstream[[:space:]][email protected] :ethereum/eth-typing.git (push)\|upstream[[:space:]]https://github.com/ethereum/eth-typing (push)"
77
- # verify that docs build correctly
90
+ release : check-bump check-git clean
91
+ # verify that notes command ran correctly
78
92
./newsfragments/validate_files.py is-empty
79
- make build-docs
80
93
CURRENT_SIGN_SETTING=$(git config commit.gpgSign )
81
94
git config commit.gpgSign true
82
- bumpversion $(bump )
95
+ bump-my-version bump $(bump )
83
96
python -m build
97
+ git config commit.gpgSign " $( CURRENT_SIGN_SETTING) "
84
98
git push upstream && git push upstream --tags
85
99
twine upload dist/*
86
- git config commit.gpgSign " $( CURRENT_SIGN_SETTING) "
87
100
101
+ # release helpers
88
102
89
- dist : clean
90
- python -m build
91
- ls -l dist
103
+ check-bump :
104
+ ifndef bump
105
+ $(error bump must be set, typically: major, minor, patch, or devnum)
106
+ endif
107
+
108
+ check-git :
109
+ # require that upstream is configured for ethereum/<REPO_NAME>
110
+ @if
! git remote -v
| grep
" upstream[[:space:]][email protected] :ethereum/<REPO_NAME>.git (push)\|upstream[[:space:]]https://github.com/ethereum/<REPO_NAME> (push)" ; then \
111
+ echo " Error: You must have a remote named 'upstream' that points to '<REPO_NAME>'" ; \
112
+ exit 1; \
113
+ fi
0 commit comments