Skip to content

Commit

Permalink
Respect tool.uv.environments for legacy virtual workspace roots
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Oct 1, 2024
1 parent b6de417 commit 991e393
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions crates/uv-workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,8 @@ impl Workspace {

/// Returns the set of overrides for the workspace.
pub fn overrides(&self) -> Vec<Requirement> {
let Some(workspace_package) = self
.packages
.values()
.find(|workspace_package| workspace_package.root() == self.install_path())
else {
return vec![];
};

let Some(overrides) = workspace_package
.pyproject_toml()
let Some(overrides) = self
.pyproject_toml
.tool
.as_ref()
.and_then(|tool| tool.uv.as_ref())
Expand All @@ -375,13 +367,7 @@ impl Workspace {

/// Returns the set of supported environments for the workspace.
pub fn environments(&self) -> Option<&SupportedEnvironments> {
let workspace_package = self
.packages
.values()
.find(|workspace_package| workspace_package.root() == self.install_path())?;

workspace_package
.pyproject_toml()
self.pyproject_toml
.tool
.as_ref()
.and_then(|tool| tool.uv.as_ref())
Expand All @@ -390,16 +376,8 @@ impl Workspace {

/// Returns the set of constraints for the workspace.
pub fn constraints(&self) -> Vec<Requirement> {
let Some(workspace_package) = self
.packages
.values()
.find(|workspace_package| workspace_package.root() == self.install_path())
else {
return vec![];
};

let Some(constraints) = workspace_package
.pyproject_toml()
let Some(constraints) = self
.pyproject_toml
.tool
.as_ref()
.and_then(|tool| tool.uv.as_ref())
Expand Down

0 comments on commit 991e393

Please sign in to comment.