Update python to 3.12.4 (#3880)

* update python to 3.12

* drop down to 3.12.4 for compatibility

* setup rust toolchain for deps

* fix typo

* fix linter

* fixing linter

* adding rust dep

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying to fix circleci

* trying new image

* trying new image

* trying new image

* trying new image

* invalidate cache

* bump reqs

* remove cache invalidation

* fix cache name

* update to use latest image
This commit is contained in:
Parithosh Jayanthi 2024-08-21 20:15:57 +02:00 committed by GitHub
parent 01aab85412
commit ad91a835c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 62 additions and 59 deletions

View File

@ -60,7 +60,7 @@ commands:
jobs:
checkout_specs:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
# Restore git repo at point close to target branch/revision, to speed up checkout
@ -80,7 +80,7 @@ jobs:
- ~/specs-repo
install_pyspec_test:
docker:
- image: circleci/python:3.9
- image: ethpandaops/circleci-python-rust:latest
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -88,11 +88,11 @@ jobs:
- restore_pyspec_cached_venv
- run:
name: Install pyspec requirements
command: make install_test
command: make install_test && make preinstallation
- save_pyspec_cached_venv
test-phase0:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -105,7 +105,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-altair:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -118,7 +118,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-bellatrix:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -131,7 +131,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-capella:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -144,7 +144,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-deneb:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -157,7 +157,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-electra:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -170,7 +170,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-whisk:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -183,7 +183,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-eip7594:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -205,7 +205,7 @@ jobs:
command: sudo npm install -g doctoc@2.2.0 && make check_toc
codespell:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- checkout
@ -214,7 +214,7 @@ jobs:
command: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
lint:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -270,7 +270,7 @@ jobs:
- /nix
install_deposit_contract_web3_tester:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
@ -282,7 +282,7 @@ jobs:
- save_deposit_contract_tester_cached_venv
test_deposit_contract_web3_tests:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:

View File

@ -32,7 +32,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Clean up Spec Repository
run: |

View File

@ -45,7 +45,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Check codespell
run: make codespell
@ -55,10 +55,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
@ -76,10 +78,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: set TEST_PRESET_TYPE
if: github.event.inputs.test_preset_type != ''

View File

@ -1,5 +1,5 @@
# Rename the build stage from 'base' to 'builder' for clarification and code readability
FROM python:3.11.0-slim-bullseye as builder
FROM python:3.12.4-slim-bullseye as builder
ENV DEBIAN_FRONTEND=noninteractive \
WORKDIR=/consensus-specs \

View File

@ -1,4 +1,4 @@
pip>=23.1.2
wheel>=0.40.0
setuptools>=68.0.0
pylint>=3.0.0
pip>=24.0.0
wheel>=0.44.0
setuptools>=72.0.0
pylint>=3.2.0

View File

@ -132,7 +132,7 @@ def should_skip_case_dir(case_dir, is_force, diagnostics_obj):
print(f'Skipping already existing test: {case_dir}')
is_skip = True
else:
print(f'Warning, output directory {case_dir} already exist,'
print(f'Warning, output directory {case_dir} already exist, '
' old files will be deleted and it will generate test vector files with the latest version')
# Clear the existing case_dir folder
shutil.rmtree(case_dir)
@ -356,7 +356,7 @@ def generate_test_vector(test_case, case_dir, log_file, file_mode):
test_end = time.time()
span = round(test_end - test_start, 2)
if span > TIME_THRESHOLD_TO_PRINT:
print(f' - generated in {span} seconds')
print(f'- generated in {span} seconds')
return result

View File

@ -46,7 +46,7 @@ class BitsStruct(Container):
E: Bitvector[8]
def container_case_fn(rng: Random, mode: RandomizationMode, typ: Type[View], chaos: bool=False):
def container_case_fn(rng: Random, mode: RandomizationMode, typ: Type[View], chaos: bool = False):
return get_random_ssz_object(rng, typ,
max_bytes_length=2000,
max_list_length=2000,
@ -115,8 +115,7 @@ def invalid_cases():
invalid_test_case(lambda: mod_offset(
b=serialize(container_case_fn(rng, mode, typ)),
offset_index=offset_index,
change=lambda x: x + 1
))
change=lambda x: x + 1))
yield f'{name}_{mode.to_name()}_offset_{offset_index}_zeroed', \
invalid_test_case(lambda: mod_offset(
b=serialize(container_case_fn(rng, mode, typ)),