mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Avoid building packages with dynamic versions (#4058)
## Summary This PR separates "gathering the requirements" from the rest of the metadata (e.g., version), which isn't required when installing a package's _dependencies_ (as opposed to installing the package itself). It thus ensures that we don't need to build a package when a static `pyproject.toml` is provided in `pip compile`. Closes https://github.com/astral-sh/uv/issues/4040.
This commit is contained in:
parent
a0173760f1
commit
191f9556b7
8 changed files with 609 additions and 382 deletions
|
@ -34,7 +34,7 @@ use crate::archive::Archive;
|
|||
use crate::locks::Locks;
|
||||
use crate::metadata::{ArchiveMetadata, Metadata};
|
||||
use crate::source::SourceDistributionBuilder;
|
||||
use crate::{Error, LocalWheel, Reporter};
|
||||
use crate::{Error, LocalWheel, Reporter, RequiresDist};
|
||||
|
||||
/// A cached high-level interface to convert distributions (a requirement resolved to a location)
|
||||
/// to a wheel or wheel metadata.
|
||||
|
@ -434,6 +434,11 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
|
|||
Ok(metadata)
|
||||
}
|
||||
|
||||
/// Return the [`RequiresDist`] from a `pyproject.toml`, if it can be statically extracted.
|
||||
pub async fn requires_dist(&self, project_root: &Path) -> Result<RequiresDist, Error> {
|
||||
self.builder.requires_dist(project_root).await
|
||||
}
|
||||
|
||||
/// Stream a wheel from a URL, unzipping it into the cache as it's downloaded.
|
||||
async fn stream_wheel(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue