uv/crates/puffin-cli/tests
Charlie Marsh 62c474d880
Add support for Git dependencies (#283)
## 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`](23eb492cf9/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.
2023-11-02 15:14:55 +00:00
..
snapshots Add support for Git dependencies (#283) 2023-11-02 15:14:55 +00:00
add.rs Add CLI tests for add and remove commands (#124) 2023-10-19 01:06:48 +00:00
pip_compile.rs Add support for Git dependencies (#283) 2023-11-02 15:14:55 +00:00
pip_sync.rs Add support for URL dependencies (#251) 2023-11-01 09:21:44 -04:00
pip_uninstall.rs Improve and test diagnostics for requirements-reading CLI commands (#143) 2023-10-19 18:13:40 -04:00
remove.rs Add CLI tests for add and remove commands (#124) 2023-10-19 01:06:48 +00:00
venv.rs Default to puffin venv path to .venv (#261) 2023-10-31 15:24:19 -05:00