Skip to content

Commit e1c257b

Browse files
committed
Run a script to install pre-release versions of eth libs
1 parent ef5db9a commit e1c257b

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ common: &common
3333
command: |
3434
python -m pip install --upgrade pip
3535
python -m pip install tox
36+
python web3/scripts/install_pre_releases.py
3637
- run:
3738
name: run tox
3839
command: python -m tox run -r

newsfragments/3452.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor and DRY up CI run setup and reduce surface area for errors. Include pre-releases in CI runs for internally maintained libraries to try and catch any conflicts.

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"towncrier>=21,<22",
2929
],
3030
"test": [
31+
# Note: ethereum-maintained libraries in this list should be added to the
32+
# `install_pre_releases.py` script.
3133
"eth-tester[py-evm]>=0.11.0b1,<0.13.0b1",
3234
"py-geth>=5.0.0",
3335
"pytest-asyncio>=0.18.1,<0.23",
@@ -58,13 +60,15 @@
5860
url="https://github.com/ethereum/web3.py",
5961
include_package_data=True,
6062
install_requires=[
61-
"aiohttp>=3.7.4.post0",
63+
# Note: ethereum-maintained libraries in this list should be added to the
64+
# `install_pre_releases.py` script.
6265
"eth-abi>=5.0.1",
6366
"eth-account>=0.13.1",
6467
"eth-hash[pycryptodome]>=0.5.1",
6568
"eth-typing>=5.0.0",
6669
"eth-utils>=5.0.0",
6770
"hexbytes>=1.2.0",
71+
"aiohttp>=3.7.4.post0",
6872
"pydantic>=2.4.0",
6973
"pywin32>=223;platform_system=='Windows'",
7074
"requests>=2.23.0",

web3/scripts/install_pre_releases.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
The goal of this script is to install the latest versions, including pre-releases, for
3+
libraries that we maintain (and therefore control the release process) during our CI
4+
runs. This helps us test pre-releases before they cause any issues once stable versions
5+
are released.
6+
"""
7+
8+
import subprocess
9+
import sys
10+
11+
ETHEREUM_LIBRARIES = [
12+
"eth-account",
13+
"eth-abi",
14+
"eth-account",
15+
"eth-hash[pycryptodome]",
16+
"eth-typing",
17+
"eth-utils",
18+
"hexbytes",
19+
"eth-tester[py-evm]",
20+
"py-geth",
21+
]
22+
23+
24+
def install_eth_pre_releases() -> None:
25+
for lib in ETHEREUM_LIBRARIES:
26+
print(f"Installing {lib} with `--pre` and `-U`")
27+
subprocess.check_call(
28+
[sys.executable, "-m", "pip", "install", "--pre", "-U", lib]
29+
)
30+
31+
32+
if __name__ == "__main__":
33+
install_eth_pre_releases()

0 commit comments

Comments
 (0)