Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: satisfy when there is not pypi packages in the lockfile #1862

Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading