Skip to content

Commit

Permalink
Merge pull request ethereum#206 from ethereum/dev
Browse files Browse the repository at this point in the history
Internationalisation release
  • Loading branch information
CarlBeek authored Feb 4, 2022
2 parents 256ea21 + 8657a1b commit e2a7c94
Show file tree
Hide file tree
Showing 144 changed files with 2,892 additions and 662 deletions.
103 changes: 94 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- run:
name: Run deposit script on Windows"
command: python ./test_deposit_script.py
build-linux:
build-linux-amd64:
machine:
image: ubuntu-1604:202007-01
working_directory: ~/repo
Expand All @@ -119,15 +119,73 @@ jobs:
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
mkdir ${BUILD_FILE_NAME};
pyenv global 3.7.5;
pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec;
- run:
name: Test executable binaries
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
export TEST_FOLDER_NAME=TMP_TEST_FOLDER
mkdir ${TEST_FOLDER_NAME}
cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME}
cp test_binary_script.py ${TEST_FOLDER_NAME}
cd ${TEST_FOLDER_NAME}
python test_binary_script.py ./${BUILD_FILE_NAME};
- run:
name: Compress the file
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256
- store_artifacts:
path: /tmp/artifacts
build-linux-arm64:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
working_directory: ~/repo
steps:
- checkout
- run:
name: Install building requirements on Linux ARM64
command: |
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.5;
pyenv global 3.7.5;
pip install -r ./build_configs/linux/requirements.txt;
- run:
name: Build with build.spec
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64;
mkdir ${BUILD_FILE_NAME};
pyenv global 3.7.5;
pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec;
- run:
name: Test executable binaries
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64;
export TEST_FOLDER_NAME=TMP_TEST_FOLDER
mkdir ${TEST_FOLDER_NAME}
cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME}
cp test_binary_script.py ${TEST_FOLDER_NAME}
cd ${TEST_FOLDER_NAME}
python test_binary_script.py ./${BUILD_FILE_NAME};
- run:
name: Compress the file
command: |
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64;
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
Expand All @@ -148,15 +206,28 @@ jobs:
command: |
$PYTHONHASHSEED = 42
$CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7)
$BUILD_FILE_NAME = "eth2deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
$BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
mkdir $BUILD_FILE_NAME
$BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME
pyinstaller --distpath $BUILD_FILE_NAME_PATH .\build_configs\windows\build.spec
- run:
name: Test executable binaries
command: |
$PYTHONHASHSEED = 42
$CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7)
$BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
$TEST_FOLDER_NAME = "TMP_TEST_FOLDER"
mkdir ${TEST_FOLDER_NAME}
Copy-item ${BUILD_FILE_NAME} -destination ${TEST_FOLDER_NAME} -recurse
copy test_binary_script.py ${TEST_FOLDER_NAME}
cd ${TEST_FOLDER_NAME}
python test_binary_script.py ${BUILD_FILE_NAME}
- run:
name: Compress the file
command: |
$PYTHONHASHSEED = 42
$CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7)
$BUILD_FILE_NAME = "eth2deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
$BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64"
$BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME
$ZIP_FILE_NAME = $BUILD_FILE_NAME + ".zip"
Compress-Archive -Path $BUILD_FILE_NAME_PATH -DestinationPath $ZIP_FILE_NAME
Expand All @@ -168,7 +239,7 @@ jobs:
path: /tmp/artifacts
build-macos:
macos:
xcode: 11.3.0
xcode: 12.4.0
working_directory: ~/repo
steps:
- run: xcodebuild -version
Expand All @@ -182,14 +253,27 @@ jobs:
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
mkdir ${BUILD_FILE_NAME};
pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/macos/build.spec;
- run:
name: Test executable binaries
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
export TEST_FOLDER_NAME=TMP_TEST_FOLDER
mkdir ${TEST_FOLDER_NAME}
cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME}
cp test_binary_script.py ${TEST_FOLDER_NAME}
cd ${TEST_FOLDER_NAME}
python3 test_binary_script.py ./${BUILD_FILE_NAME};
- run:
name: Compress the file
command: |
export PYTHONHASHSEED=42
export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7)
export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
Expand All @@ -215,7 +299,8 @@ workflows:
- win-py37-script
build_linux:
jobs:
- build-linux
- build-linux-amd64
- build-linux-arm64
build_windows:
jobs:
- build-windows
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app

COPY requirements.txt setup.py ./

COPY eth2deposit ./eth2deposit
COPY staking_deposit ./staking_deposit

RUN apk add --update gcc libc-dev linux-headers

Expand All @@ -14,6 +14,6 @@ RUN python3 setup.py install

ARG cli_command

ENTRYPOINT [ "python3", "./eth2deposit/deposit.py" ]
ENTRYPOINT [ "python3", "./staking_deposit/deposit.py" ]

CMD [ $cli_command ]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3.8
DOCKER_IMAGE="ethereum/eth2.0-deposit-cli:latest"
DOCKER_IMAGE="ethereum/staking-deposit-cli:latest"

help:
@echo "clean - remove build and Python file artifacts"
Expand Down Expand Up @@ -35,13 +35,13 @@ venv_build_test: venv_build
${VENV_NAME}/bin/python -m pip install -r requirements_test.txt

venv_test: venv_build_test
$(VENV_ACTIVATE) && python -m pytest .
$(VENV_ACTIVATE) && python -m pytest ./tests

venv_lint: venv_build_test
$(VENV_ACTIVATE) && flake8 --config=flake8.ini ./eth2deposit ./tests && mypy --config-file mypy.ini -p eth2deposit
$(VENV_ACTIVATE) && flake8 --config=flake8.ini ./staking_deposit ./tests && mypy --config-file mypy.ini -p staking_deposit

venv_deposit: venv_build
$(VENV_ACTIVATE) && python ./eth2deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS))
$(VENV_ACTIVATE) && python ./staking_deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS))

build_macos: venv_build
${VENV_NAME}/bin/python -m pip install -r ./build_configs/macos/requirements.txt
Expand Down
Loading

0 comments on commit e2a7c94

Please sign in to comment.