Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for direct archive dependencies in Git #10072

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Dec 21, 2024

Summary

This PR adds support for sources that reference pre-built archives (wheels or source distributions) within Git repositories.

@charliermarsh charliermarsh marked this pull request as draft December 21, 2024 04:13
@charliermarsh charliermarsh force-pushed the charlie/add-git-path-deps branch from 8705c37 to 6219339 Compare December 21, 2024 17:53
@charliermarsh charliermarsh marked this pull request as ready for review December 21, 2024 17:53
@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Dec 21, 2024
@charliermarsh charliermarsh force-pushed the charlie/add-git-path-deps branch from 6219339 to acbc01c Compare December 21, 2024 18:08
@@ -5527,6 +5527,96 @@ fn sync_git_repeated_member_backwards_path() -> Result<()> {
Ok(())
}

/// A Git repository that points to a pre-built archive within the repository.
#[test]
fn sync_git_path_archive() -> Result<()> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real motivating example: you have a project that you push to GitHub that includes a path source that points to a wheel, like:

[project]
name = "archive-in-git-test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = ["iniconfig"]

[tool.uv.sources]
iniconfig = { path = "archives/iniconfig-2.0.0-py3-none-any.whl" }

We have to translate that path source to a Git source so that we avoid writing cache paths to the lockfile.

Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ archive-in-git-test==0.1.0 (from git+https://github.com/astral-sh/archive-in-git-test.git@bb7ce6abf9f90544767701de5b7b0c7802dc642b)
+ iniconfig==2.0.0 (from git+https://github.com/astral-sh/archive-in-git-test.git@bb7ce6abf9f90544767701de5b7b0c7802dc642b#path=archives/iniconfig-2.0.0-py3-none-any.whl)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sick

@charliermarsh charliermarsh force-pushed the charlie/add-git-path-deps branch 3 times, most recently from 53402d2 to 3e61108 Compare December 21, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant