Skip to content

Commit c260248

Browse files
Exclude the dependencies newer than 3 days (#451)
* Exclude the dependencies newer than 3 days * Switch to UV_EXCLUDE_NEWER env var
1 parent d41ffdf commit c260248

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

.github/workflows/dc_sync.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ jobs:
4646
- name: Checkout
4747
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4848

49-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
49+
- name: Setup Python and uv
50+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
5051
with:
5152
python-version: "3.11"
5253

5354
- name: Install requirements
55+
env:
56+
UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection)
5457
run: |
55-
pip install --upgrade pip
56-
pip install -r requirements.txt
58+
uv venv
59+
uv pip install -r requirements.txt
5760
5861
- name: Generate file to upload
5962
id: file-generator
@@ -62,6 +65,7 @@ jobs:
6265
METADATA_FILE="$(basename ${{ matrix.file }} .ipynb).yml"
6366
echo "file=text/$FILE" >> "$GITHUB_OUTPUT"
6467
echo "metadata_file=text/$METADATA_FILE" >> "$GITHUB_OUTPUT"
68+
. .venv/bin/activate
6569
python scripts/generate_txt.py --metadata --notebooks ${{ matrix.file }}
6670
6771
- name: Upload tutorial to deepset Cloud

.github/workflows/full_dc_sync.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,27 @@ jobs:
1010
- name: Checkout
1111
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1212

13-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
13+
- name: Setup Python and uv
14+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
1415
with:
1516
python-version: "3.11"
1617

1718
- name: Install requirements
19+
env:
20+
UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection)
1821
run: |
19-
pip install --upgrade pip
20-
pip install -r requirements.txt
22+
uv venv
23+
uv pip install -r requirements.txt
2124
2225
- name: Generate all tutorials and their metadata
23-
run: python scripts/generate_txt.py --notebooks all --metadata
26+
run: |
27+
. .venv/bin/activate
28+
python scripts/generate_txt.py --notebooks all --metadata
2429
2530
- name: Full sync
2631
env:
2732
DEEPSET_CLOUD_WORKSPACE: ${{ secrets.DEEPSET_CLOUD_WORKSPACE }}
2833
DEEPSET_CLOUD_API_KEY: ${{ secrets.DEEPSET_CLOUD_API_KEY }}
29-
run: python scripts/full_dc_sync.py
34+
run: |
35+
. .venv/bin/activate
36+
python scripts/full_dc_sync.py

.github/workflows/run_tutorials.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ jobs:
9797
VERSION="${{ matrix.haystack_version }}"
9898
uv pip install "haystack-ai==${VERSION#v}"
9999
fi
100-
uv pip install nbconvert ipython
100+
uv pip install --exclude-newer P3D nbconvert ipython # P3D = 3-day cutoff; haystack-ai above is exempt
101101
102102
- name: Install tutorial dependencies
103103
if: toJSON(matrix.dependencies) != '[]'
104+
env:
105+
UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection)
104106
run: |
105107
uv pip install "${{ join(matrix.dependencies, '" "')}}"
106108

.github/workflows/verify_generation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
python-version: "3.11"
2020

2121
- name: Install dependencies
22+
env:
23+
UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection)
2224
run: |
2325
uv venv
2426
uv pip install -r requirements.txt

0 commit comments

Comments
 (0)