Skip to content

Commit 5a84f67

Browse files
fix(ci): properly install python deps, in CI and docker
1 parent ed9e2c1 commit 5a84f67

6 files changed

Lines changed: 16 additions & 31 deletions

File tree

.github/actions/bootstrap/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ runs:
1919
github_token: ${{ inputs.github_token }}
2020
- name: Install cairo native.
2121
uses: ./.github/actions/setup_native_deps
22+
- name: Install python requirements.
23+
shell: bash
24+
run: pip install -r scripts/requirements.txt

.github/workflows/main.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ jobs:
5959
extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }}
6060
github_token: ${{ secrets.GITHUB_TOKEN }}
6161

62-
- name: Setup Python venv
63-
run: |
64-
python3 -m venv ci
65-
ci/bin/pip install -r scripts/requirements.txt
66-
6762
# Check Cargo.lock is up to date.
6863
- name: "Check Cargo.lock"
6964
run: |
@@ -77,13 +72,13 @@ jobs:
7772
# Run code style on PR.
7873
- name: "Run TODO style pull request"
7974
if: github.event_name == 'pull_request'
80-
run: ci/bin/python scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
75+
run: scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
8176
- name: "Run clippy pull request"
8277
if: github.event_name == 'pull_request'
83-
run: ci/bin/python scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
78+
run: scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8479
- name: "Run cargo doc pull request"
8580
if: github.event_name == 'pull_request'
86-
run: ci/bin/python scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
81+
run: scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8782

8883
# Run code style on push.
8984
- name: "Run rustfmt"
@@ -93,10 +88,10 @@ jobs:
9388

9489
- name: "Run clippy on push"
9590
if: github.event_name == 'push'
96-
run: ci/bin/python scripts/run_tests.py --command clippy
91+
run: scripts/run_tests.py --command clippy
9792
- name: "Run cargo doc on push"
9893
if: github.event_name == 'push'
99-
run: ci/bin/python scripts/run_tests.py --command doc
94+
run: scripts/run_tests.py --command doc
10095

10196
- name: "Run taplo"
10297
run: scripts/taplo.sh
@@ -139,31 +134,25 @@ jobs:
139134
- name: "Run tests pull request"
140135
if: github.event_name == 'pull_request'
141136
run: |
142-
python3 -m venv ci
143-
ci/bin/pip install -r scripts/requirements.txt
144-
ci/bin/python scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
137+
scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
145138
env:
146139
SEED: 0
147140

148141
- name: "Run integration tests pull request"
149142
if: github.event_name == 'pull_request'
150143
# TODO(Tsabary): Find a better way to set the ephemeral port range.
151144
run: |
152-
python3 -m venv ci
153-
ci/bin/pip install -r scripts/requirements.txt
154145
echo "net.ipv4.ip_local_port_range = 40000 40200" | sudo tee /etc/sysctl.conf
155146
sudo sysctl -p
156-
ci/bin/python scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
147+
scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
157148
env:
158149
SEED: 0
159150

160151
- name: "Run tests on push"
161152
if: github.event_name == 'push'
162153
# TODO(AdiY/Dori): Better support for running tests on push.
163154
run: |
164-
python3 -m venv ci
165-
ci/bin/pip install -r scripts/requirements.txt
166-
ci/bin/python scripts/run_tests.py --command test
155+
scripts/run_tests.py --command test
167156
env:
168157
SEED: 0
169158

.github/workflows/main_nightly.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ jobs:
5050
with:
5151
github_token: ${{ secrets.GITHUB_TOKEN }}
5252

53-
- name: Setup Python venv
54-
run: |
55-
python3 -m venv ci
56-
ci/bin/pip install -r scripts/requirements.txt
57-
5853
# Run feature combo test.
5954
- name: "Run feature combo on all crates."
60-
run: ci/bin/python scripts/run_feature_combos_test.py
55+
run: scripts/run_feature_combos_test.py

.github/workflows/merge_queue_ci.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,14 @@ jobs:
3333
extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }}
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
3535

36-
- name: Setup Python venv
37-
run: |
38-
python3 -m venv ci
39-
ci/bin/pip install -r scripts/requirements.txt
40-
4136
# Check Cargo.lock is up to date.
4237
- name: "Check Cargo.lock"
4338
run: |
4439
cargo update -w --locked
4540
git diff --exit-code Cargo.lock
4641
4742
- name: "Run clippy on merge queue"
48-
run: ci/bin/python scripts/run_tests.py --command clippy
43+
run: scripts/run_tests.py --command clippy
4944

5045
- name: "Run rustfmt on merge queue"
5146
# The nightly here is coupled with the one in install_rust/action.yml.

scripts/named_todos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/env python3
2+
13
import os
24
import re
35

scripts/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cairo-lang==0.13.5
22
sympy==1.12.0 # pypy3.9 issue.
33
GitPython
4+
gitpython

0 commit comments

Comments
 (0)