-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat: add support for git source dependencies in pixi build #2680
feat: add support for git source dependencies in pixi build #2680
Conversation
.rev | ||
.clone() | ||
.unwrap_or_else(|| GitReference::Rev(self.commit.clone())); | ||
let locked_git_ref = self.source.reference.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short_sha == long_sha if it is the same :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always record requested rev, so if user previously short sha we will check against it
Great work thank you 🥂 ! |
…/pixi into feat/add-git-source-dependencies
…/pixi into feat/add-git-source-dependencies
- use test data instead of docs - calculate file url directly - stop replacing with fake path
Overview
Adding support of git dependencies for pixi build.
New and important changes:
PixiSpec
. This means that user can write this in pixi.toml:boost-check = { git = "https://github.com/nichmor/pixi-build-examples", subdirectory="something" }
Other supported git references:
boost-check = { git = "https://ghp_yourpersonal_token@github.com/nichmor/pixi-build-examples.git", branch = "main"}
boost-check = { git = "ssh://git@github.com/nichmor/pixi-build-examples", branch = "fix-backend" }
or any URLs with
user
andpassword
In the screenshot, with the green color I highlighted this field.
Adding
pixi_git
crate. This is copied mostly fromuv-git
and trying to keep minimum additional changes.It expose
GitUrl
( which is not aware of subdirectory, just a url from git perspective ) and aGitResolver
, that can receiveGitUrl
and fetch it somewhere in the cache and return the path to fetched repository.In screenshot we can see a small overview of it:
on
pixi_build
, I changedPinnedGitSpec
. It now contains a new field ofPinnedGitCheckout
type which represent a solved checkout of some source git spec. This, later, will be transformed into aLockedUrl
and saved in pixi.lock.LockedUrl
redact all the credentails, contains a mandatorygit+
suffix and have exact commit in the fragments.In the attached screenshot, with green I highlighted the new types and how they behave.
get_update_lock_file_and_prefix
now also containstore_credentials_from_project
function. This function is responsible for loading all the credentials frompixi.toml
, and apply them to the locked urls ( because they are redacted and don't contain anymore any creds)My vision is that by using
LockedGitUrl
, we can also represent PyPi types, which can be latter transformed back from lock file into some PyPi type. Also, rattler-build or pixi-build-backends can reusepixi_git
Giturl
for they needs when solving some dependencies ( as they are unaware about subdirectories ) and can be constructed from the Urls.Blocked things that needs to be merged before this PR:
Missing things that will be added in following PR's: