Skip to content

Commit b177f97

Browse files
committed
Use python -m build; do not invoke setup.py directly
- use ``python -m build`` instead of invoking ``setup.py`` directly as the latter is strongly discouraged. - invoke ``tox`` correctly for windows circleci job. - consolidate commands in ``tox.ini`` - use circleci orb [email protected] which uses python 3.10 + update the python path in config.yml to reflect this
1 parent a2ecdc3 commit b177f97

File tree

5 files changed

+23
-51
lines changed

5 files changed

+23
-51
lines changed

.circleci/config.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ ethpm_steps: &ethpm_steps
179179
key: ethpm-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
180180

181181
orbs:
182-
win: circleci/windows@2.2.0
182+
win: circleci/windows@5.0.0
183183

184184
windows_steps: &windows_steps
185185
executor:
@@ -199,7 +199,7 @@ windows_steps: &windows_steps
199199
command: pip install --user tox
200200
- run:
201201
name: run tox
202-
command: 'C:/Users/circleci/AppData/Roaming/Python/Python37/Scripts/tox.exe -r'
202+
command: 'C:/Users/circleci.PACKER-633B1A5A/AppData/Roaming/Python/Python310/Scripts/tox.exe -r'
203203
- save_cache:
204204
paths:
205205
- .tox
@@ -312,11 +312,6 @@ jobs:
312312
environment:
313313
TOXENV: py37-wheel-cli
314314

315-
py37-wheel-cli-windows:
316-
<<: *windows_steps
317-
environment:
318-
TOXENV: py37-wheel-cli-windows
319-
320315
#
321316
# Python 3.8
322317
#
@@ -629,6 +624,11 @@ jobs:
629624
environment:
630625
TOXENV: py310-wheel-cli
631626

627+
py310-wheel-cli-windows:
628+
<<: *windows_steps
629+
environment:
630+
TOXENV: py310-wheel-cli-windows
631+
632632
#
633633
# Python 3.11
634634
#
@@ -764,7 +764,6 @@ workflows:
764764
- py37-integration-goethereum-ws_flaky
765765
- py37-integration-ethtester-pyevm
766766
- py37-wheel-cli
767-
- py37-wheel-cli-windows
768767
- py38-lint
769768
- py38-ens
770769
- py38-ethpm
@@ -801,6 +800,7 @@ workflows:
801800
- py310-integration-goethereum-ws_flaky
802801
- py310-integration-ethtester-pyevm
803802
- py310-wheel-cli
803+
- py310-wheel-cli-windows
804804
- py311-lint
805805
- py311-ens
806806
- py311-ethpm

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ release: clean
7272
git config commit.gpgSign true
7373
bumpversion $(bump)
7474
git push upstream && git push upstream --tags
75-
python setup.py sdist bdist_wheel
75+
python -m build
7676
twine upload dist/*
7777
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"
7878

7979
dist: clean
80-
python setup.py sdist bdist_wheel
80+
python -m build
8181
ls -l dist
8282

8383
package: clean
84-
python setup.py sdist bdist_wheel
84+
python -m build
8585
python web3/scripts/release/test_package.py

newsfragments/2714.internal.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not invoke ``setup.py`` directly; use ``python -m build`` where appropriate.

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"twine>=1.13",
5151
"pluggy==0.13.1",
5252
"when-changed>=0.3.0",
53+
"build>=0.9.0",
5354
],
5455
"ipfs": [
5556
"ipfshttpclient==0.8.0a2",

tox.ini

+10-40
Original file line numberDiff line numberDiff line change
@@ -72,60 +72,30 @@ commands=
7272
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 50
7373
python {toxinidir}/web3/tools/benchmark/main.py --num-calls 100
7474

75-
[common-wheel-cli]
76-
deps=wheel
75+
[testenv:py{37,38,39,310,311}-wheel-cli]
76+
deps=
77+
wheel
78+
build
7779
allowlist_externals=
7880
/bin/rm
7981
/bin/bash
8082
commands=
8183
pip install --upgrade pip
8284
/bin/rm -rf build dist
83-
python setup.py sdist bdist_wheel
85+
python -m build
8486
/bin/bash -c 'pip install --upgrade "$(ls dist/web3-*-py3-none-any.whl)" --progress-bar off'
8587
python -c "from web3 import Web3"
86-
87-
[testenv:py37-wheel-cli]
88-
deps={[common-wheel-cli]deps}
89-
allowlist_externals={[common-wheel-cli]allowlist_externals}
90-
commands={[common-wheel-cli]commands}
91-
skip_install=true
92-
93-
[testenv:py38-wheel-cli]
94-
deps={[common-wheel-cli]deps}
95-
allowlist_externals={[common-wheel-cli]allowlist_externals}
96-
commands={[common-wheel-cli]commands}
97-
skip_install=true
98-
99-
[testenv:py39-wheel-cli]
100-
deps={[common-wheel-cli]deps}
101-
allowlist_externals={[common-wheel-cli]allowlist_externals}
102-
commands={[common-wheel-cli]commands}
10388
skip_install=true
10489

105-
[testenv:py310-wheel-cli]
106-
deps={[common-wheel-cli]deps}
107-
allowlist_externals={[common-wheel-cli]allowlist_externals}
108-
commands={[common-wheel-cli]commands}
109-
skip_install=true
110-
111-
[testenv:py311-wheel-cli]
112-
deps={[common-wheel-cli]deps}
113-
allowlist_externals={[common-wheel-cli]allowlist_externals}
114-
commands={[common-wheel-cli]commands}
115-
skip_install=true
116-
117-
[common-wheel-cli-windows]
118-
deps=wheel
90+
[testenv:py310-wheel-cli-windows]
91+
deps=
92+
wheel
93+
build[virtualenv]
11994
allowlist_externals=
12095
bash.exe
12196
commands=
12297
bash.exe -c "rm -rf build dist"
123-
python setup.py sdist bdist_wheel
98+
python -m build
12499
bash.exe -c 'pip install --upgrade "$(ls dist/web3-*-py3-none-any.whl)" --progress-bar off'
125100
python -c "from web3 import Web3"
126-
127-
[testenv:py37-wheel-cli-windows]
128-
deps={[common-wheel-cli]deps}
129-
allowlist_externals={[common-wheel-cli-windows]allowlist_externals}
130-
commands={[common-wheel-cli-windows]commands}
131101
skip_install=true

0 commit comments

Comments
 (0)