Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions crates/pixi_core/src/lock_file/satisfiability/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,27 @@ pub(crate) async fn verify_package_platform_satisfiability(
return Err(Box::new(PlatformUnsat::TooManyCondaPackages(Vec::new())));
}

// get pypi-options dependency overrides
// we map it to name: requirement for latter matching
Comment thread
HernandoR marked this conversation as resolved.
Outdated
let dependency_overrides: indexmap::IndexMap<
uv_normalize::PackageName,
uv_distribution_types::Requirement,
Comment thread
tdejager marked this conversation as resolved.
Outdated
> = environment
.pypi_options()
.dependency_overrides
.unwrap_or_default()
.into_iter()
.map(|(name, req)| -> Result<_, Box<PlatformUnsat>> {
let uv_req = as_uv_req(&req, name.as_source(), project_root).map_err(|e| {
Box::new(PlatformUnsat::AsPep508Error(
name.as_normalized().clone(),
e,
))
})?;
Ok((uv_req.name.clone(), uv_req))
})
.collect::<Result<_, _>>()?;

// Transform from PyPiPackage name into UV Requirement type
let pypi_requirements = environment
.pypi_dependencies(Some(platform))
Expand Down Expand Up @@ -1217,6 +1238,13 @@ pub(crate) async fn verify_package_platform_satisfiability(
{
Ok(Some(idx)) => {
let record = &locked_pypi_environment.records[idx];

// use the overridden requirements if we specified
Comment thread
HernandoR marked this conversation as resolved.
Outdated
let requirement = dependency_overrides
.get(&requirement.name)
.cloned()
.unwrap_or(requirement);

if requirement.is_editable() {
if let Err(err) =
pypi_satifisfies_editable(&requirement, &record.0, project_root)
Expand Down
150 changes: 150 additions & 0 deletions tests/data/satisfiability/dependency_overides/pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/data/satisfiability/dependency_overides/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
channels = ["conda-forge"]
name = "absolute-paths"
platforms = ["osx-arm64"]
version = "0.1.0"

[dependencies]
python = "3.12"

[pypi-dependencies]
foo = { path = "./projects/foo", editable = true }

[pypi-options.dependency-overrides]
dummy_test = "==0.1.2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[project]
authors = [{ name = "Tim de Jager", email = "tim@prefix.dev" }]
dependencies = ["dummy_test==0.1.3"]
description = "Add a short description here"
name = "foo"
requires-python = ">= 3.11"
version = "0.1.0"

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64"]
Loading