Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/scripts/write_uv_overrides.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Write a uv override file forcing the locally built uipath wheels.

Cross-test workflows build uipath wheels from the PR and run them against
downstream repos (uipath-langchain-python, uipath-integrations-python,
uipath-runtime-python). Those downstreams cap the uipath* version (e.g.
``uipath<2.11.0``), so a backward-compatible minor bump would fail resolution
purely on the cap. uv ``override-dependencies`` ignore the declared version
specifier, so pointing them at the local wheels lets the cross-test exercise the
real new code regardless of the cap.

The script is layout-agnostic: it overrides whatever ``uipath*`` wheels exist
under ``$GITHUB_WORKSPACE/wheels`` (recursively), so it works for the
three-wheel layout (``wheels/<pkg>/dist/*.whl``) and the single-wheel runtime
layout (``wheels/*.whl``) alike.

The resulting override file path is appended to ``GITHUB_ENV`` as ``UV_OVERRIDE``
so every subsequent ``uv`` invocation in the job honors it.
"""

import glob
import os
import pathlib


def main() -> None:
wheels = pathlib.Path(os.environ.get("GITHUB_WORKSPACE", ".")).resolve() / "wheels"

lines = []
for whl in sorted(glob.glob(str(wheels / "**" / "*.whl"), recursive=True)):
# Wheel filename is ``{distribution}-{version}-...whl`` where the
# distribution escapes hyphens to underscores (uipath_core -> uipath-core).
dist = pathlib.Path(whl).name.split("-", 1)[0].replace("_", "-")
if not dist.startswith("uipath"):
continue
lines.append(f"{dist} @ {pathlib.Path(whl).resolve().as_uri()}")

if not lines:
raise SystemExit(f"no uipath wheels found under {wheels}")

out = wheels / "overrides.txt"
out.write_text("\n".join(lines) + "\n")

with open(os.environ["GITHUB_ENV"], "a") as fh:
fh.write(f"UV_OVERRIDE={out}\n")

print("\n".join(lines))


if __name__ == "__main__":
main()
28 changes: 18 additions & 10 deletions .github/workflows/test-uipath-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,17 @@ jobs:
repository: 'UiPath/uipath-integrations-python'
path: 'uipath-integrations-python'

- name: Update uipath packages
- name: Checkout uipath-python scripts
uses: actions/checkout@v4
with:
path: _scripts
sparse-checkout: .github/scripts

- name: Override uipath packages with local wheels
shell: bash
working-directory: uipath-integrations-python/packages/${{ matrix.package }}
run: |
uv add ../../../wheels/uipath-core/dist/*.whl --dev
uv add ../../../wheels/uipath-platform/dist/*.whl --dev
uv add ../../../wheels/uipath/dist/*.whl --dev
PYBIN=$(command -v python || command -v python3)
"$PYBIN" "$GITHUB_WORKSPACE/_scripts/.github/scripts/write_uv_overrides.py"

- name: Install dependencies and run tests
shell: bash
Expand Down Expand Up @@ -202,13 +206,17 @@ jobs:
repository: 'UiPath/uipath-integrations-python'
path: 'uipath-integrations-python'

- name: Update uipath packages
- name: Checkout uipath-python scripts
uses: actions/checkout@v4
with:
path: _scripts
sparse-checkout: .github/scripts

- name: Override uipath packages with local wheels
shell: bash
working-directory: uipath-integrations-python/packages/${{ matrix.package }}
run: |
uv add ../../../wheels/uipath-core/dist/*.whl
uv add ../../../wheels/uipath-platform/dist/*.whl
uv add ../../../wheels/uipath/dist/*.whl
PYBIN=$(command -v python || command -v python3)
"$PYBIN" "$GITHUB_WORKSPACE/_scripts/.github/scripts/write_uv_overrides.py"

- name: Install dependencies
working-directory: uipath-integrations-python/packages/${{ matrix.package }}
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/test-uipath-langchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ jobs:
repository: 'UiPath/uipath-langchain-python'
path: 'uipath-langchain-python'

- name: Update uipath packages
- name: Checkout uipath-python scripts
uses: actions/checkout@v4
with:
path: _scripts
sparse-checkout: .github/scripts

- name: Override uipath packages with local wheels
shell: bash
working-directory: uipath-langchain-python
run: |
uv add ../wheels/uipath-core/dist/*.whl --dev
uv add ../wheels/uipath-platform/dist/*.whl --dev
uv add ../wheels/uipath/dist/*.whl --dev
PYBIN=$(command -v python || command -v python3)
"$PYBIN" "$GITHUB_WORKSPACE/_scripts/.github/scripts/write_uv_overrides.py"

- name: Run uipath-langchain tests
working-directory: uipath-langchain-python
Expand Down Expand Up @@ -146,13 +150,17 @@ jobs:
repository: 'UiPath/uipath-langchain-python'
path: 'uipath-langchain-python'

- name: Update uipath packages
- name: Checkout uipath-python scripts
uses: actions/checkout@v4
with:
path: _scripts
sparse-checkout: .github/scripts

- name: Override uipath packages with local wheels
shell: bash
working-directory: uipath-langchain-python
run: |
uv add ../wheels/uipath-core/dist/*.whl
uv add ../wheels/uipath-platform/dist/*.whl
uv add ../wheels/uipath/dist/*.whl
PYBIN=$(command -v python || command -v python3)
"$PYBIN" "$GITHUB_WORKSPACE/_scripts/.github/scripts/write_uv_overrides.py"

- name: Install dependencies
working-directory: uipath-langchain-python
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/test-uipath-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ jobs:
repository: 'UiPath/uipath-runtime-python'
path: 'uipath-runtime-python'

- name: Update uipath-core version
- name: Checkout uipath-python scripts
uses: actions/checkout@v4
with:
path: _scripts
sparse-checkout: .github/scripts

- name: Override uipath packages with local wheels
shell: bash
working-directory: uipath-runtime-python
run: uv add ../wheels/*.whl --dev
run: |
PYBIN=$(command -v python || command -v python3)
"$PYBIN" "$GITHUB_WORKSPACE/_scripts/.github/scripts/write_uv_overrides.py"

- name: Run uipath-runtime tests
working-directory: uipath-runtime-python
Expand Down
Loading