Skip to content

Commit c8ba4d2

Browse files
authored
Merge pull request #3927 from ethereum/fix-testgen-action
Fix test vector generators to work with Python 3.12
2 parents 666b63a + 36da776 commit c8ba4d2

File tree

24 files changed

+22
-53
lines changed

24 files changed

+22
-53
lines changed

.github/workflows/generate_vectors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ on:
1717

1818
jobs:
1919
generate-tests:
20-
runs-on: [self-hosted-ghr-custom, size-chungus-x64, profile-consensusSpecs]
20+
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
2424
with:
2525
repository: 'ethereum/consensus-specs'
2626
path: 'consensus-specs'
27-
ref: ${{ inputs.source_ref || 'dev' }}
27+
ref: ${{ inputs.ref || 'dev' }}
2828
- name: Checkout consensus-spec-tests repository
2929
uses: actions/checkout@v4
3030
with:

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ dist_check:
9696
dist_upload:
9797
python3 -m twine upload dist/*
9898

99+
build_wheel: install_test pyspec
100+
. venv/bin/activate && \
101+
python3 -m build --no-isolation --outdir ./dist ./
99102

100103
# "make generate_tests" to run all generators
101104
generate_tests: $(GENERATOR_TARGETS)
@@ -195,7 +198,8 @@ define run_generator
195198
cd $(GENERATOR_DIR)/$(1); \
196199
if ! test -d venv; then python3 -m venv venv; fi; \
197200
. venv/bin/activate; \
198-
pip3 install -r requirements.txt; \
201+
pip3 install ../../../dist/eth2spec-*.whl; \
202+
pip3 install 'eth2spec[generator]'; \
199203
python3 main.py -o $(CURRENT_DIR)/$(TEST_VECTOR_DIR); \
200204
echo "generator $(1) finished"
201205
endef
@@ -217,7 +221,7 @@ gen_kzg_setups:
217221

218222
# For any generator, build it using the run_generator function.
219223
# (creation of output dir is a dependency)
220-
gen_%: $(TEST_VECTOR_DIR)
224+
gen_%: build_wheel $(TEST_VECTOR_DIR)
221225
$(call run_generator,$*)
222226

223227
detect_generator_incomplete: $(TEST_VECTOR_DIR)

requirements_preinstallation.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pip>=24.0.0
22
wheel>=0.44.0
33
setuptools>=72.0.0
4-
pylint>=3.2.0
4+
pylint>=3.2.0
5+
build>=1.2.2

setup.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,26 +524,30 @@ def run(self):
524524
long_description=readme,
525525
long_description_content_type="text/markdown",
526526
author="ethereum",
527-
url="https://github.com/ethereum/eth2.0-specs",
527+
url="https://github.com/ethereum/consensus-specs",
528528
include_package_data=False,
529-
package_data={'configs': ['*.yaml'],
530-
'presets': ['*.yaml'],
531-
'specs': ['**/*.md'],
532-
'eth2spec': ['VERSION.txt']},
529+
package_data={
530+
'configs': ['*.yaml'],
531+
'eth2spec': ['VERSION.txt'],
532+
'presets': ['**/*.yaml', '**/*.json'],
533+
'specs': ['**/*.md'],
534+
'sync': ['optimistic.md'],
535+
},
533536
package_dir={
534-
"eth2spec": "tests/core/pyspec/eth2spec",
535537
"configs": "configs",
538+
"eth2spec": "tests/core/pyspec/eth2spec",
536539
"presets": "presets",
537540
"specs": "specs",
541+
"sync": "sync",
538542
},
539-
packages=find_packages(where='tests/core/pyspec') + ['configs', 'specs'],
543+
packages=find_packages(where='tests/core/pyspec') + ['configs', 'presets', 'specs', 'presets', 'sync'],
540544
py_modules=["eth2spec"],
541545
cmdclass=commands,
542546
python_requires=">=3.9, <4",
543547
extras_require={
544548
"test": ["pytest>=4.4", "pytest-cov", "pytest-xdist"],
545549
"lint": ["flake8==5.0.4", "mypy==0.981", "pylint==2.15.3"],
546-
"generator": ["python-snappy==0.6.1", "filelock", "pathos==0.3.0"],
550+
"generator": ["setuptools>=72.0.0", "pytest>4.4", "python-snappy==0.7.3", "filelock", "pathos==0.3.0"],
547551
"docs": ["mkdocs==1.4.2", "mkdocs-material==9.1.5", "mdx-truly-sane-lists==1.3", "mkdocs-awesome-pages-plugin==2.8.0"]
548552
},
549553
install_requires=[

tests/generators/bls/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/generators/epoch_processing/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/generators/finality/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/generators/fork_choice/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/generators/forks/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/generators/genesis/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)