mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35: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
|
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`.
|
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
|
## Limitations
|
||||||
|
|
||||||
Puffin does not yet support:
|
Puffin does not yet support:
|
||||||
|
|
|
@ -304,16 +304,14 @@ impl Requirement {
|
||||||
impl Requirement {
|
impl Requirement {
|
||||||
/// Returns `true` if the [`Version`] satisfies the [`Requirement`].
|
/// Returns `true` if the [`Version`] satisfies the [`Requirement`].
|
||||||
pub fn is_satisfied_by(&self, version: &Version) -> bool {
|
pub fn is_satisfied_by(&self, version: &Version) -> bool {
|
||||||
let Some(specifiers) =
|
let Some(version_or_url) = self.version_or_url.as_ref() else {
|
||||||
self.version_or_url
|
return true;
|
||||||
.as_ref()
|
};
|
||||||
.and_then(|version_or_url| match version_or_url {
|
|
||||||
VersionOrUrl::VersionSpecifier(specifiers) => Some(specifiers),
|
let specifiers = match version_or_url {
|
||||||
// TODO(charlie): Support URL dependencies.
|
VersionOrUrl::VersionSpecifier(specifiers) => specifiers,
|
||||||
VersionOrUrl::Url(_) => None,
|
// TODO(charlie): Support URL dependencies.
|
||||||
})
|
VersionOrUrl::Url(_) => return false,
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
specifiers
|
specifiers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue