Skip to content

Commit 09612b5

Browse files
chore: use uv for package management (#777)
Co-authored-by: Mario Vega <[email protected]>
1 parent 3fc3792 commit 09612b5

File tree

16 files changed

+2311
-125
lines changed

16 files changed

+2311
-125
lines changed
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
name: Build and Package Fixtures
1+
name: Build and Package Fixture Release
22
inputs:
3-
name:
4-
description: 'Name of the fixture package'
3+
release_name:
4+
description: 'Name of the fixture release'
55
required: true
66
runs:
77
using: "composite"
88
steps:
9-
- name: Setup Python
10-
uses: actions/setup-python@v5
11-
with:
12-
python-version: 3.11
13-
- name: Install yq
9+
- name: Set up uv
10+
uses: ./.github/actions/setup-uv
11+
- name: Set up Python
12+
shell: bash
13+
run: uv python install 3.10 --no-progress
14+
- name: Install EEST
1415
shell: bash
15-
run: |
16-
pip install yq
17-
- name: Extract fixture properties
16+
run: uv sync --no-progress
17+
- name: Extract fixture release properties from config
1818
id: properties
1919
shell: bash
2020
run: |
21-
yq -r --arg feature "${{ inputs.name }}" '.[$feature] | to_entries | map("\(.key)=\(.value)")[]' ./.github/configs/feature.yaml >> "$GITHUB_OUTPUT"
21+
echo "release_name=${{ inputs.release_name }}"
22+
uv run -q .github/scripts/get_release_props.py ${{ inputs.release_name }} >> "$GITHUB_OUTPUT"
2223
- uses: ./.github/actions/build-evm-base
2324
id: evm-builder
2425
with:
2526
type: ${{ steps.properties.outputs.evm-type }}
26-
- name: Run fixtures fill
27+
- name: Generate fixtures using fill
2728
shell: bash
2829
run: |
29-
pip install --upgrade pip
30-
python -m venv env
31-
source env/bin/activate
32-
pip install -e .
33-
fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} --solc-version=${{ steps.properties.outputs.solc }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.name }}.tar.gz --build-name ${{ inputs.name }}
30+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} --solc-version=${{ steps.properties.outputs.solc }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }}
3431
- uses: actions/upload-artifact@v4
3532
with:
36-
name: fixtures_${{ inputs.name }}
37-
path: fixtures_${{ inputs.name }}.tar.gz
33+
name: fixtures_${{ inputs.release_name }}
34+
path: fixtures_${{ inputs.release_name }}.tar.gz
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Setup UV'
2+
description: 'Sets up uv with a fixed version'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install UV
7+
shell: bash
8+
run: |
9+
UV_VERSION="0.4.2"
10+
echo "Installing UV version $UV_VERSION..."
11+
curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# /// script
2+
# requires-python = ">=3.10"
3+
# dependencies = [
4+
# "pyyaml",
5+
# "click",
6+
# ]
7+
# ///
8+
9+
import sys
10+
11+
import click
12+
import yaml
13+
14+
RELEASE_PROPS_FILE = './.github/configs/feature.yaml'
15+
16+
17+
@click.command()
18+
@click.argument('release', required=True)
19+
def get_release_props(release):
20+
"""Extracts a specific property from the YAML file for a given release."""
21+
with open(RELEASE_PROPS_FILE) as f:
22+
data = yaml.safe_load(f)
23+
if release not in data:
24+
print(f"Error: Release {release} not found in {RELEASE_PROPS_FILE}.")
25+
sys.exit(1)
26+
print("\n".join(f"{key}={value}" for key, value in data[release].items()))
27+
28+
if __name__ == "__main__":
29+
get_release_props()

.github/workflows/coverage.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ jobs:
3131
echo $(pwd)
3232
echo ${{ github.workspace }}
3333
34-
#install pyspec deps from root repo
35-
python3 --version
36-
pip install --upgrade pip
37-
python3 -m venv ./venv/
38-
source ./venv/bin/activate
39-
pip install -e .
34+
- name: Set up uv
35+
uses: ./.github/actions/setup-uv
36+
37+
- name: Set up Python
38+
run: uv python install 3.10
39+
40+
- name: Install EEST
41+
run: |
42+
uv sync --no-progress
43+
uv run python --version
4044
4145
# Required to fill .py tests
4246
- name: Build GO EVM
@@ -116,7 +120,6 @@ jobs:
116120
exit 1
117121
fi
118122
done
119-
120123
121124
# This command diffs the .py scripts introduced by a PR
122125
- name: Parse and fill introduced test sources
@@ -151,8 +154,8 @@ jobs:
151154
mkdir -p fixtures/eof_tests
152155
echo "$files" | while read line; do
153156
file=$(echo "$line" | cut -c 3-)
154-
fill $file --until=Cancun --evm-bin evmone-t8n --solc-version=0.8.25 || true >> filloutput.log 2>&1
155-
(fill $file --fork=CancunEIP7692 --evm-bin evmone-t8n --solc-version=0.8.25 -k eof_test || true) > >(tee -a filloutput.log filloutputEOF.log) 2>&1
157+
uv run fill $file --until=Cancun --evm-bin evmone-t8n --solc-version=0.8.25 || true >> filloutput.log 2>&1
158+
(uv run fill $file --fork=CancunEIP7692 --evm-bin evmone-t8n --solc-version=0.8.25 -k eof_test || true) > >(tee -a filloutput.log filloutputEOF.log) 2>&1
156159
done
157160
158161
if grep -q "FAILURES" filloutput.log; then

.github/workflows/docs_main.yaml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,25 @@ on:
77

88
jobs:
99
deploy:
10-
if: github.repository_owner == 'ethereum' # don't run on forks
10+
if: github.repository_owner == 'ethereum' # don't run on forks
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: '3.11'
24-
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install -e .[docs]
29-
30-
- name: Setup doc deploy
31-
run: |
32-
git config --global user.name "github-actions[bot]"
33-
git config --global user.email github-actions[bot]@users.noreply.github.com
34-
35-
- name: Build and deploy docs to gh-pages
36-
run: |
37-
mike deploy --update-aliases --push --remote origin main development
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
19+
- name: Set up uv
20+
uses: ./.github/actions/setup-uv
21+
- name: Set up Python
22+
run: uv python install 3.11
23+
- name: Install EEST and dependencies
24+
run: uv sync --extra=docs --no-progress
25+
- name: Setup doc deploy
26+
run: |
27+
git config --global user.name "github-actions[bot]"
28+
git config --global user.email github-actions[bot]@users.noreply.github.com
29+
- name: Build and deploy docs to gh-pages
30+
run: |
31+
uv run mike deploy --update-aliases --push --remote origin main development

.github/workflows/docs_tags.yaml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,29 @@ name: Deploy Docs Tags
33
on:
44
push:
55
tags:
6-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10, v0.1.1a1
6+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10, v0.1.1a1
77

88
jobs:
99
deploy:
10-
if: github.repository_owner == 'ethereum' # don't run on forks
10+
if: github.repository_owner == 'ethereum' # don't run on forks
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: '3.11'
24-
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install -e .[docs]
29-
30-
- name: Setup doc deploy
31-
run: |
32-
git config --global user.name "github-actions[bot]"
33-
git config --global user.email github-actions[bot]@users.noreply.github.com
34-
35-
- name: Build and deploy docs to gh-pages
36-
run: |
37-
mike deploy --update-aliases --push --remote origin ${{ github.ref_name }} latest
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
ssh-key: ${{secrets.GH_ACTIONS_DEPLOY_KEY}}
19+
- name: Set up uv
20+
uses: ./.github/actions/setup-uv
21+
- name: Set up Python
22+
run: uv python install 3.11
23+
- name: Install EEST and dependencies
24+
run: uv sync --extra=docs --no-progress
25+
- name: Setup doc deploy
26+
run: |
27+
git config --global user.name "github-actions[bot]"
28+
git config --global user.email github-actions[bot]@users.noreply.github.com
29+
- name: Build and deploy docs to gh-pages
30+
run: |
31+
uv run mike deploy --update-aliases --push --remote origin ${{ github.ref_name }} latest

.github/workflows/fixtures.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Package Fixtures
33
on:
44
push:
55
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+*'
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
77
workflow_dispatch:
88

99
jobs:
@@ -30,7 +30,7 @@ jobs:
3030
submodules: true
3131
- uses: ./.github/actions/build-fixtures
3232
with:
33-
name: ${{ matrix.name }}
33+
release_name: ${{ matrix.name }}
3434
release:
3535
runs-on: ubuntu-latest
3636
needs: build
@@ -43,7 +43,7 @@ jobs:
4343
- name: Draft Release
4444
uses: softprops/action-gh-release@v2
4545
with:
46-
files: './**'
46+
files: "./**"
4747
draft: true
4848
generate_release_notes: true
49-
fail_on_unmatched_files: true
49+
fail_on_unmatched_files: true

.github/workflows/fixtures_feature.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Package Fixtures for a feature
33
on:
44
push:
55
tags:
6-
- '*@v*'
6+
- "*@v*"
77
workflow_dispatch:
88

99
jobs:
@@ -34,7 +34,7 @@ jobs:
3434
submodules: true
3535
- uses: ./.github/actions/build-fixtures
3636
with:
37-
name: ${{ matrix.feature }}
37+
release_name: ${{ matrix.feature }}
3838
release:
3939
runs-on: ubuntu-latest
4040
needs: build
@@ -47,8 +47,8 @@ jobs:
4747
- name: Draft Pre-release
4848
uses: softprops/action-gh-release@v2
4949
with:
50-
files: './**'
50+
files: "./**"
5151
draft: true
5252
prerelease: true
5353
generate_release_notes: true
54-
fail_on_unmatched_files: true
54+
fail_on_unmatched_files: true

.github/workflows/tox_verify.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
matrix:
1010
include:
1111
- os: ubuntu-latest
12-
python: '3.10'
13-
evm-type: 'stable'
14-
tox-cmd: 'tox run-parallel --parallel-no-spinner'
12+
python: "3.10"
13+
evm-type: "stable"
14+
tox-cmd: "tox" # run-parallel --parallel-no-spinner" # TODO: disable parallelisation for uv testing
1515
- os: ubuntu-latest
16-
python: '3.12'
17-
evm-type: 'stable'
18-
tox-cmd: 'tox run-parallel --parallel-no-spinner'
16+
python: "3.12"
17+
evm-type: "stable"
18+
tox-cmd: "tox" # run-parallel --parallel-no-spinner"
1919
# Disabled due to unavailable evm implementation for devnet-1
2020
# - os: ubuntu-latest
2121
# python: '3.11'
@@ -27,9 +27,9 @@ jobs:
2727
# evm-type: 'eip7692'
2828
# tox-cmd: 'tox -e tests-eip7692'
2929
- os: macos-latest
30-
python: '3.11'
31-
evm-type: 'stable'
32-
tox-cmd: 'tox run-parallel --parallel-no-spinner'
30+
python: "3.11"
31+
evm-type: "stable"
32+
tox-cmd: "tox" # run-parallel --parallel-no-spinner"
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:
@@ -38,11 +38,10 @@ jobs:
3838
id: evm-builder
3939
with:
4040
type: ${{ matrix.evm-type }}
41-
- name: Setup Python
42-
uses: actions/setup-python@v5
43-
with:
44-
python-version: ${{ matrix.python }}
45-
allow-prereleases: true
41+
- name: Set up uv
42+
uses: ./.github/actions/setup-uv
43+
- name: Set up Python ${{ matrix.python }}
44+
run: uv python install ${{ matrix.python }}
4645
- name: Setup Tools/Dependencies Ubuntu
4746
if: runner.os == 'Linux'
4847
run: |
@@ -54,7 +53,7 @@ jobs:
5453
# Add additional packages on 3.11: https://github.com/ethereum/execution-spec-tests/issues/274
5554
if [ ${{ matrix.python }} == '3.11' ]; then brew install autoconf automake libtool; fi
5655
- name: Install Tox and any other packages
57-
run: pip install tox
56+
run: pip install tox-uv
5857
- name: Run Tox (CPython)
5958
run: ${{ matrix.tox-cmd }}
6059
- uses: DavidAnson/markdownlint-cli2-action@v16

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ This guide installs stable versions of the external (go-ethereum) `evm` executab
9898

9999
Help for other platforms is available in the [online doc](https://ethereum.github.io/execution-spec-tests/getting_started/quick_start/).
100100

101-
2. Clone the [execution-spec-tests](https://github.com/ethereum/execution-spec-tests) repo and install its dependencies (it's recommended to use a virtual environment for the installation):
101+
2. Clone the [execution-spec-tests](https://github.com/ethereum/execution-spec-tests) repo and install its dependencies ([`uv`](https://docs.astral.sh/uv/) will create and manage a virtual environment for its installation):
102102

103103
```console
104104
git clone https://github.com/ethereum/execution-spec-tests
105105
cd execution-spec-tests
106-
python3 -m venv ./venv/
107-
source ./venv/bin/activate
108-
pip install -e .[docs,lint,test]
106+
pip install uv # or curl -LsSf https://astral.sh/uv/install.sh | sh
107+
uv sync --all-extras
108+
source .venv/bin/activate # or run `uv run fill ...`
109109
```
110110

111111
3. Verify the installation:

0 commit comments

Comments
 (0)