Fix tool editable policy after rebase

This commit is contained in:
Charlie Marsh
2026-04-14 10:10:00 -04:00
parent 357ebc0d08
commit 934a5d881f
5 changed files with 13 additions and 8 deletions
+5
View File
@@ -371,6 +371,11 @@ impl Tool {
&self.requirements
}
/// Return the primary requirement for the tool itself.
pub fn target_requirement(&self) -> Option<&Requirement> {
self.requirements.first()
}
pub fn constraints(&self) -> &[Requirement] {
&self.constraints
}
+4 -4
View File
@@ -699,7 +699,7 @@ pub(crate) async fn install(
spec.clone(),
Modifications::Exact,
python_platform.as_ref(),
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
Constraints::from_requirements(build_constraints.iter().cloned()),
ExtraBuildRequires::default(),
&settings,
@@ -758,7 +758,7 @@ pub(crate) async fn install(
),
update.environment.interpreter(),
python_platform.as_ref(),
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
Constraints::from_requirements(build_constraints.iter().cloned()),
&settings.resolver,
&client_builder,
@@ -796,7 +796,7 @@ pub(crate) async fn install(
spec.clone(),
&interpreter,
python_platform.as_ref(),
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
Constraints::from_requirements(build_constraints.iter().cloned()),
&settings.resolver,
&client_builder,
@@ -852,7 +852,7 @@ pub(crate) async fn install(
spec,
&interpreter,
python_platform.as_ref(),
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
Constraints::from_requirements(build_constraints.iter().cloned()),
&settings.resolver,
&client_builder,
+2 -2
View File
@@ -371,7 +371,7 @@ async fn upgrade_tool(
),
interpreter,
python_platform,
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
build_constraints.clone(),
&settings.resolver,
client_builder,
@@ -424,7 +424,7 @@ async fn upgrade_tool(
),
environment.environment().interpreter(),
python_platform,
SourceTreeEditablePolicy::Respect,
SourceTreeEditablePolicy::Tool,
build_constraints.clone(),
&settings.resolver,
client_builder,
+1 -1
View File
@@ -415,7 +415,7 @@ fn tool_install_relative_exclude_newer_receipt_preserves_span() {
requires-python = ">=3.12.[X]"
[options]
exclude-newer = "2024-04-10T00:00:00Z"
exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values.
exclude-newer-span = "P3W"
[manifest]
+1 -1
View File
@@ -616,7 +616,7 @@ fn tool_upgrade_recomputes_relative_exclude_newer() {
requires-python = ">=3.12.[X]"
[options]
exclude-newer = "2024-03-25T00:00:00Z"
exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values.
exclude-newer-span = "P3W"
[manifest]