mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Fix version satisfier for unpinned dependencies (#74)
This commit is contained in:
parent
485b1dceb6
commit
239b5893d8
2 changed files with 14 additions and 10 deletions
|
@ -21,6 +21,12 @@ Puffin's limited scope allows us to solve many of the low-level problems that ar
|
|||
build such a package manager (like package installation) while shipping an immediately useful tool
|
||||
with a minimal barrier to adoption. Try it today in lieu of `pip` and `pip-tools`.
|
||||
|
||||
## Features
|
||||
|
||||
- Extremely fast dependency resolution and installation: install dependencies in sub-second time.
|
||||
- Disk-space efficient: Puffin uses a global cache to deduplicate dependencies, and uses
|
||||
Copy-on-Write on supported filesystems to reduce disk usage.
|
||||
|
||||
## Limitations
|
||||
|
||||
Puffin does not yet support:
|
||||
|
|
|
@ -304,16 +304,14 @@ impl Requirement {
|
|||
impl Requirement {
|
||||
/// Returns `true` if the [`Version`] satisfies the [`Requirement`].
|
||||
pub fn is_satisfied_by(&self, version: &Version) -> bool {
|
||||
let Some(specifiers) =
|
||||
self.version_or_url
|
||||
.as_ref()
|
||||
.and_then(|version_or_url| match version_or_url {
|
||||
VersionOrUrl::VersionSpecifier(specifiers) => Some(specifiers),
|
||||
// TODO(charlie): Support URL dependencies.
|
||||
VersionOrUrl::Url(_) => None,
|
||||
})
|
||||
else {
|
||||
return false;
|
||||
let Some(version_or_url) = self.version_or_url.as_ref() else {
|
||||
return true;
|
||||
};
|
||||
|
||||
let specifiers = match version_or_url {
|
||||
VersionOrUrl::VersionSpecifier(specifiers) => specifiers,
|
||||
// TODO(charlie): Support URL dependencies.
|
||||
VersionOrUrl::Url(_) => return false,
|
||||
};
|
||||
|
||||
specifiers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue