diff --git a/schema/model.py b/schema/model.py index f17eb3ad2f..53641fe577 100644 --- a/schema/model.py +++ b/schema/model.py @@ -207,7 +207,7 @@ class MatchspecTable(StrictBaseModel): channel: NonEmptyStr | None = Field( None, description="The channel the packages needs to be fetched from", - examples=["conda-forge", "pytorch", "https://repo.prefix.dev/conda-forge"], + examples=["conda-forge", "pytorch", "https://prefix.dev/conda-forge"], ) subdir: NonEmptyStr | None = Field( None, description="The subdir of the package, also known as platform" diff --git a/schema/schema.json b/schema/schema.json index 9e313002f7..2d52363e2a 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -369,7 +369,7 @@ "examples": [ "conda-forge", "pytorch", - "https://repo.prefix.dev/conda-forge" + "https://prefix.dev/conda-forge" ] }, "file-name": { @@ -849,7 +849,7 @@ "examples": [ "conda-forge", "pytorch", - "https://repo.prefix.dev/conda-forge" + "https://prefix.dev/conda-forge" ] }, "file-name": { diff --git a/tests/data/pixi_tomls/dependency_overrides.toml b/tests/data/pixi_tomls/dependency_overrides.toml deleted file mode 100644 index 0acd2f4efc..0000000000 --- a/tests/data/pixi_tomls/dependency_overrides.toml +++ /dev/null @@ -1,25 +0,0 @@ -[project] -channels = ["conda-forge"] -description = "Package management made easy!" -name = "no_build" -platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] -version = "0.1.0" - -[dependencies] -python = "3.11.*" - -[pypi-options] -dependency-overrides = { numpy = ">=2.1.0" } - -[pypi-dependencies] -numpy = ">=1.25.0" - -[feature.dev.pypi-options.dependency-overrides] -numpy = "==2.0.0" - -[feature.outdated.pypi-options.dependency-overrides] -numpy = "==1.21.0" - -[environments] -dev = ["dev"] -outdated = ["outdated"] diff --git a/tests/integration_python/common.py b/tests/integration_python/common.py index d40c4fc3d6..d604ae4c68 100644 --- a/tests/integration_python/common.py +++ b/tests/integration_python/common.py @@ -22,6 +22,8 @@ platforms = ["{CURRENT_PLATFORM}"] """ +CONDA_FORGE_CHANNEL = "https://prefix.dev/conda-forge" + class ExitCode(IntEnum): SUCCESS = 0 diff --git a/tests/integration_python/conftest.py b/tests/integration_python/conftest.py index f388eb67ce..08b6ea1188 100644 --- a/tests/integration_python/conftest.py +++ b/tests/integration_python/conftest.py @@ -2,7 +2,7 @@ import pytest -from .common import exec_extension +from .common import exec_extension, CONDA_FORGE_CHANNEL def pytest_addoption(parser: pytest.Parser) -> None: @@ -23,9 +23,9 @@ def pixi(request: pytest.FixtureRequest) -> Path: @pytest.fixture def tmp_pixi_workspace(tmp_path: Path) -> Path: - pixi_config = """ + pixi_config = f""" # Reset to defaults -default-channels = ["conda-forge"] +default-channels = ["{CONDA_FORGE_CHANNEL}"] shell.change-ps1 = true tls-no-verify = false detached-environments = false diff --git a/tests/integration_python/test_edge_cases.py b/tests/integration_python/test_edge_cases.py index cd1ef49b11..45ec207bde 100644 --- a/tests/integration_python/test_edge_cases.py +++ b/tests/integration_python/test_edge_cases.py @@ -7,7 +7,7 @@ import tomli import tomli_w -from .common import CURRENT_PLATFORM, verify_cli_command, ExitCode +from .common import CURRENT_PLATFORM, verify_cli_command, ExitCode, CONDA_FORGE_CHANNEL @pytest.mark.extra_slow @@ -414,7 +414,7 @@ def test_installation_pypi_conda_mismatch( def test_pypi_url_fragment_in_project_deps(tmp_pixi_workspace: Path, pixi: Path) -> None: - pyproject_content = """ + pyproject_content = f""" [project] version = "0.1.0" name = "test" @@ -428,11 +428,11 @@ def test_pypi_url_fragment_in_project_deps(tmp_pixi_workspace: Path, pixi: Path) build-backend = "hatchling.build" [tool.pixi.workspace] -platforms = ["linux-64", "osx-arm64", "win-64"] -channels = ["https://prefix.dev/conda-forge"] +platforms = ["{CURRENT_PLATFORM}"] +channels = ["{CONDA_FORGE_CHANNEL}"] [tool.pixi.pypi-dependencies] -test = { path = ".", editable = true } +test = {{ path = ".", editable = true }} [tool.hatch.metadata] allow-direct-references = true @@ -516,7 +516,7 @@ def test_issue_4123_cache_prevents_editable_install( (proj1 / "pixi.toml").write_text(f"""[project] name = "proj1" -channels = ["conda-forge"] +channels = ["{CONDA_FORGE_CHANNEL}"] platforms = ["{CURRENT_PLATFORM}"] [dependencies] python = "3.12.*" @@ -531,7 +531,7 @@ def test_issue_4123_cache_prevents_editable_install( (proj2 / "pixi.toml").write_text(f"""[project] name = "proj2" -channels = ["conda-forge"] +channels = ["{CONDA_FORGE_CHANNEL}"] platforms = ["{CURRENT_PLATFORM}"] [dependencies] python = "3.12.*" diff --git a/tests/integration_python/test_main_cli.py b/tests/integration_python/test_main_cli.py index 0b3aa3bb0c..2146bff633 100644 --- a/tests/integration_python/test_main_cli.py +++ b/tests/integration_python/test_main_cli.py @@ -1344,6 +1344,7 @@ def test_pixi_task_list_json( assert task_data == snapshot +@pytest.mark.extra_slow def test_info_output_extended( pixi: Path, tmp_pixi_workspace: Path, snapshot: SnapshotAssertion ) -> None: diff --git a/tests/integration_python/test_pypi_options.py b/tests/integration_python/test_pypi_options.py index b9c283a29d..d013038ee4 100644 --- a/tests/integration_python/test_pypi_options.py +++ b/tests/integration_python/test_pypi_options.py @@ -1,6 +1,8 @@ from pathlib import Path import pytest -from .common import verify_cli_command, ExitCode +import yaml + +from .common import verify_cli_command, ExitCode, CURRENT_PLATFORM, CONDA_FORGE_CHANNEL @pytest.mark.extra_slow @@ -27,19 +29,52 @@ def test_pypi_overrides(pixi: Path, tmp_pixi_workspace: Path) -> None: Tests the behavior of pixi install command with dependency overrides specified in pixi.toml. This test verifies that the installation succeeds when the overrides are correctly defined. """ - test_data = Path(__file__).parent.parent / "data/pixi_tomls/dependency_overrides.toml" - # prepare if we would like to assert exactly same lock file - # test_lock_data = Path(__file__).parent.parent / "data/lockfiles/dependency_overrides.lock" manifest = tmp_pixi_workspace.joinpath("pixi.toml") + manifest_content = f""" + [workspace] + channels = ["{CONDA_FORGE_CHANNEL}"] + platforms = ["{CURRENT_PLATFORM}"] + + [dependencies] + python = "3.13.*" + + [pypi-options.dependency-overrides] + dummy_test = "==0.1.3" + + [pypi-dependencies] + dummy_test = "==0.1.1" + + [feature.dev.pypi-options.dependency-overrides] + dummy_test = "==0.1.2" + + [feature.outdated.pypi-options.dependency-overrides] + dummy_test = "==0.1.0" + + [environments] + dev = ["dev"] + outdated = ["outdated"] + """ + manifest.write_text(manifest_content) lock_file_path = tmp_pixi_workspace.joinpath("pixi.lock") - toml = test_data.read_text() - manifest.write_text(toml) # Run the installation - verify_cli_command([pixi, "install", "--manifest-path", manifest]) - lock_file_content = lock_file_path.read_text() + verify_cli_command([pixi, "lock", "--manifest-path", manifest]) - # numpy 2.0.0 is overriding the dev env - assert "numpy-2.0.0" in lock_file_content - # numpy 1.21.0 is overriding the outdated env - assert "numpy-1.21.0" in lock_file_content + with open(lock_file_path, "r") as f: + lock = yaml.safe_load(f) + + assert any( + "dummy_test-0.1.2" in v + for pkg in lock["environments"]["dev"]["packages"][CURRENT_PLATFORM] + for v in pkg.values() + ) + assert any( + "dummy_test-0.1.3" in v + for pkg in lock["environments"]["default"]["packages"][CURRENT_PLATFORM] + for v in pkg.values() + ) + assert any( + "dummy_test-0.1.0" in v + for pkg in lock["environments"]["outdated"]["packages"][CURRENT_PLATFORM] + for v in pkg.values() + ) diff --git a/tests/integration_python/test_reinstall.py b/tests/integration_python/test_reinstall.py index 41995574fc..4cd1bf0e29 100644 --- a/tests/integration_python/test_reinstall.py +++ b/tests/integration_python/test_reinstall.py @@ -13,7 +13,7 @@ def reinstall_workspace(tmp_pixi_workspace: Path, mock_projects: Path) -> Path: return tmp_pixi_workspace -@pytest.mark.slow +@pytest.mark.extra_slow def test_pixi_reinstall_default_env(pixi: Path, reinstall_workspace: Path) -> None: env = { "PIXI_CACHE_DIR": str(reinstall_workspace.joinpath("pixi_cache")), diff --git a/tests/integration_rust/snapshots/integration_rust__upgrade_tests__pypi_dependency_index_preserved_on_upgrade.snap b/tests/integration_rust/snapshots/integration_rust__upgrade_tests__pypi_dependency_index_preserved_on_upgrade.snap index f73da00706..3b29b31d41 100644 --- a/tests/integration_rust/snapshots/integration_rust__upgrade_tests__pypi_dependency_index_preserved_on_upgrade.snap +++ b/tests/integration_rust/snapshots/integration_rust__upgrade_tests__pypi_dependency_index_preserved_on_upgrade.snap @@ -3,7 +3,7 @@ source: tests/integration_rust/upgrade_tests.rs expression: redacted_content --- [workspace] - channels = ["conda-forge"] + channels = ["https://prefix.dev/conda-forge"] platforms = ["[PLATFORM]"] exclude-newer = "2025-05-19" diff --git a/tests/integration_rust/upgrade_tests.rs b/tests/integration_rust/upgrade_tests.rs index 1ff5aaaabb..8e16dbc634 100644 --- a/tests/integration_rust/upgrade_tests.rs +++ b/tests/integration_rust/upgrade_tests.rs @@ -14,7 +14,7 @@ async fn pypi_dependency_index_preserved_on_upgrade() { let pixi = PixiControl::from_manifest(&format!( r#" [workspace] - channels = ["conda-forge"] + channels = ["https://prefix.dev/conda-forge"] platforms = ["{platform}"] exclude-newer = "2025-05-19"