Skip to content

Commit c9f149c

Browse files
fix(ci): properly install python deps, in CI and docker
1 parent cc3538d commit c9f149c

File tree

7 files changed

+30
-34
lines changed

7 files changed

+30
-34
lines changed

.github/workflows/blockifier_compiled_cairo.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ jobs:
3939
id: setup-pypy
4040
with:
4141
python-version: 'pypy3.9'
42+
cache: 'pip'
4243
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
4344
- env:
4445
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
4546
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
47+
- run: pip install -r scripts/requirements.txt
4648

4749
- name: Verify cairo contract recompilation (both cairo versions).
4850
run:

.github/workflows/blockifier_post-merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
id: setup-pypy
2626
with:
2727
python-version: 'pypy3.9'
28+
cache: 'pip'
2829
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
2930
- env:
3031
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin

.github/workflows/main.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,19 @@ jobs:
4848
id: setup-pypy
4949
with:
5050
python-version: "pypy3.9"
51+
cache: 'pip'
5152
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
5253
- env:
5354
LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin
5455
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
56+
- run: pip install -r scripts/requirements.txt
5557

5658
# Install rust components.
5759
- uses: ./.github/actions/bootstrap
5860
with:
5961
extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }}
6062
github_token: ${{ secrets.GITHUB_TOKEN }}
6163

62-
- name: Setup Python venv
63-
run: |
64-
python3 -m venv ci
65-
ci/bin/pip install -r scripts/requirements.txt
66-
6764
# Check Cargo.lock is up to date.
6865
- name: "Check Cargo.lock"
6966
run: |
@@ -77,13 +74,13 @@ jobs:
7774
# Run code style on PR.
7875
- name: "Run TODO style pull request"
7976
if: github.event_name == 'pull_request'
80-
run: ci/bin/python scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
77+
run: scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
8178
- name: "Run clippy pull request"
8279
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 }}
80+
run: scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8481
- name: "Run cargo doc pull request"
8582
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 }}
83+
run: scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8784

8885
# Run code style on push.
8986
- name: "Run rustfmt"
@@ -93,10 +90,10 @@ jobs:
9390

9491
- name: "Run clippy on push"
9592
if: github.event_name == 'push'
96-
run: ci/bin/python scripts/run_tests.py --command clippy
93+
run: scripts/run_tests.py --command clippy
9794
- name: "Run cargo doc on push"
9895
if: github.event_name == 'push'
99-
run: ci/bin/python scripts/run_tests.py --command doc
96+
run: scripts/run_tests.py --command doc
10097

10198
- name: "Run taplo"
10299
run: scripts/taplo.sh
@@ -128,30 +125,29 @@ jobs:
128125
id: setup-pypy
129126
with:
130127
python-version: "pypy3.9"
128+
cache: 'pip'
131129
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
132130
- env:
133131
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
134132
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
133+
- run: pip install -r scripts/requirements.txt
134+
135135
# TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to
136136
# anvil, remove.
137137
- run: npm install -g [email protected]
138138

139139
- name: "Run tests pull request"
140140
if: github.event_name == 'pull_request'
141141
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 }}
142+
scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
145143
env:
146144
SEED: 0
147145

148146
- name: "Run tests on push"
149147
if: github.event_name == 'push'
150148
# TODO(AdiY/Dori): Better support for running tests on push.
151149
run: |
152-
python3 -m venv ci
153-
ci/bin/pip install -r scripts/requirements.txt
154-
ci/bin/python scripts/run_tests.py --command test
150+
scripts/run_tests.py --command test
155151
env:
156152
SEED: 0
157153

@@ -171,19 +167,20 @@ jobs:
171167
id: setup-pypy
172168
with:
173169
python-version: "pypy3.9"
170+
cache: 'pip'
174171
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
175172
- env:
176173
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
177174
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
175+
- run: pip install -r scripts/requirements.txt
176+
178177
# TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to
179178
# anvil, remove.
180179
- run: npm install -g [email protected]
181180

182181
- name: "Run integration tests pull request"
183182
if: github.event_name == 'pull_request'
184183
run: |
185-
python3 -m venv ci
186-
ci/bin/pip install -r scripts/requirements.txt
187-
ci/bin/python scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
184+
scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
188185
env:
189186
SEED: 0

.github/workflows/main_nightly.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,21 @@ jobs:
4040
id: setup-pypy
4141
with:
4242
python-version: "pypy3.9"
43+
cache: 'pip'
4344
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
4445
- env:
4546
LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin
4647
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
48+
- run: pip install -r scripts/requirements.txt
4749

4850
# Install rust components.
4951
- uses: ./.github/actions/bootstrap
5052
with:
5153
github_token: ${{ secrets.GITHUB_TOKEN }}
5254

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

6259
run-integration-tests:
6360
runs-on: starkware-ubuntu-24.04-large
@@ -77,14 +74,13 @@ jobs:
7774
- env:
7875
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
7976
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
77+
- run: pip install -r scripts/requirements.txt
8078
# TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to
8179
# anvil, remove.
8280
- run: npm install -g [email protected]
8381

8482
- name: "Run integration tests pull request"
8583
run: |
86-
python3 -m venv ci
87-
ci/bin/pip install -r scripts/requirements.txt
88-
ci/bin/python scripts/run_tests.py --command integration --is_nightly
84+
scripts/run_tests.py --command integration --is_nightly
8985
env:
9086
SEED: 0

.github/workflows/merge_paths_ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- uses: actions/setup-python@v5
3434
with:
3535
python-version: '3.9'
36+
cache: 'pip'
3637
- run: |
3738
python -m pip install --upgrade pip
3839
pip install pytest

.github/workflows/merge_queue_ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,27 @@ jobs:
2222
id: setup-pypy
2323
with:
2424
python-version: "pypy3.9"
25+
cache: 'pip'
2526
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
2627
- env:
2728
LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin
2829
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
30+
- run: pip install -r scripts/requirements.txt
2931

3032
# Install rust components.
3133
- uses: ./.github/actions/bootstrap
3234
with:
3335
extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }}
3436
github_token: ${{ secrets.GITHUB_TOKEN }}
3537

36-
- name: Setup Python venv
37-
run: |
38-
python3 -m venv ci
39-
ci/bin/pip install -r scripts/requirements.txt
40-
4138
# Check Cargo.lock is up to date.
4239
- name: "Check Cargo.lock"
4340
run: |
4441
cargo update -w --locked
4542
git diff --exit-code Cargo.lock
4643
4744
- name: "Run clippy on merge queue"
48-
run: ci/bin/python scripts/run_tests.py --command clippy
45+
run: scripts/run_tests.py --command clippy
4946

5047
- name: "Run rustfmt on merge queue"
5148
# 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

0 commit comments

Comments
 (0)