Let RequirementSource::Path.editable be bool, not Option<bool> (#3693)
Small refactoring of the internal representation. This does not change `tool.uv.sources`.
This commit is contained in:
@@ -174,7 +174,7 @@ pub enum RequirementSource {
|
||||
Path {
|
||||
path: PathBuf,
|
||||
/// For a source tree (a directory), whether to install as an editable.
|
||||
editable: Option<bool>,
|
||||
editable: bool,
|
||||
/// The PEP 508 style URL in the format
|
||||
/// `file:///<path>#subdirectory=<subdirectory>`.
|
||||
url: VerbatimUrl,
|
||||
@@ -189,7 +189,7 @@ impl RequirementSource {
|
||||
ParsedUrl::Path(local_file) => RequirementSource::Path {
|
||||
path: local_file.path,
|
||||
url,
|
||||
editable: None,
|
||||
editable: false,
|
||||
},
|
||||
ParsedUrl::Git(git) => RequirementSource::Git {
|
||||
url,
|
||||
|
||||
@@ -94,7 +94,7 @@ impl From<&ResolvedDist> for Requirement {
|
||||
Dist::Built(BuiltDist::Path(wheel)) => RequirementSource::Path {
|
||||
path: wheel.path.clone(),
|
||||
url: wheel.url.clone(),
|
||||
editable: None,
|
||||
editable: false,
|
||||
},
|
||||
Dist::Source(SourceDist::Registry(sdist)) => RequirementSource::Registry {
|
||||
specifier: pep440_rs::VersionSpecifiers::from(
|
||||
@@ -121,12 +121,12 @@ impl From<&ResolvedDist> for Requirement {
|
||||
Dist::Source(SourceDist::Path(sdist)) => RequirementSource::Path {
|
||||
path: sdist.path.clone(),
|
||||
url: sdist.url.clone(),
|
||||
editable: None,
|
||||
editable: false,
|
||||
},
|
||||
Dist::Source(SourceDist::Directory(sdist)) => RequirementSource::Path {
|
||||
path: sdist.path.clone(),
|
||||
url: sdist.url.clone(),
|
||||
editable: Some(sdist.editable),
|
||||
editable: sdist.editable,
|
||||
},
|
||||
},
|
||||
ResolvedDist::Installed(dist) => RequirementSource::Registry {
|
||||
|
||||
Reference in New Issue
Block a user