From 0cfceaaf032ad040153cd7aa77e269d2f24ac5d9 Mon Sep 17 00:00:00 2001 From: Umut Date: Fri, 2 Sep 2022 11:03:42 +0200 Subject: [PATCH] feat: support python 3.10 --- .github/workflows/continuous-integration.yaml | 32 +++++++++++++++++++ pyproject.toml | 2 +- script/actions_utils/generate_test_matrix.py | 4 +-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 8d7136991..cc93af2a9 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -33,6 +33,7 @@ jobs: needs-37-linux-runner: ${{ steps.set-matrix.outputs.needs-37-linux-runner }} needs-38-linux-runner: ${{ steps.set-matrix.outputs.needs-38-linux-runner }} needs-39-linux-runner: ${{ steps.set-matrix.outputs.needs-39-linux-runner }} + needs-310-linux-runner: ${{ steps.set-matrix.outputs.needs-310-linux-runner }} steps: - name: Checkout code uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b @@ -76,6 +77,8 @@ jobs: jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.8")) | length > 0') NEEDS_LINUX_39_RUNNER=$(echo "${LINUX_MATRIX}" | \ jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.9")) | length > 0') + NEEDS_LINUX_310_RUNNER=$(echo "${LINUX_MATRIX}" | \ + jq -rc '. | map(select(.os_kind=="linux" and .python_version=="3.10")) | length > 0') echo "Needs Linux 3.7 runner:" echo "${NEEDS_LINUX_37_RUNNER}" @@ -86,9 +89,13 @@ jobs: echo "Needs Linux 3.9 runner:" echo "${NEEDS_LINUX_39_RUNNER}" + echo "Needs Linux 3.10 runner:" + echo "${NEEDS_LINUX_310_RUNNER}" + echo "::set-output name=needs-37-linux-runner::${NEEDS_LINUX_37_RUNNER}" echo "::set-output name=needs-38-linux-runner::${NEEDS_LINUX_38_RUNNER}" echo "::set-output name=needs-39-linux-runner::${NEEDS_LINUX_39_RUNNER}" + echo "::set-output name=needs-310-linux-runner::${NEEDS_LINUX_310_RUNNER}" start-runner-linux: needs: [matrix-preparation] @@ -101,6 +108,8 @@ jobs: ec2-instance-id-38: ${{ steps.start-ec2-runner-38.outputs.ec2-instance-id || '' }} label-39: ${{ steps.start-ec2-runner-39.outputs.label }} ec2-instance-id-39: ${{ steps.start-ec2-runner-39.outputs.ec2-instance-id || '' }} + label-310: ${{ steps.start-ec2-runner-310.outputs.label }} + ec2-instance-id-310: ${{ steps.start-ec2-runner-310.outputs.ec2-instance-id || '' }} matrix: ${{ steps.update-linux-matrix.outputs.linux-matrix }} steps: - name: Checkout Code @@ -149,6 +158,18 @@ jobs: subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }} security-group-id: ${{ secrets.AWS_EC2_SECURITY_GROUP_ID }} + - name: Start EC2 runner python 310 + id: start-ec2-runner-310 + if: ${{ !cancelled() && fromJSON(needs.matrix-preparation.outputs.needs-310-linux-runner) }} + uses: machulav/ec2-github-runner@c34ba2df3363ebde9d19fdbc341e03d02267284d + with: + mode: start + github-token: ${{ secrets.EC2_RUNNER_BOT_TOKEN }} + ec2-image-id: ${{ secrets.AWS_EC2_AMI }} + ec2-instance-type: ${{ secrets.AWS_EC2_INSTANCE_TYPE }} + subnet-id: ${{ secrets.AWS_EC2_SUBNET_ID }} + security-group-id: ${{ secrets.AWS_EC2_SECURITY_GROUP_ID }} + - name: Update Linux runs_on Matrix id: update-linux-matrix env: @@ -160,6 +181,8 @@ jobs: '(. | map(select(.os_kind=="linux" and .python_version=="3.8") |= . + {"runs_on": "${{ steps.start-ec2-runner-38.outputs.label }}"}) )') MATRIX=$(echo "${MATRIX}" | jq -rc \ '(. | map(select(.os_kind=="linux" and .python_version=="3.9") |= . + {"runs_on": "${{ steps.start-ec2-runner-39.outputs.label }}"}) )') + MATRIX=$(echo "${MATRIX}" | jq -rc \ + '(. | map(select(.os_kind=="linux" and .python_version=="3.10") |= . + {"runs_on": "${{ steps.start-ec2-runner-310.outputs.label }}"}) )') echo "Updated matrix:" echo "${MATRIX}" @@ -399,6 +422,15 @@ jobs: ec2-instance-id: ${{ needs.start-runner-linux.outputs.ec2-instance-id-39 }} mode: stop + - name: Stop EC2 runner python 310 + uses: machulav/ec2-github-runner@c34ba2df3363ebde9d19fdbc341e03d02267284d + if: ${{ always() && needs.start-runner-linux.outputs.ec2-instance-id-310 }} + with: + github-token: ${{ secrets.EC2_RUNNER_BOT_TOKEN }} + label: ${{ needs.start-runner-linux.outputs.label-310 }} + ec2-instance-id: ${{ needs.start-runner-linux.outputs.ec2-instance-id-310 }} + mode: stop + build-macos: needs: [matrix-preparation] if: ${{ needs.matrix-preparation.outputs.macos-matrix != '[]' }} diff --git a/pyproject.toml b/pyproject.toml index 6a9cdf8c7..6262d1945 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ readme = "README.md" "Discourse" = "https://community.zama.ai/c/concrete-numpy/7" [tool.poetry.dependencies] -python = ">=3.7,<3.10" +python = ">=3.7,<3.11" networkx = "^2.6.3" matplotlib = "^3.5.1" numpy = "^1.21.0" diff --git a/script/actions_utils/generate_test_matrix.py b/script/actions_utils/generate_test_matrix.py index 708d8726e..677d6f5c6 100644 --- a/script/actions_utils/generate_test_matrix.py +++ b/script/actions_utils/generate_test_matrix.py @@ -27,7 +27,7 @@ WEEKLY_OSES = { LINUX: "ubuntu-20.04", MACOS: "macos-11", } -WEEKLY_PYTHON_VERSIONS = ["3.7", "3.8", "3.9"] +WEEKLY_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] WEEKLY_CONF = {"os": WEEKLY_OSES, "python": WEEKLY_PYTHON_VERSIONS} # The OSes here are to indicate the OSes used for runners during release @@ -38,7 +38,7 @@ RELEASE_OSES = { # MACOS: "macos-10.15", } # The python versions will be used to build packages during release -RELEASE_PYTHON_VERSIONS = ["3.7", "3.8", "3.9"] +RELEASE_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] RELEASE_CONF = {"os": RELEASE_OSES, "python": RELEASE_PYTHON_VERSIONS} CONFIGURATIONS = {