Skip to content

Commit

Permalink
fix: satisfy when there is not pypi packages in the lockfile (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts authored Aug 21, 2024
1 parent 6e400fe commit 7b92e25
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/lock_file/satisfiability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,14 @@ pub fn verify_environment_satisfiability(
let indexes = rattler_lock::PypiIndexes::from(grouped_env.pypi_options());
match locked_environment.pypi_indexes() {
None => {
// Mismatch when there should be an index but there is not
if locked_environment
.version()
.should_pypi_indexes_be_present()
&& locked_environment
.pypi_packages()
.iter()
.any(|(_platform, packages)| !packages.is_empty())
{
return Err(IndexesMismatch {
current: indexes,
Expand Down
11 changes: 5 additions & 6 deletions tests/add_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ mod common;

use std::str::FromStr;

use crate::common::{
builders::{HasDependencyConfig, HasPrefixUpdateConfig},
package_database::{Package, PackageDatabase},
LockFileExt, PixiControl,
};
use pixi::{DependencyType, Project};
use pixi_consts::consts;
use pixi_manifest::{pypi::PyPiPackageName, FeaturesExt, SpecType};
Expand All @@ -10,12 +15,6 @@ use serial_test::serial;
use tempfile::TempDir;
use uv_normalize::ExtraName;

use crate::common::{
builders::{HasDependencyConfig, HasPrefixUpdateConfig},
package_database::{Package, PackageDatabase},
LockFileExt, PixiControl,
};

/// Test add functionality for different types of packages.
/// Run, dev, build
#[tokio::test]
Expand Down
Loading

0 comments on commit 7b92e25

Please sign in to comment.