Support dev dependencies in virtual workspace roots (#5709)

## Summary

Closes https://github.com/astral-sh/uv/issues/5650.
This commit is contained in:
Charlie Marsh 2024-08-01 17:04:30 -04:00 committed by GitHub
parent 499c368f1e
commit 69b8b16c75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 222 additions and 62 deletions

View file

@ -2,7 +2,7 @@ pub use distribution_database::{DistributionDatabase, HttpArchivePointer, LocalA
pub use download::LocalWheel;
pub use error::Error;
pub use index::{BuiltWheelIndex, RegistryWheelIndex};
pub use metadata::{ArchiveMetadata, Metadata, RequiresDist, DEV_DEPENDENCIES};
pub use metadata::{ArchiveMetadata, Metadata, RequiresDist};
pub use reporter::Reporter;
mod archive;

View file

@ -4,7 +4,7 @@ use std::path::Path;
use thiserror::Error;
use crate::metadata::lowering::LoweringError;
pub use crate::metadata::requires_dist::{RequiresDist, DEV_DEPENDENCIES};
pub use crate::metadata::requires_dist::RequiresDist;
use pep440_rs::{Version, VersionSpecifiers};
use pypi_types::{HashDigest, Metadata23};
use uv_configuration::PreviewMode;

View file

@ -1,22 +1,14 @@
use std::collections::BTreeMap;
use std::path::Path;
use std::sync::LazyLock;
use uv_configuration::PreviewMode;
use uv_normalize::{ExtraName, GroupName, PackageName};
use uv_normalize::{ExtraName, GroupName, PackageName, DEV_DEPENDENCIES};
use uv_workspace::{DiscoveryOptions, ProjectWorkspace};
use crate::metadata::lowering::lower_requirement;
use crate::metadata::MetadataError;
use crate::Metadata;
/// The name of the global `dev-dependencies` group.
///
/// Internally, we model dependency groups as a generic concept; but externally, we only expose the
/// `dev-dependencies` group.
pub static DEV_DEPENDENCIES: LazyLock<GroupName> =
LazyLock::new(|| GroupName::new("dev".to_string()).unwrap());
#[derive(Debug, Clone)]
pub struct RequiresDist {
pub name: PackageName,