Merge pull request #3927 from ethereum/fix-testgen-action

Fix test vector generators to work with Python 3.12
This commit is contained in:
Hsiao-Wei Wang 2024-09-18 21:51:50 +08:00 committed by GitHub
commit c8ba4d2ee7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 22 additions and 53 deletions

View File

@ -17,14 +17,14 @@ on:
jobs:
generate-tests:
runs-on: [self-hosted-ghr-custom, size-chungus-x64, profile-consensusSpecs]
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: 'ethereum/consensus-specs'
path: 'consensus-specs'
ref: ${{ inputs.source_ref || 'dev' }}
ref: ${{ inputs.ref || 'dev' }}
- name: Checkout consensus-spec-tests repository
uses: actions/checkout@v4
with:

View File

@ -96,6 +96,9 @@ dist_check:
dist_upload:
python3 -m twine upload dist/*
build_wheel: install_test pyspec
. venv/bin/activate && \
python3 -m build --no-isolation --outdir ./dist ./
# "make generate_tests" to run all generators
generate_tests: $(GENERATOR_TARGETS)
@ -195,7 +198,8 @@ define run_generator
cd $(GENERATOR_DIR)/$(1); \
if ! test -d venv; then python3 -m venv venv; fi; \
. venv/bin/activate; \
pip3 install -r requirements.txt; \
pip3 install ../../../dist/eth2spec-*.whl; \
pip3 install 'eth2spec[generator]'; \
python3 main.py -o $(CURRENT_DIR)/$(TEST_VECTOR_DIR); \
echo "generator $(1) finished"
endef
@ -217,7 +221,7 @@ gen_kzg_setups:
# For any generator, build it using the run_generator function.
# (creation of output dir is a dependency)
gen_%: $(TEST_VECTOR_DIR)
gen_%: build_wheel $(TEST_VECTOR_DIR)
$(call run_generator,$*)
detect_generator_incomplete: $(TEST_VECTOR_DIR)

View File

@ -1,4 +1,5 @@
pip>=24.0.0
wheel>=0.44.0
setuptools>=72.0.0
pylint>=3.2.0
pylint>=3.2.0
build>=1.2.2

View File

@ -524,26 +524,30 @@ setup(
long_description=readme,
long_description_content_type="text/markdown",
author="ethereum",
url="https://github.com/ethereum/eth2.0-specs",
url="https://github.com/ethereum/consensus-specs",
include_package_data=False,
package_data={'configs': ['*.yaml'],
'presets': ['*.yaml'],
'specs': ['**/*.md'],
'eth2spec': ['VERSION.txt']},
package_data={
'configs': ['*.yaml'],
'eth2spec': ['VERSION.txt'],
'presets': ['**/*.yaml', '**/*.json'],
'specs': ['**/*.md'],
'sync': ['optimistic.md'],
},
package_dir={
"eth2spec": "tests/core/pyspec/eth2spec",
"configs": "configs",
"eth2spec": "tests/core/pyspec/eth2spec",
"presets": "presets",
"specs": "specs",
"sync": "sync",
},
packages=find_packages(where='tests/core/pyspec') + ['configs', 'specs'],
packages=find_packages(where='tests/core/pyspec') + ['configs', 'presets', 'specs', 'presets', 'sync'],
py_modules=["eth2spec"],
cmdclass=commands,
python_requires=">=3.9, <4",
extras_require={
"test": ["pytest>=4.4", "pytest-cov", "pytest-xdist"],
"lint": ["flake8==5.0.4", "mypy==0.981", "pylint==2.15.3"],
"generator": ["python-snappy==0.6.1", "filelock", "pathos==0.3.0"],
"generator": ["setuptools>=72.0.0", "pytest>4.4", "python-snappy==0.7.3", "filelock", "pathos==0.3.0"],
"docs": ["mkdocs==1.4.2", "mkdocs-material==9.1.5", "mdx-truly-sane-lists==1.3", "mkdocs-awesome-pages-plugin==2.8.0"]
},
install_requires=[

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]

View File

@ -1,2 +0,0 @@
pytest>=4.4
../../../[generator]