From 3b98b16a75e2a79ec2c1dd8cf1c616c91e999f06 Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Fri, 26 Apr 2024 09:22:08 +0200 Subject: [PATCH 1/6] fix: improve absolute path satisfiability (#1252) Co-authored-by: Bas Zalmstra Co-authored-by: Bas Zalmstra Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ZhengYu, Xu Co-authored-by: Olivier Lacroix Co-authored-by: Ruben Arts --- Cargo.toml | 40 +-- src/lock_file/satisfiability.rs | 39 ++- tests/satisfiability/absolute-paths/pixi.lock | 263 ++++++++++++++++++ tests/satisfiability/absolute-paths/pixi.toml | 11 + .../projects/foo/pyproject.toml | 17 ++ 5 files changed, 347 insertions(+), 23 deletions(-) create mode 100644 tests/satisfiability/absolute-paths/pixi.lock create mode 100644 tests/satisfiability/absolute-paths/pixi.toml create mode 100644 tests/satisfiability/absolute-paths/projects/foo/pyproject.toml diff --git a/Cargo.toml b/Cargo.toml index a2edcb0bf..287abb354 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -164,25 +164,27 @@ toml = "0.8.12" pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } # deno_task_shell = { path = "../deno_task_shell" } -# rattler = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_conda_types = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_digest = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_lock = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_networking = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_repodata_gateway = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_shell = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_solve = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_virtual_packages = { git = "https://github.com/mamba-org/rattler", branch = "main" } -# rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" } -# rattler_digest = { path = "../rattler/crates/rattler_digest" } -# rattler_networking = { path = "../rattler/crates/rattler_networking" } -# rattler_repodata_gateway = { path = "../rattler/crates/rattler_repodata_gateway" } -# rattler_shell = { path = "../rattler/crates/rattler_shell" } -# rattler_solve = { path = "../rattler/crates/rattler_solve" } -# rattler_virtual_packages = { path = "../rattler/crates/rattler_virtual_packages" } -# rattler_lock = { path = "../rattler/crates/rattler_lock" } -# rattler_package_streaming = { path = "../rattler/crates/rattler_package_streaming" } -# rattler = { path = "../rattler/crates/rattler" } + +# rattler = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_conda_types = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_digest = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_lock = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_networking = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_repodata_gateway = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_shell = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_solve = { git = "https://github.com/baszalmstra/rattler", branch = "main" } +# rattler_virtual_packages = { git = "https://github.com/baszalmstra/rattler", branch = "main" } + +#rattler_conda_types = { path = "../rattler/crates/rattler_conda_types" } +#rattler_digest = { path = "../rattler/crates/rattler_digest" } +#rattler_networking = { path = "../rattler/crates/rattler_networking" } +#rattler_repodata_gateway = { path = "../rattler/crates/rattler_repodata_gateway" } +#rattler_shell = { path = "../rattler/crates/rattler_shell" } +#rattler_solve = { path = "../rattler/crates/rattler_solve" } +#rattler_virtual_packages = { path = "../rattler/crates/rattler_virtual_packages" } +#rattler_lock = { path = "../rattler/crates/rattler_lock" } +#rattler_package_streaming = { path = "../rattler/crates/rattler_package_streaming" } +#rattler = { path = "../rattler/crates/rattler" } # Change these lines if you want a patched version of uv # [patch.'https://github.com/astral-sh/uv'] diff --git a/src/lock_file/satisfiability.rs b/src/lock_file/satisfiability.rs index c9def4c2d..296a12cc8 100644 --- a/src/lock_file/satisfiability.rs +++ b/src/lock_file/satisfiability.rs @@ -573,10 +573,11 @@ pub fn verify_package_platform_satisfiability( // If this is path based package we need to check if the source tree hash still matches. // and if it is a directory if let UrlOrPath::Path(path) = &record.0.url_or_path { - let path = dunce::canonicalize(project_root.join(path)).map_err(|e| { - PlatformUnsat::FailedToCanonicalizePath(path.clone(), e) - })?; if path.is_dir() { + let path = + dunce::canonicalize(project_root.join(path)).map_err(|e| { + PlatformUnsat::FailedToCanonicalizePath(path.clone(), e) + })?; let hashable = PypiSourceTreeHashable::from_directory(path) .map_err(|e| { PlatformUnsat::FailedToDetermineSourceTreeHash( @@ -801,7 +802,8 @@ mod tests { use pep440_rs::Version; use rattler_lock::LockFile; use rstest::rstest; - use std::{path::PathBuf, str::FromStr}; + use std::ffi::OsStr; + use std::{path::Component, path::PathBuf, str::FromStr}; #[derive(Error, Debug, Diagnostic)] enum LockfileUnsat { @@ -842,6 +844,16 @@ mod tests { fn test_good_satisfiability( #[files("tests/satisfiability/*/pixi.toml")] manifest_path: PathBuf, ) { + // TODO: skip this test on windows + // Until we can figure out how to handle unix file paths with pep508_rs url parsing correctly + if manifest_path + .components() + .contains(&Component::Normal(OsStr::new("absolute-paths"))) + && cfg!(windows) + { + return; + } + let project = Project::load(&manifest_path).unwrap(); let lock_file = LockFile::from_path(&project.lock_file_path()).unwrap(); match verify_lockfile_satisfiability(&project, &lock_file).into_diagnostic() { @@ -904,4 +916,23 @@ mod tests { let spec = Requirement::from_str("mypkg @ git+https://github.com/mypkg").unwrap(); assert!(pypi_satifisfies_requirement(&locked_data, &spec)); } + + // Currently this test is missing from `good_satisfiability`, so we test the specific windows case here + // this should work an all supported platforms + #[test] + fn test_windows_absolute_path_handling() { + // Mock locked data + let locked_data = PypiPackageData { + name: "mypkg".parse().unwrap(), + version: Version::from_str("0.1.0").unwrap(), + url_or_path: UrlOrPath::Path(PathBuf::from_str("C:\\Users\\username\\mypkg").unwrap()), + hash: None, + requires_dist: vec![], + requires_python: None, + editable: false, + }; + let spec = Requirement::from_str("mypkg @ file:///C:\\Users\\username\\mypkg").unwrap(); + // This should satisfy: + assert!(pypi_satifisfies_requirement(&locked_data, &spec)); + } } diff --git a/tests/satisfiability/absolute-paths/pixi.lock b/tests/satisfiability/absolute-paths/pixi.lock new file mode 100644 index 000000000..29002bd4d --- /dev/null +++ b/tests/satisfiability/absolute-paths/pixi.lock @@ -0,0 +1,263 @@ +version: 4 +environments: + default: + channels: + - url: https://conda.anaconda.org/conda-forge/ + packages: + osx-arm64: + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h93a5062_5.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.2.2-hf0a4a13_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.2-hebf3989_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.45.3-h091b4b1_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.2.13-h53f4e23_5.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.4.20240210-h078ce10_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.2.1-h0d3ecfb_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.12.0-h47c9636_0_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h5083fa2_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2 + - pypi: https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/3a/52/9f9d17c3b54dc238de384c4cb5a2ef0e27985b42a0e5cc8e8a31d918d48d/charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl + - pypi: https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl + - pypi: https://files.pythonhosted.org/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl + - pypi: /Users/tdejager/development/prefix/pixi/tests/satisfiability/absolute-paths/projects/requests-2.31.0-py3-none-any.whl + - pypi: ./projects/foo +packages: +- kind: conda + name: bzip2 + version: 1.0.8 + build: h93a5062_5 + build_number: 5 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-h93a5062_5.conda + sha256: bfa84296a638bea78a8bb29abc493ee95f2a0218775642474a840411b950fe5f + md5: 1bbc659ca658bfd49a481b5ef7a0f40f + license: bzip2-1.0.6 + license_family: BSD + size: 122325 + timestamp: 1699280294368 +- kind: conda + name: ca-certificates + version: 2024.2.2 + build: hf0a4a13_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ca-certificates-2024.2.2-hf0a4a13_0.conda + sha256: 49bc3439816ac72d0c0e0f144b8cc870fdcc4adec2e861407ec818d8116b2204 + md5: fb416a1795f18dcc5a038bc2dc54edf9 + license: ISC + size: 155725 + timestamp: 1706844034242 +- kind: pypi + name: certifi + version: 2024.2.2 + url: https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl + sha256: dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1 + requires_python: '>=3.6' +- kind: pypi + name: charset-normalizer + version: 3.3.2 + url: https://files.pythonhosted.org/packages/3a/52/9f9d17c3b54dc238de384c4cb5a2ef0e27985b42a0e5cc8e8a31d918d48d/charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl + sha256: 55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6 + requires_python: '>=3.7.0' +- kind: pypi + name: foo + version: 0.1.0 + path: ./projects/foo + sha256: 4c7329c4617e93d0bb49490a455a924edbb83b61807cf74183d67c13cb80b2b8 + requires_dist: + - requests @ file:///Users/tdejager/development/prefix/pixi/tests/satisfiability/absolute-paths/projects/requests-2.31.0-py3-none-any.whl + requires_python: '>=3.11' + editable: true +- kind: pypi + name: idna + version: '3.7' + url: https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl + sha256: 82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 + requires_python: '>=3.5' +- kind: conda + name: libexpat + version: 2.6.2 + build: hebf3989_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.6.2-hebf3989_0.conda + sha256: ba7173ac30064ea901a4c9fb5a51846dcc25512ceb565759be7d18cbf3e5415e + md5: e3cde7cfa87f82f7cb13d482d5e0ad09 + constrains: + - expat 2.6.2.* + license: MIT + license_family: MIT + size: 63655 + timestamp: 1710362424980 +- kind: conda + name: libffi + version: 3.4.2 + build: h3422bc3_5 + build_number: 5 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.4.2-h3422bc3_5.tar.bz2 + sha256: 41b3d13efb775e340e4dba549ab5c029611ea6918703096b2eaa9c015c0750ca + md5: 086914b672be056eb70fd4285b6783b6 + license: MIT + license_family: MIT + size: 39020 + timestamp: 1636488587153 +- kind: conda + name: libsqlite + version: 3.45.3 + build: h091b4b1_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.45.3-h091b4b1_0.conda + sha256: 4337f466eb55bbdc74e168b52ec8c38f598e3664244ec7a2536009036e2066cc + md5: c8c1186c7f3351f6ffddb97b1f54fc58 + depends: + - libzlib >=1.2.13,<1.3.0a0 + license: Unlicense + size: 824794 + timestamp: 1713367748819 +- kind: conda + name: libzlib + version: 1.2.13 + build: h53f4e23_5 + build_number: 5 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.2.13-h53f4e23_5.conda + sha256: ab1c8aefa2d54322a63aaeeefe9cf877411851738616c4068e0dccc66b9c758a + md5: 1a47f5236db2e06a320ffa0392f81bd8 + constrains: + - zlib 1.2.13 *_5 + license: Zlib + license_family: Other + size: 48102 + timestamp: 1686575426584 +- kind: conda + name: ncurses + version: 6.4.20240210 + build: h078ce10_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.4.20240210-h078ce10_0.conda + sha256: 06f0905791575e2cd3aa961493c56e490b3d82ad9eb49f1c332bd338b0216911 + md5: 616ae8691e6608527d0071e6766dcb81 + license: X11 AND BSD-3-Clause + size: 820249 + timestamp: 1710866874348 +- kind: conda + name: openssl + version: 3.2.1 + build: h0d3ecfb_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.2.1-h0d3ecfb_1.conda + sha256: 519dc941d7ab0ebf31a2878d85c2f444450e7c5f6f41c4d07252c6bb3417b78b + md5: eb580fb888d93d5d550c557323ac5cee + depends: + - ca-certificates + constrains: + - pyopenssl >=22.1 + license: Apache-2.0 + license_family: Apache + size: 2855250 + timestamp: 1710793435903 +- kind: conda + name: python + version: 3.12.0 + build: h47c9636_0_cpython + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.12.0-h47c9636_0_cpython.conda + sha256: eb66f8f249caa9d5a956c3a407f079e4779d652ebfc2a4b4f50dcea078e84fa8 + md5: ed8ae98b1b510de68392971b9367d18c + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.5.0,<3.0a0 + - libffi >=3.4,<4.0a0 + - libsqlite >=3.43.0,<4.0a0 + - libzlib >=1.2.13,<1.3.0a0 + - ncurses >=6.4,<7.0a0 + - openssl >=3.1.3,<4.0a0 + - readline >=8.2,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - xz >=5.2.6,<6.0a0 + constrains: + - python_abi 3.12.* *_cp312 + license: Python-2.0 + size: 13306758 + timestamp: 1696322682581 +- kind: conda + name: readline + version: '8.2' + build: h92ec313_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.2-h92ec313_1.conda + sha256: a1dfa679ac3f6007362386576a704ad2d0d7a02e98f5d0b115f207a2da63e884 + md5: 8cbb776a2f641b943d413b3e19df71f4 + depends: + - ncurses >=6.3,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 250351 + timestamp: 1679532511311 +- kind: pypi + name: requests + version: 2.31.0 + path: /Users/tdejager/development/prefix/pixi/tests/satisfiability/absolute-paths/projects/requests-2.31.0-py3-none-any.whl + requires_dist: + - charset-normalizer<4,>=2 + - idna<4,>=2.5 + - urllib3<3,>=1.21.1 + - certifi>=2017.4.17 + - pysocks!=1.5.7,>=1.5.6 ; extra == 'socks' + - chardet<6,>=3.0.2 ; extra == 'use_chardet_on_py3' + requires_python: '>=3.7' +- kind: conda + name: tk + version: 8.6.13 + build: h5083fa2_1 + build_number: 1 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h5083fa2_1.conda + sha256: 72457ad031b4c048e5891f3f6cb27a53cb479db68a52d965f796910e71a403a8 + md5: b50a57ba89c32b62428b71a875291c9b + depends: + - libzlib >=1.2.13,<1.3.0a0 + license: TCL + license_family: BSD + size: 3145523 + timestamp: 1699202432999 +- kind: conda + name: tzdata + version: 2024a + build: h0c530f3_0 + subdir: noarch + noarch: generic + url: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024a-h0c530f3_0.conda + sha256: 7b2b69c54ec62a243eb6fba2391b5e443421608c3ae5dbff938ad33ca8db5122 + md5: 161081fc7cec0bfda0d86d7cb595f8d8 + license: LicenseRef-Public-Domain + size: 119815 + timestamp: 1706886945727 +- kind: pypi + name: urllib3 + version: 2.2.1 + url: https://files.pythonhosted.org/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl + sha256: 450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d + requires_dist: + - brotli>=1.0.9 ; platform_python_implementation == 'CPython' and extra == 'brotli' + - brotlicffi>=0.8.0 ; platform_python_implementation != 'CPython' and extra == 'brotli' + - h2<5,>=4 ; extra == 'h2' + - pysocks!=1.5.7,<2.0,>=1.5.6 ; extra == 'socks' + - zstandard>=0.18.0 ; extra == 'zstd' + requires_python: '>=3.8' +- kind: conda + name: xz + version: 5.2.6 + build: h57fd34a_0 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2 + sha256: 59d78af0c3e071021cfe82dc40134c19dab8cdf804324b62940f5c8cd71803ec + md5: 39c6b54e94014701dd157f4f576ed211 + license: LGPL-2.1 and GPL-2.0 + size: 235693 + timestamp: 1660346961024 diff --git a/tests/satisfiability/absolute-paths/pixi.toml b/tests/satisfiability/absolute-paths/pixi.toml new file mode 100644 index 000000000..b4b65d881 --- /dev/null +++ b/tests/satisfiability/absolute-paths/pixi.toml @@ -0,0 +1,11 @@ +[project] +name = "absolute-paths" +version = "0.1.0" +channels = ["conda-forge"] +platforms = ["osx-arm64"] + +[dependencies] +python = "3.12" + +[pypi-dependencies] +foo = { path = "./projects/foo", editable = true } diff --git a/tests/satisfiability/absolute-paths/projects/foo/pyproject.toml b/tests/satisfiability/absolute-paths/projects/foo/pyproject.toml new file mode 100644 index 000000000..b2dd64337 --- /dev/null +++ b/tests/satisfiability/absolute-paths/projects/foo/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "foo" +version = "0.1.0" +description = "Add a short description here" +authors = [{ name = "Tim de Jager", email = "tim@prefix.dev" }] +requires-python = ">= 3.11" +dependencies = [ + "requests @ file:///Users/tdejager/development/prefix/pixi/tests/satisfiability/absolute-paths/projects/requests-2.31.0-py3-none-any.whl", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pixi.project] +channels = ["conda-forge"] +platforms = ["osx-arm64"] From ff50c044dbac69ef93a2bfdab197e177a4f9b997 Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Fri, 26 Apr 2024 10:18:39 +0200 Subject: [PATCH 2/6] feat: update to uv 0.1.38 (#1278) --- Cargo.lock | 126 ++++++++++++++++++++------------ Cargo.toml | 48 ++++++------ src/install_pypi.rs | 4 +- src/lock_file/satisfiability.rs | 10 +-- 4 files changed, 112 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bb559170..bdb973826 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,6 +139,15 @@ version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "archspec" version = "0.1.3" @@ -666,7 +675,7 @@ dependencies = [ [[package]] name = "cache-key" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "hex", "seahash", @@ -1053,6 +1062,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "dialoguer" version = "0.11.0" @@ -1110,7 +1130,7 @@ dependencies = [ [[package]] name = "distribution-filename" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "pep440_rs", "platform-tags", @@ -1124,12 +1144,13 @@ dependencies = [ [[package]] name = "distribution-types" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "cache-key", "distribution-filename", "fs-err", + "git2", "itertools", "once_cell", "pep440_rs", @@ -2019,7 +2040,7 @@ dependencies = [ [[package]] name = "install-wheel-rs" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "configparser", "csv", @@ -2045,7 +2066,7 @@ dependencies = [ "uv-fs", "uv-normalize", "walkdir", - "zip", + "zip 1.1.1", ] [[package]] @@ -2689,7 +2710,7 @@ dependencies = [ [[package]] name = "once-map" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "dashmap", "tokio", @@ -2911,7 +2932,7 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pep440_rs" version = "0.5.0" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "once_cell", "rkyv", @@ -2923,7 +2944,7 @@ dependencies = [ [[package]] name = "pep508_rs" version = "0.4.2" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "derivative", "once_cell", @@ -3132,7 +3153,7 @@ dependencies = [ "uv-resolver", "uv-types", "xxhash-rust", - "zip", + "zip 1.1.1", ] [[package]] @@ -3154,7 +3175,7 @@ dependencies = [ [[package]] name = "platform-tags" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "rustc-hash", "serde", @@ -3317,7 +3338,7 @@ dependencies = [ [[package]] name = "pypi-types" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "chrono", "indexmap 2.2.6", @@ -3574,7 +3595,7 @@ dependencies = [ "tokio", "tokio-util", "url", - "zip", + "zip 0.6.6", "zstd", ] @@ -3802,7 +3823,7 @@ dependencies = [ [[package]] name = "requirements-txt" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "fs-err", "pep508_rs", @@ -3820,9 +3841,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "async-compression", "base64 0.22.0", @@ -5212,16 +5233,19 @@ dependencies = [ [[package]] name = "uv-auth" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ + "anyhow", "async-trait", "base64 0.22.0", + "futures", "http", + "once-map", "once_cell", "reqwest", "reqwest-middleware", "rust-netrc", - "thiserror", + "tokio", "tracing", "url", "urlencoding", @@ -5230,7 +5254,7 @@ dependencies = [ [[package]] name = "uv-build" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "distribution-types", @@ -5259,7 +5283,7 @@ dependencies = [ [[package]] name = "uv-cache" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "cache-key", "cachedir", @@ -5282,7 +5306,7 @@ dependencies = [ [[package]] name = "uv-client" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "async-trait", @@ -5329,21 +5353,23 @@ dependencies = [ [[package]] name = "uv-configuration" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "itertools", "pep508_rs", + "platform-tags", "rustc-hash", "serde", "serde_json", + "uv-auth", "uv-normalize", ] [[package]] name = "uv-dispatch" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "distribution-types", @@ -5366,7 +5392,7 @@ dependencies = [ [[package]] name = "uv-distribution" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "cache-key", @@ -5375,7 +5401,6 @@ dependencies = [ "fs-err", "futures", "install-wheel-rs", - "md-5", "nanoid", "once_cell", "pep440_rs", @@ -5387,7 +5412,6 @@ dependencies = [ "rmp-serde", "rustc-hash", "serde", - "sha2", "tempfile", "thiserror", "tokio", @@ -5402,13 +5426,13 @@ dependencies = [ "uv-git", "uv-normalize", "uv-types", - "zip", + "zip 1.1.1", ] [[package]] name = "uv-extract" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "async-compression", "async_zip", @@ -5424,13 +5448,13 @@ dependencies = [ "tokio-tar", "tokio-util", "tracing", - "zip", + "zip 1.1.1", ] [[package]] name = "uv-fs" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "backoff", "dunce", @@ -5450,7 +5474,7 @@ dependencies = [ [[package]] name = "uv-git" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "base64 0.22.0", @@ -5473,7 +5497,7 @@ dependencies = [ [[package]] name = "uv-installer" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "async-channel", @@ -5487,7 +5511,6 @@ dependencies = [ "pypi-types", "rayon", "requirements-txt", - "rmp-serde", "rustc-hash", "serde", "tempfile", @@ -5512,7 +5535,7 @@ dependencies = [ [[package]] name = "uv-interpreter" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "cache-key", "configparser", @@ -5534,6 +5557,7 @@ dependencies = [ "uv-cache", "uv-fs", "uv-toolchain", + "uv-warnings", "which", "winapi", ] @@ -5541,7 +5565,7 @@ dependencies = [ [[package]] name = "uv-normalize" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "rkyv", "serde", @@ -5550,7 +5574,7 @@ dependencies = [ [[package]] name = "uv-resolver" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anstream", "anyhow", @@ -5596,7 +5620,7 @@ dependencies = [ [[package]] name = "uv-toolchain" version = "0.1.0" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "fs-err", @@ -5608,7 +5632,6 @@ dependencies = [ "reqwest-middleware", "tempfile", "thiserror", - "tokio", "tokio-util", "tracing", "url", @@ -5620,18 +5643,16 @@ dependencies = [ [[package]] name = "uv-types" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anyhow", "distribution-types", - "itertools", "once-map", "pep440_rs", "pep508_rs", "pypi-types", + "requirements-txt", "rustc-hash", - "serde", - "serde_json", "thiserror", "url", "uv-cache", @@ -5642,13 +5663,13 @@ dependencies = [ [[package]] name = "uv-version" -version = "0.1.32" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +version = "0.1.38" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" [[package]] name = "uv-virtualenv" version = "0.0.4" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anstream", "cachedir", @@ -5662,12 +5683,13 @@ dependencies = [ "uv-cache", "uv-fs", "uv-interpreter", + "uv-version", ] [[package]] name = "uv-warnings" version = "0.0.1" -source = "git+https://github.com/astral-sh/uv?tag=0.1.32#f6b1580d8bd5388d80592701a02d0e77a199ddd5" +source = "git+https://github.com/astral-sh/uv?tag=0.1.38#0b23caa18d7eb2f874d73e57b7b4bdf35e881a46" dependencies = [ "anstream", "once_cell", @@ -6252,6 +6274,20 @@ dependencies = [ "time", ] +[[package]] +name = "zip" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2655979068a1f8fa91cb9e8e5b9d3ee54d18e0ddc358f2f4a395afc0929a84b" +dependencies = [ + "arbitrary", + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", + "time", +] + [[package]] name = "zstd" version = "0.13.1" diff --git a/Cargo.toml b/Cargo.toml index 287abb354..f6a7b0b2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,8 +45,8 @@ crossbeam-channel = "0.5.12" deno_task_shell = "0.16.0" dialoguer = "0.11.0" dirs = "5.0.1" -distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } +distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } dunce = "1.0.4" flate2 = "1.0.28" futures = "0.3.30" @@ -57,7 +57,7 @@ ignore = "0.4.22" indexmap = { version = "2.2.6", features = ["serde"] } indicatif = "0.17.8" -install-wheel-rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } +install-wheel-rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } is_executable = "1.0.1" itertools = "0.12.1" lazy_static = "1.4.0" @@ -71,10 +71,10 @@ miette = { version = "7.2.0", features = [ ] } minijinja = { version = "1.0.20", features = ["builtins"] } once_cell = "1.19.0" -pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } +pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +platform-tags = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } pyproject-toml = "0.10.0" rattler = { version = "0.23.0", default-features = false, features = [ "cli-tools", @@ -94,8 +94,8 @@ rattler_solve = { version = "0.20.7", default-features = false, features = [ ] } rattler_virtual_packages = { version = "0.19.8", default-features = false } regex = "1.10.4" -requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -reqwest = { version = "0.12.3", default-features = false } +requirements-txt = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +reqwest = { version = "0.12.4", default-features = false } reqwest-middleware = "0.3.0" reqwest-retry = "0.5.0" self-replace = "1.3.7" @@ -121,20 +121,20 @@ toml_edit = { version = "0.22.11", features = ["serde"] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } url = "2.5.0" -uv-build = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-interpreter = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } +uv-build = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-interpreter = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-normalize = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } xxhash-rust = "0.8.10" -zip = { version = "0.6.6", default-features = false, features = [ +zip = { version = "1.1.1", default-features = false, features = [ "deflate", "time", ] } @@ -161,8 +161,8 @@ toml = "0.8.12" [patch.crates-io] # For pyproject-toml # If you change this also change the versions in the the patch section for uv -pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } -pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.32" } +pep440_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } +pep508_rs = { git = "https://github.com/astral-sh/uv", tag = "0.1.38" } # deno_task_shell = { path = "../deno_task_shell" } # rattler = { git = "https://github.com/baszalmstra/rattler", branch = "main" } diff --git a/src/install_pypi.rs b/src/install_pypi.rs index 8d231b66c..70eb0b81a 100644 --- a/src/install_pypi.rs +++ b/src/install_pypi.rs @@ -25,7 +25,7 @@ use crate::project::manifest::SystemRequirements; use crate::pypi_tags::{get_pypi_tags, is_python_record}; use distribution_types::{ - CachedDist, DirectGitUrl, Dist, IndexUrl, InstalledDist, LocalEditable, LocalEditables, Name, + CachedDist, Dist, IndexUrl, InstalledDist, LocalEditable, LocalEditables, Name, ParsedGitUrl, }; use install_wheel_rs::linker::LinkMode; @@ -331,7 +331,7 @@ fn need_reinstall( } => { let url = Url::parse(&url).into_diagnostic()?; let git_url = match &locked.url_or_path { - UrlOrPath::Url(url) => DirectGitUrl::try_from(url), + UrlOrPath::Url(url) => ParsedGitUrl::try_from(url), UrlOrPath::Path(_path) => { // Previously return Ok(ValidateInstall::Reinstall); diff --git a/src/lock_file/satisfiability.rs b/src/lock_file/satisfiability.rs index 296a12cc8..938e2868c 100644 --- a/src/lock_file/satisfiability.rs +++ b/src/lock_file/satisfiability.rs @@ -1,7 +1,7 @@ use super::{PypiRecord, PypiRecordsByName, RepoDataRecordsByName}; use crate::project::manifest::python::{AsPep508Error, RequirementOrEditable}; use crate::{project::Environment, pypi_marker_env::determine_marker_environment}; -use distribution_types::DirectGitUrl; +use distribution_types::ParsedGitUrl; use itertools::Itertools; use miette::Diagnostic; use pep440_rs::VersionSpecifiers; @@ -232,11 +232,11 @@ pub fn pypi_satifisfies_editable( // In the case that both the spec and the locked data are direct git urls // we need to compare the urls to see if they are the same - let spec_git_url = DirectGitUrl::try_from(&spec_url.to_url()).ok(); + let spec_git_url = ParsedGitUrl::try_from(&spec_url.to_url()).ok(); let locked_git_url = locked_data .url_or_path .as_url() - .and_then(|url| DirectGitUrl::try_from(url).ok()); + .and_then(|url| ParsedGitUrl::try_from(url).ok()); // Both are git url's if let (Some(spec_git_url), Some(locked_data_url)) = (spec_git_url, locked_git_url) { @@ -285,11 +285,11 @@ pub fn pypi_satifisfies_requirement(locked_data: &PypiPackageData, spec: &Requir Some(VersionOrUrl::Url(spec_url)) => { // In the case that both the spec and the locked data are direct git urls // we need to compare the urls to see if they are the same - let spec_git_url = DirectGitUrl::try_from(&spec_url.to_url()).ok(); + let spec_git_url = ParsedGitUrl::try_from(&spec_url.to_url()).ok(); let locked_git_url = locked_data .url_or_path .as_url() - .and_then(|url| DirectGitUrl::try_from(url).ok()); + .and_then(|url| ParsedGitUrl::try_from(url).ok()); // Both are git url's if let (Some(spec_git_url), Some(locked_data_url)) = (spec_git_url, locked_git_url) { From 0313aa7cbefe2da1864e660174d7d1c9ed639e21 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Fri, 26 Apr 2024 10:49:50 +0200 Subject: [PATCH 3/6] fix: improve parse deno error and make task a required field in the cli (#1260) --- src/cli/run.rs | 1 + src/task/executable_task.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cli/run.rs b/src/cli/run.rs index 3d96f0bf6..c9d165b59 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -34,6 +34,7 @@ use tracing::Level; #[clap(trailing_var_arg = true, arg_required_else_help = true)] pub struct Args { /// The task you want to run in the projects environment. + #[arg(required = true)] pub task: Vec, /// The path to 'pixi.toml' or 'pyproject.toml' diff --git a/src/task/executable_task.rs b/src/task/executable_task.rs index 83ffc1933..477d4bca8 100644 --- a/src/task/executable_task.rs +++ b/src/task/executable_task.rs @@ -32,7 +32,7 @@ pub struct RunOutput { } #[derive(Debug, Error, Diagnostic)] -#[error("deno task shell failed to parse '{script}': {error}")] +#[error("The task failed to parse. task: '{script}' error: '{error}'")] pub struct FailedToParseShellScript { pub script: String, pub error: String, @@ -139,7 +139,13 @@ impl<'p> ExecutableTask<'p> { // Append the command line arguments let cli_args = quote_arguments(self.additional_args.iter().map(|arg| arg.as_str())); - let full_script = format!("{export}\n{task} {cli_args}"); + + // Skip the export if it's empty, to avoid newlines + let full_script = if export.is_empty() { + format!("{task} {cli_args}") + } else { + format!("{export}\n{task} {cli_args}") + }; // Parse the shell command deno_task_shell::parser::parse(full_script.trim()) From 9f1656f68f97acfd1433d34f7e47c71de33d8c4d Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Fri, 26 Apr 2024 14:43:16 +0200 Subject: [PATCH 4/6] fix: build on linux in pixi env (#1282) --- pixi.lock | 70 ++++++++++++++++++++++++++++++++++++------------------- pixi.toml | 1 + 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/pixi.lock b/pixi.lock index fad421e20..d79e921df 100644 --- a/pixi.lock +++ b/pixi.lock @@ -7,6 +7,7 @@ environments: linux-64: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/_sysroot_linux-64_curr_repodata_hack-3-h69a702a_14.conda - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-23.2.0-pyh71513ae_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.40-hdd6e379_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.40-hf600244_0.conda @@ -47,7 +48,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.6-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-7.1.0-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-3.2.0-pyhd8ed1ab_3.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-h41732ed_0.conda @@ -96,7 +97,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/schema-0.7.5-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.2.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.9.0-pyhd8ed1ab_1.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/tbump-6.9.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h4845f30_101.conda @@ -335,6 +336,7 @@ environments: linux-64: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/_sysroot_linux-64_curr_repodata_hack-3-h69a702a_14.conda - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-23.2.0-pyh71513ae_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/babel-2.14.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.40-hdd6e379_0.conda @@ -395,7 +397,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-6.3.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-3.2.0-pyhd8ed1ab_3.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/lcms2-2.16-hb7c19ff_0.conda @@ -476,7 +478,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/schema-0.7.5-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.2.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.9.0-pyhd8ed1ab_1.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/tbump-6.9.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/tinycss2-1.2.1-pyhd8ed1ab_0.tar.bz2 @@ -921,6 +923,7 @@ environments: linux-64: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + - conda: https://conda.anaconda.org/conda-forge/noarch/_sysroot_linux-64_curr_repodata_hack-3-h69a702a_14.conda - conda: https://conda.anaconda.org/conda-forge/noarch/annotated-types-0.6.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-23.2.0-pyh71513ae_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.40-hdd6e379_0.conda @@ -964,7 +967,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-7.1.0-pyha770c72_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.0.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-3.2.0-pyhd8ed1ab_3.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.2-h659d440_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.40-h41732ed_0.conda @@ -1018,7 +1021,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/schema-0.7.5-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.2.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-he073ed8_2.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.9.0-pyhd8ed1ab_1.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/taplo-0.9.1-h1ff36dd_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/tbump-6.9.0-pyhd8ed1ab_0.tar.bz2 @@ -1326,6 +1329,20 @@ packages: license_family: BSD size: 23621 timestamp: 1650670423406 +- kind: conda + name: _sysroot_linux-64_curr_repodata_hack + version: '3' + build: h69a702a_14 + build_number: 14 + subdir: noarch + noarch: generic + url: https://conda.anaconda.org/conda-forge/noarch/_sysroot_linux-64_curr_repodata_hack-3-h69a702a_14.conda + sha256: 0dbeaddc3d5134b5336c52ac05642533b8d1ba2e1316aa92981f4cf5b5388de0 + md5: 38d211c448a67f12fe693fe25df4da23 + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later AND MPL-2.0 + license_family: GPL + size: 21169 + timestamp: 1708000801681 - kind: conda name: annotated-types version: 0.6.0 @@ -2961,20 +2978,22 @@ packages: timestamp: 1614815999960 - kind: conda name: kernel-headers_linux-64 - version: 2.6.32 - build: he073ed8_17 - build_number: 17 + version: 4.18.0 + build: he073ed8_2 + build_number: 2 subdir: noarch noarch: generic - url: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-2.6.32-he073ed8_17.conda - sha256: fb39d64b48f3d9d1acc3df208911a41f25b6a00bd54935d5973b4739a9edd5b6 - md5: d731b543793afc0433c4fd593e693fce + url: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_2.conda + sha256: a66f71d354bcc0890f683cc0183b2c66c846c3af630c4cdd88eb54d1d17afb3f + md5: 53dce80e1e9c697ef06e17cad8f18786 + depends: + - _sysroot_linux-64_curr_repodata_hack 3.* constrains: - - sysroot_linux-64 ==2.12 + - sysroot_linux-64 ==2.28 license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later AND MPL-2.0 license_family: GPL - size: 710627 - timestamp: 1708000830116 + size: 1258066 + timestamp: 1711086600855 - kind: conda name: keyutils version: 1.6.1 @@ -6387,20 +6406,23 @@ packages: timestamp: 1620240338595 - kind: conda name: sysroot_linux-64 - version: '2.12' - build: he073ed8_17 - build_number: 17 + version: '2.28' + build: he073ed8_2 + build_number: 2 subdir: noarch noarch: generic - url: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.12-he073ed8_17.conda - sha256: b4e4d685e41cb36cfb16f0cb15d2c61f8f94f56fab38987a44eff95d8a673fb5 - md5: 595db67e32b276298ff3d94d07d47fbf + url: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-he073ed8_2.conda + sha256: 4d22ee85398cef1da379ef913a6232bafc0c412b1b4ce8ed9c5fd9d8c6d9d3a8 + md5: 32efe63453c3561a03e915a7829c2bb1 depends: - - kernel-headers_linux-64 2.6.32 he073ed8_17 + - _sysroot_linux-64_curr_repodata_hack 3.* + - kernel-headers_linux-64 4.18.0 he073ed8_2 + track_features: + - sysroot_linux-64_2.28 sysroot_linux-64_2.28_feature_2 license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later AND MPL-2.0 license_family: GPL - size: 15127123 - timestamp: 1708000843849 + size: 26421592 + timestamp: 1711086612058 - kind: conda name: tabulate version: 0.9.0 diff --git a/pixi.toml b/pixi.toml index 61c1901dc..ed53d899d 100644 --- a/pixi.toml +++ b/pixi.toml @@ -34,6 +34,7 @@ tbump = ">=6.9.0,<6.10" [target.linux-64.dependencies] compilers = ">=1.6.0" +sysroot_linux-64 = ">2.19" [feature.docs.dependencies] mkdocs = "1.5.3.*" From 7d0058ffc52ecfd5b6084f5cba1f78f6f5151949 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Fri, 26 Apr 2024 16:05:17 +0200 Subject: [PATCH 5/6] chore: bump to v0.20.1 (#1283) --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ CITATION.cff | 4 ++-- Cargo.lock | 2 +- Cargo.toml | 2 +- docs/advanced/github_actions.md | 2 +- tbump.toml | 4 ++-- 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 021836990..1d9ef6caa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.20.1] - 2024-04-26 +### ✨ Highlights +- Big improvements on the pypi-editable installs. + + +### 📃 Details +#### Fixed +- Editable non-satisfiable by @baszalmstra in [#1251](https://github.com/prefix-dev/pixi/pull/1251) +- Satisfiability with pypi extras by @baszalmstra in [#1253](https://github.com/prefix-dev/pixi/pull/1253) +- Change global install activation script permission from 0o744 -> 0o755 by @zen-xu in [#1250](https://github.com/prefix-dev/pixi/pull/1250) +- Avoid creating Empty TOML tables by @olivier-lacroix in [#1270](https://github.com/prefix-dev/pixi/pull/1270) +- Uses the special-case uv path handling for both built and source by @tdejager in [#1263](https://github.com/prefix-dev/pixi/pull/1263) +- Modify test before attempting to write to .bash_profile in install.sh by @bruchim-cisco in [#1267](https://github.com/prefix-dev/pixi/pull/1267) +- Parse properly 'default' as environment Cli argument by @olivier-lacroix in [#1247](https://github.com/prefix-dev/pixi/pull/1247) +- Apply `schema.json` normalization, add to docs by @bollwyvl in [#1265](https://github.com/prefix-dev/pixi/pull/1265) +- Improve absolute path satisfiability by @tdejager in [#1252](https://github.com/prefix-dev/pixi/pull/1252) +- Improve parse deno error and make task a required field in the cli by @ruben-arts in [#1260](https://github.com/prefix-dev/pixi/pull/1260) + +## New Contributors +* @bollwyvl made their first contribution in [#1265](https://github.com/prefix-dev/pixi/pull/1265) +* @bruchim-cisco made their first contribution in [#1267](https://github.com/prefix-dev/pixi/pull/1267) +* @zen-xu made their first contribution in [#1250](https://github.com/prefix-dev/pixi/pull/1250) + +[Full commit history](https://github.com/prefix-dev/pixi/compare/v0.20.0..v0.20.1) + + ## [0.20.0] - 2024-04-19 ### ✨ Highlights diff --git a/CITATION.cff b/CITATION.cff index 1c25f9d0f..80b52347f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -24,8 +24,8 @@ authors: name-particle: de family-names: Jager email: tdejager89@gmail.com -repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.20.0' -url: 'https://pixi.sh/v0.20.0' +repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.20.1' +url: 'https://pixi.sh/v0.20.1' abstract: >- A cross-platform, language agnostic, package/project management tool for development in virtual environments. diff --git a/Cargo.lock b/Cargo.lock index bdb973826..4f1a9d065 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3063,7 +3063,7 @@ dependencies = [ [[package]] name = "pixi" -version = "0.20.0" +version = "0.20.1" dependencies = [ "assert_matches", "async-once-cell", diff --git a/Cargo.toml b/Cargo.toml index f6a7b0b2a..d6623eaab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pixi" -version = "0.20.0" +version = "0.20.1" description = "A package management and workflow tool" edition = "2021" authors = ["pixi contributors "] diff --git a/docs/advanced/github_actions.md b/docs/advanced/github_actions.md index f85347921..2be4a6a6c 100644 --- a/docs/advanced/github_actions.md +++ b/docs/advanced/github_actions.md @@ -15,7 +15,7 @@ We created [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) to ```yaml - uses: prefix-dev/setup-pixi@v0.6.0 with: - pixi-version: v0.20.0 + pixi-version: v0.20.1 cache: true auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} diff --git a/tbump.toml b/tbump.toml index 8711da173..8201d2b86 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/prefix-dev/pixi" [version] -current = "0.20.0" +current = "0.20.1" # Example of a semver regexp. # Make sure this matches current_version before @@ -19,7 +19,7 @@ regex = ''' [git] # The current version will get updated when tbump is run -message_template = "Bump version: 0.20.0 → {new_version}" +message_template = "Bump version: 0.20.1 → {new_version}" tag_template = "v{new_version}" # For each file to patch, add a [[file]] config From 58ab590d2b83f618ba544c497feef6de0c1c0b7e Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Fri, 26 Apr 2024 16:28:18 +0200 Subject: [PATCH 6/6] fix: schema version and add it to tbump (#1284) --- schema/schema.json | 4 ++-- tbump.toml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/schema/schema.json b/schema/schema.json index 47f7fa7d8..723647f87 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://pixi.sh/v0.20.0/schema/manifest/schema.json", + "$id": "https://pixi.sh/v0.20.1/schema/manifest/schema.json", "title": "`pixi.toml` manifest file", "description": "The configuration for a [`pixi`](https://pixi.sh) project.", "type": "object", @@ -13,7 +13,7 @@ "title": "Schema", "description": "The schema identifier for the project's configuration", "type": "string", - "default": "https://pixi.sh/v0.20.0/schema/manifest/schema.json", + "default": "https://pixi.sh/v0.20.1/schema/manifest/schema.json", "format": "uri-reference" }, "activation": { diff --git a/tbump.toml b/tbump.toml index 8201d2b86..4806ed201 100644 --- a/tbump.toml +++ b/tbump.toml @@ -42,6 +42,10 @@ search = '^version = "{current_version}"' [[file]] src = "docs/advanced/github_actions.md" search = "pixi-version: v{current_version}" +[[file]] +src = "schema/schema.json" +search = "/pixi.sh/v{current_version}/" + [[field]] # the name of the field name = "candidate"