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