From 8601bbc72c23f732798e1c0051e26bcd26ff0ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20=C5=81ukawski?= Date: Tue, 19 May 2026 10:29:30 +0200 Subject: [PATCH 1/2] Exclude the dependencies newer than 3 days --- .github/workflows/dc_sync.yml | 8 +++++--- .github/workflows/full_dc_sync.yml | 15 ++++++++++----- .github/workflows/run_tutorials.yml | 4 ++-- .github/workflows/verify_generation.yml | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dc_sync.yml b/.github/workflows/dc_sync.yml index 616e95c..b5789aa 100644 --- a/.github/workflows/dc_sync.yml +++ b/.github/workflows/dc_sync.yml @@ -46,14 +46,15 @@ jobs: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + - name: Setup Python and uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: python-version: "3.11" - name: Install requirements run: | - pip install --upgrade pip - pip install -r requirements.txt + uv venv + uv pip install --exclude-newer P3D -r requirements.txt - name: Generate file to upload id: file-generator @@ -62,6 +63,7 @@ jobs: METADATA_FILE="$(basename ${{ matrix.file }} .ipynb).yml" echo "file=text/$FILE" >> "$GITHUB_OUTPUT" echo "metadata_file=text/$METADATA_FILE" >> "$GITHUB_OUTPUT" + . .venv/bin/activate python scripts/generate_txt.py --metadata --notebooks ${{ matrix.file }} - name: Upload tutorial to deepset Cloud diff --git a/.github/workflows/full_dc_sync.yml b/.github/workflows/full_dc_sync.yml index e05dcde..81d2c3f 100644 --- a/.github/workflows/full_dc_sync.yml +++ b/.github/workflows/full_dc_sync.yml @@ -10,20 +10,25 @@ jobs: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + - name: Setup Python and uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 with: python-version: "3.11" - name: Install requirements run: | - pip install --upgrade pip - pip install -r requirements.txt + uv venv + uv pip install --exclude-newer P3D -r requirements.txt - name: Generate all tutorials and their metadata - run: python scripts/generate_txt.py --notebooks all --metadata + run: | + . .venv/bin/activate + python scripts/generate_txt.py --notebooks all --metadata - name: Full sync env: DEEPSET_CLOUD_WORKSPACE: ${{ secrets.DEEPSET_CLOUD_WORKSPACE }} DEEPSET_CLOUD_API_KEY: ${{ secrets.DEEPSET_CLOUD_API_KEY }} - run: python scripts/full_dc_sync.py + run: | + . .venv/bin/activate + python scripts/full_dc_sync.py diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index d0487cf..e6af2d4 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -97,12 +97,12 @@ jobs: VERSION="${{ matrix.haystack_version }}" uv pip install "haystack-ai==${VERSION#v}" fi - uv pip install nbconvert ipython + uv pip install --exclude-newer P3D nbconvert ipython - name: Install tutorial dependencies if: toJSON(matrix.dependencies) != '[]' run: | - uv pip install "${{ join(matrix.dependencies, '" "')}}" + uv pip install --exclude-newer P3D "${{ join(matrix.dependencies, '" "')}}" - name: Convert notebook to Python run: | diff --git a/.github/workflows/verify_generation.yml b/.github/workflows/verify_generation.yml index 242dcc0..250db2e 100644 --- a/.github/workflows/verify_generation.yml +++ b/.github/workflows/verify_generation.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | uv venv - uv pip install -r requirements.txt + uv pip install --exclude-newer P3D -r requirements.txt - name: Generate all tutorials run: | From a79d82bd51a85726dda87f038a6b1e4f243f9d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20=C5=81ukawski?= Date: Tue, 19 May 2026 11:29:12 +0200 Subject: [PATCH 2/2] Switch to UV_EXCLUDE_NEWER env var --- .github/workflows/dc_sync.yml | 4 +++- .github/workflows/full_dc_sync.yml | 4 +++- .github/workflows/run_tutorials.yml | 6 ++++-- .github/workflows/verify_generation.yml | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dc_sync.yml b/.github/workflows/dc_sync.yml index b5789aa..b12b6f0 100644 --- a/.github/workflows/dc_sync.yml +++ b/.github/workflows/dc_sync.yml @@ -52,9 +52,11 @@ jobs: python-version: "3.11" - name: Install requirements + env: + UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection) run: | uv venv - uv pip install --exclude-newer P3D -r requirements.txt + uv pip install -r requirements.txt - name: Generate file to upload id: file-generator diff --git a/.github/workflows/full_dc_sync.yml b/.github/workflows/full_dc_sync.yml index 81d2c3f..abb9866 100644 --- a/.github/workflows/full_dc_sync.yml +++ b/.github/workflows/full_dc_sync.yml @@ -16,9 +16,11 @@ jobs: python-version: "3.11" - name: Install requirements + env: + UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection) run: | uv venv - uv pip install --exclude-newer P3D -r requirements.txt + uv pip install -r requirements.txt - name: Generate all tutorials and their metadata run: | diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index e6af2d4..9783095 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -97,12 +97,14 @@ jobs: VERSION="${{ matrix.haystack_version }}" uv pip install "haystack-ai==${VERSION#v}" fi - uv pip install --exclude-newer P3D nbconvert ipython + uv pip install --exclude-newer P3D nbconvert ipython # P3D = 3-day cutoff; haystack-ai above is exempt - name: Install tutorial dependencies if: toJSON(matrix.dependencies) != '[]' + env: + UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection) run: | - uv pip install --exclude-newer P3D "${{ join(matrix.dependencies, '" "')}}" + uv pip install "${{ join(matrix.dependencies, '" "')}}" - name: Convert notebook to Python run: | diff --git a/.github/workflows/verify_generation.yml b/.github/workflows/verify_generation.yml index 250db2e..f195eee 100644 --- a/.github/workflows/verify_generation.yml +++ b/.github/workflows/verify_generation.yml @@ -19,9 +19,11 @@ jobs: python-version: "3.11" - name: Install dependencies + env: + UV_EXCLUDE_NEWER: P3D # reject packages uploaded within the last 3 days (supply chain protection) run: | uv venv - uv pip install --exclude-newer P3D -r requirements.txt + uv pip install -r requirements.txt - name: Generate all tutorials run: |