|
| 1 | +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: BSD-3-Clause |
| 5 | + |
| 6 | +""" |
| 7 | +Setup: |
| 8 | + - (none: the test resolves dependencies only and does not install anything) |
| 9 | +Tests: |
| 10 | + - uv lock --upgrade --dry-run -> verify the full dependency graph (all extras, all |
| 11 | + platforms) re-resolves from the live public indexes, i.e. ``uv run`` works from |
| 12 | + a bare machine |
| 13 | +""" |
| 14 | + |
| 15 | +from __future__ import annotations |
| 16 | + |
| 17 | +import shutil |
| 18 | + |
| 19 | +import pytest |
| 20 | +from utils import run_cmd |
| 21 | + |
| 22 | + |
| 23 | +@pytest.mark.uv |
| 24 | +@pytest.mark.smoke |
| 25 | +class Test_Uv_Fresh_Resolution_Smoke: |
| 26 | + """A fresh, full-graph resolution must succeed from the public indexes. |
| 27 | +
|
| 28 | + ``uv lock --upgrade --dry-run`` re-resolves every dependency, extra, and platform |
| 29 | + fork from scratch without writing the lockfile or installing anything - exactly |
| 30 | + what ``uv run`` does on a bare machine before the first lock exists. This is the |
| 31 | + check that catches a pin that only resolves against internal infrastructure |
| 32 | + (e.g. an unpublished ``ovphysx==0.5.2+head...`` build) or a marker split uv |
| 33 | + cannot satisfy. |
| 34 | +
|
| 35 | + Complements the neighbouring checks: ``test_uv_lock_check_smoke`` validates the |
| 36 | + committed lock is current, the ``uv_run/`` tests validate the committed lock |
| 37 | + installs and trains, and ``test_uv_universal_resolution_smoke`` covers the base |
| 38 | + dependencies only (no extras). |
| 39 | + """ |
| 40 | + |
| 41 | + @classmethod |
| 42 | + def setup_class(cls): |
| 43 | + if not shutil.which("uv"): |
| 44 | + pytest.skip("uv is not available") |
| 45 | + |
| 46 | + @pytest.mark.timeout(900) |
| 47 | + def test_uv_lock_upgrade_resolves_all_extras_from_public_indexes(self, isaaclab_root): |
| 48 | + """Verify ``uv lock --upgrade --dry-run`` resolves the full graph fresh.""" |
| 49 | + result = run_cmd(["uv", "lock", "--upgrade", "--dry-run"], cwd=isaaclab_root, timeout=880) |
| 50 | + assert result.returncode == 0, ( |
| 51 | + "Fresh full-graph resolution failed, so `uv run` is broken on a bare machine." |
| 52 | + " A dependency (often in an optional extra) no longer resolves from the public" |
| 53 | + f" indexes, or a marker split is unsatisfiable:\n{result.stdout}\n{result.stderr}" |
| 54 | + ) |
0 commit comments