Skip to content

fix: don't keep reinstalling local pypi archives#3618

Merged
tdejager merged 5 commits intoprefix-dev:mainfrom
tdejager:feat/local-archives
Apr 17, 2025
Merged

fix: don't keep reinstalling local pypi archives#3618
tdejager merged 5 commits intoprefix-dev:mainfrom
tdejager:feat/local-archives

Conversation

@tdejager
Copy link
Copy Markdown
Contributor

When using a pypi local archive things keep reinstalling.

[workspace]
authors = ["Tim de Jager <tim@prefix.dev>"]
channels = ["https://prefix.dev/conda-forge"]
name = "installation-order"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
python = "3.13.*"

[pypi-dependencies]
minimal = { path = "./minimal-0.1.0-py2.py3-none-any.whl" }
...
 INFO pixi::install_pypi: 4 of 5 required packages are considered are installed and up-to-date
 INFO pixi::install_pypi: *re-installing* following packages: minimal
 INFO pixi::install_pypi: re-installing 'minimal' because: 'Git archive is a path'
 INFO pixi::install_pypi: Prepared 1 package in 0ms
 INFO pixi::install_pypi: Installed 1 package in 1ms
✔ The default environment has been installed.

The above kept happening. This PR fixes that behavior.

This pull request includes several changes to the src/install_pypi/plan/test/harness.rs, src/install_pypi/plan/test/mod.rs, and src/install_pypi/plan/validation.rs files to improve the handling of PyPI package installations and their validation.

The most important changes are summarized below:

Improvements to PyPI package data handling:

  • Renamed the directory function to path in impl PyPIPackageDataBuilder to better reflect its purpose.
  • Added a new method add_local_wheel to RequiredPackages for adding local wheel files.

Enhancements to test harness:

  • Introduced install_planner_with_lock_dir function to create an InstallPlanner with a specified lock directory. This will help for relative path testing.
  • Added fake_wheel function to create a fake wheel file for testing purposes.

Validation improvements:

  • Updated error handling in NeedsReinstallError to include a new variant FreshnessError for errors encountered while checking freshness.
  • (The fix) Enhanced the need_reinstall function to handle relative paths and check the freshness of URLs more robustly. [1] [2]

@tdejager tdejager requested a review from baszalmstra April 15, 2025 18:27
tdejager and others added 2 commits April 17, 2025 08:57
Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
@tdejager tdejager requested a review from baszalmstra April 17, 2025 08:10
@tdejager tdejager merged commit 09a6134 into prefix-dev:main Apr 17, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants