Skip to content

Commit

Permalink
fix: sorting test should also load dependencies (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra authored Oct 7, 2024
1 parent 2e2cf94 commit 9b97d90
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
source: crates/rattler_solve/tests/sorting.rs
expression: create_sorting_snapshot(package_name)
expression: create_sorting_snapshot(spec)
---
abess=0.4.5=py310hc4a4660_1
abess=0.4.5=py39hac2352c_1
abess=0.4.5=py37h48bf904_1
abess=0.4.5=py38h514daf8_1
abess=0.4.5=py310hc4a4660_1
abess=0.4.5=py37h48bf904_0
abess=0.4.5=py38h514daf8_0
abess=0.4.5=py37h48bf904_1
abess=0.4.5=py39hac2352c_0
abess=0.4.5=py38h514daf8_0
abess=0.4.5=py37h48bf904_0
abess=0.4.4=py39hac2352c_1
abess=0.4.4=py38h514daf8_1
abess=0.4.4=py37h48bf904_1
abess=0.4.4=py39hac2352c_1
abess=0.4.4=py38h514daf8_0
abess=0.4.4=py39hac2352c_0
abess=0.4.4=py38h514daf8_0
abess=0.4.4=py37h48bf904_0
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ python=3.10.2=hc74c709_4_cpython
python=3.10.2=h85951f9_4_cpython
python=3.10.2=hc74c709_3_cpython
python=3.10.2=h85951f9_3_cpython
python=3.10.2=h85951f9_2_cpython
python=3.10.2=hc74c709_2_cpython
python=3.10.2=h85951f9_1_cpython
python=3.10.2=h85951f9_2_cpython
python=3.10.2=hc74c709_1_cpython
python=3.10.2=h85951f9_1_cpython
python=3.10.2=h543edf9_0_cpython
python=3.10.2=h62f1059_0_cpython
python=3.10.1=h543edf9_2_cpython
python=3.10.1=h62f1059_2_cpython
python=3.10.1=h62f1059_1_cpython
python=3.10.1=h543edf9_1_cpython
python=3.10.1=h62f1059_1_cpython
python=3.10.1=h543edf9_0_cpython
python=3.10.1=h62f1059_0_cpython
python=3.10.0=h62f1059_3_cpython
python=3.10.0=h543edf9_3_cpython
python=3.10.0=h62f1059_3_cpython
python=3.10.0=h543edf9_2_cpython
python=3.10.0=h62f1059_2_cpython
python=3.10.0=h543edf9_1_cpython
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,67 @@
source: crates/rattler_solve/tests/sorting.rs
expression: create_sorting_snapshot(spec)
---
pytorch=1.12.1=cuda112py310h51fe464_200
pytorch=1.12.1=cuda111py310h385535d_200
pytorch=1.12.1=cuda110py310hfdf97d1_200
pytorch=1.12.1=cuda112py39ha0cca9b_200
pytorch=1.12.1=cuda111py39h9f128c5_200
pytorch=1.12.1=cuda110py39h0a9da28_200
pytorch=1.12.1=cuda110py37h0def887_200
pytorch=1.12.1=cuda112py38habe9d5a_200
pytorch=1.12.1=cuda111py38h2d04dd0_200
pytorch=1.12.1=cuda110py38h386aa8f_200
pytorch=1.12.1=cuda102py37haad9b4f_200
pytorch=1.12.1=cuda110py310hfdf97d1_200
pytorch=1.12.1=cuda111py310h385535d_200
pytorch=1.12.1=cuda111py37hdb2541a_200
pytorch=1.12.1=cuda112py310h51fe464_200
pytorch=1.12.1=cuda112py38habe9d5a_200
pytorch=1.12.1=cuda110py37h0def887_200
pytorch=1.12.1=cuda102py310hdf4a2db_200
pytorch=1.12.1=cuda102py39hbbcd3cb_200
pytorch=1.12.1=cuda102py38hfdb21e3_200
pytorch=1.12.1=cuda111py38h2d04dd0_200
pytorch=1.12.1=cuda111py39h9f128c5_200
pytorch=1.12.1=cuda112py39ha0cca9b_200
pytorch=1.12.1=cuda112py37hfcfbd4c_200
pytorch=1.12.1=cuda102py39hbbcd3cb_200
pytorch=1.12.1=cuda102py310hdf4a2db_200
pytorch=1.12.1=cuda102py37haad9b4f_200
pytorch=1.12.1=cpu_py310h75c9ab6_0
pytorch=1.12.1=cpu_py39h5d22d69_0
pytorch=1.12.1=cpu_py38h39c826d_0
pytorch=1.12.1=cpu_py37h14e09b7_0
pytorch=1.12.0=cuda111py310h385535d_202
pytorch=1.12.0=cuda112py310h51fe464_202
pytorch=1.12.0=cuda110py39h0a9da28_202
pytorch=1.12.0=cuda111py38h2d04dd0_202
pytorch=1.12.0=cuda111py310h385535d_202
pytorch=1.12.0=cuda110py310hfdf97d1_202
pytorch=1.12.0=cuda112py39ha0cca9b_202
pytorch=1.12.0=cuda102py39hbbcd3cb_202
pytorch=1.12.0=cuda111py39h9f128c5_202
pytorch=1.12.0=cuda110py310hfdf97d1_202
pytorch=1.12.0=cuda102py37haad9b4f_202
pytorch=1.12.0=cuda110py39h0a9da28_202
pytorch=1.12.0=cuda111py38h2d04dd0_202
pytorch=1.12.0=cuda110py38h386aa8f_202
pytorch=1.12.0=cuda112py37hfcfbd4c_202
pytorch=1.12.0=cuda111py37hdb2541a_202
pytorch=1.12.0=cuda110py37h0def887_202
pytorch=1.12.0=cuda110py38h386aa8f_202
pytorch=1.12.0=cuda102py310hdf4a2db_202
pytorch=1.12.0=cuda102py39hbbcd3cb_202
pytorch=1.12.0=cuda112py38habe9d5a_202
pytorch=1.12.0=cuda102py38hfdb21e3_202
pytorch=1.12.0=cuda111py310h385535d_200
pytorch=1.12.0=cuda102py37haad9b4f_202
pytorch=1.12.0=cuda112py310h51fe464_200
pytorch=1.12.0=cuda110py39h0a9da28_200
pytorch=1.12.0=cuda111py38h2d04dd0_200
pytorch=1.12.0=cuda111py310h385535d_200
pytorch=1.12.0=cuda110py310hfdf97d1_200
pytorch=1.12.0=cuda112py39ha0cca9b_200
pytorch=1.12.0=cuda102py39hbbcd3cb_200
pytorch=1.12.0=cuda111py39h9f128c5_200
pytorch=1.12.0=cuda110py310hfdf97d1_200
pytorch=1.12.0=cuda102py37haad9b4f_200
pytorch=1.12.0=cuda110py39h0a9da28_200
pytorch=1.12.0=cuda111py38h2d04dd0_200
pytorch=1.12.0=cuda110py38h386aa8f_200
pytorch=1.12.0=cuda112py37hfcfbd4c_200
pytorch=1.12.0=cuda111py37hdb2541a_200
pytorch=1.12.0=cuda110py37h0def887_200
pytorch=1.12.0=cuda110py38h386aa8f_200
pytorch=1.12.0=cuda102py310hdf4a2db_200
pytorch=1.12.0=cuda102py39hbbcd3cb_200
pytorch=1.12.0=cuda112py38habe9d5a_200
pytorch=1.12.0=cuda102py38hfdb21e3_200
pytorch=1.12.0=cuda102py37haad9b4f_200
pytorch=1.12.0=cpu_py310h75c9ab6_2
pytorch=1.12.0=cpu_py39h5d22d69_2
pytorch=1.12.0=cpu_py38h39c826d_2
pytorch=1.12.0=cpu_py310h75c9ab6_2
pytorch=1.12.0=cpu_py37h14e09b7_2
pytorch=1.12.0=cpu_py38h39c826d_1
pytorch=1.12.0=cpu_py310h75c9ab6_1
pytorch=1.12.0=cpu_py37h14e09b7_1
pytorch=1.12.0=cpu_py39h5d22d69_1
pytorch=1.12.0=cpu_py37h14e09b7_0
pytorch=1.12.0=cpu_py38h39c826d_0
pytorch=1.12.0=cpu_py38h39c826d_1
pytorch=1.12.0=cpu_py37h14e09b7_1
pytorch=1.12.0=cpu_py310h75c9ab6_0
pytorch=1.12.0=cpu_py39h5d22d69_0
pytorch=1.12.0=cpu_py38h39c826d_0
pytorch=1.12.0=cpu_py37h14e09b7_0
13 changes: 6 additions & 7 deletions crates/rattler_solve/tests/sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use std::path::Path;
use futures::FutureExt;
use itertools::Itertools;
use rattler_conda_types::{
Channel, MatchSpec, Matches, PackageName, ParseStrictness::Lenient, RepoDataRecord,
Channel, MatchSpec, PackageName, ParseStrictness::Lenient, RepoDataRecord,
};
use rattler_repodata_gateway::sparse::SparseRepoData;
use rattler_solve::{resolvo::CondaDependencyProvider, ChannelPriority, SolveStrategy};
use resolvo::{Interner, SolverCache};
use rstest::*;

fn load_repodata(package_name: &PackageName) -> Vec<RepoDataRecord> {
fn load_repodata(package_name: &PackageName) -> Vec<Vec<RepoDataRecord>> {
let channel_path = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../..")
.join("test-data")
Expand All @@ -23,8 +23,8 @@ fn load_repodata(package_name: &PackageName) -> Vec<RepoDataRecord> {

let sparse_repo_data = SparseRepoData::new(channel, "linux-64", repodata_json_path, None)
.expect("failed to load sparse repodata");
sparse_repo_data
.load_records(package_name)

SparseRepoData::load_records_recursive(&[sparse_repo_data], [package_name.clone()], None)
.expect("failed to load records")
}

Expand All @@ -33,12 +33,11 @@ fn create_sorting_snapshot(package_name: &str) -> String {
let package_name = match_spec.name.clone().unwrap();

// Load repodata
let mut repodata = load_repodata(&package_name);
repodata.retain(|record| match_spec.matches(record));
let repodata = load_repodata(&package_name);

// Construct dependency provider
let dependency_provider = CondaDependencyProvider::new(
[repodata.iter().collect()],
repodata.iter().map(|r| r.iter().collect()),
&[],
&[],
&[],
Expand Down

0 comments on commit 9b97d90

Please sign in to comment.