62c474d880
## Summary This PR adds support for Git dependencies, like: ``` flask @ git+https://github.com/pallets/flask.git ``` Right now, they're only supported in the resolver (and not the installer), since the installer doesn't yet support source distributions at all. The general approach here is based on Cargo's Git implementation. Specifically, I adapted Cargo's [`git`](https://github.com/rust-lang/cargo/blob/23eb492cf920ce051abfc56bbaf838514dc8365c/src/cargo/sources/git/mod.rs) module to perform the cloning, which is based on `libgit2`. As compared to Cargo's implementation, I made the following changes: - Removed any unnecessary code. - Fixed any Clippy errors for our stricter ruleset. - Removed the dependency on `curl`, in favor of `reqwest` which we use elsewhere. - Removed the ability to use `gix`. Cargo allows the use of `gix` as an experimental flag, but it only supports a small subset of the operations. When Cargo fully adopts `gix`, we should plan to do the same. - Removed Cargo's host key checking. We need to re-add this! I'll do it shortly. - Removed Cargo's progress bars. We should re-add this too, but we use `indicatif` and Cargo had their own thing. There are a few follow-ups to consider: - Adding support in the installer. - When we lock, we should write out the Git URL that includes the exact SHA. This lets us cache in perpetuity and avoids dependencies changing without re-locking. - When we resolve, we should _always_ try to refresh Git dependencies. (Right now, we skip if the wheel was already built.) I'll work on the latter two in follow-up PRs. Closes #202.
31 lines
820 B
TOML
31 lines
820 B
TOML
[package]
|
|
name = "puffin-git"
|
|
version = "0.0.1"
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
authors = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[dependencies]
|
|
puffin-cache = { path = "../puffin-cache" }
|
|
|
|
anyhow = { workspace = true }
|
|
cargo-util = { version = "0.2.6" }
|
|
git2 = { version = "0.18.1" }
|
|
glob = { workspace = true }
|
|
hex = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
rand = { workspace = true }
|
|
serde = { workspace = true }
|
|
tracing = { workspace = true }
|
|
url = { workspace = true }
|
|
reqwest = { workspace = true, features = ["blocking"] }
|
|
tokio.workspace = true
|
|
|
|
[features]
|
|
vendored-libgit2 = ["git2/vendored-libgit2"]
|
|
vendored-openssl = ["git2/vendored-openssl"]
|