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

refactor: move config to repodata functions #1723

Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ rattler_repodata_gateway = { workspace = true, features = [
rattler_shell = { workspace = true, features = ["sysinfo"] }
rattler_solve = { workspace = true, features = ["resolvo", "serde"] }

pixi_config = { workspace = true }
pixi_config = { workspace = true, features = ["rattler_repodata_gateway"] }
pixi_consts = { workspace = true }
pixi_default_versions = { workspace = true }
pixi_manifest = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions crates/pixi_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ miette = { workspace = true }
pixi_consts = { workspace = true }
rattler = { workspace = true }
rattler_conda_types = { workspace = true }
rattler_repodata_gateway = { workspace = true, optional = true, features = [
"gateway",
] }
serde = { workspace = true }
serde_ignored = { workspace = true }
serde_json = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config.rs → crates/pixi_config/src/gateway.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pixi_config::Config;
use crate::Config;
use rattler_repodata_gateway::{ChannelConfig, SourceConfig};

/// Converts a [`Config`] into a rattler [`ChannelConfig`]
Expand Down
3 changes: 3 additions & 0 deletions crates/pixi_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ use rattler_conda_types::{
use serde::{de::IntoDeserializer, Deserialize, Serialize};
use url::Url;

#[cfg(feature = "rattler_repodata_gateway")]
pub mod gateway;

/// TODO: maybe remove this duplicate from `src/util.rs` at some point
pub fn default_channel_config() -> ChannelConfig {
ChannelConfig::default_with_root_dir(
Expand Down
2 changes: 1 addition & 1 deletion src/cli/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use rattler_solve::{resolvo::Solver, SolverImpl, SolverTask};
use rattler_virtual_packages::VirtualPackage;
use reqwest_middleware::ClientWithMiddleware;

use crate::utils::config::from_pixi_config;
use crate::{
prefix::Prefix,
progress::{await_in_progress, global_multi_progress, wrap_in_progress},
utils::{reqwest::build_reqwest_clients, PrefixGuard},
};
use pixi_config::gateway::from_pixi_config;
use pixi_config::{self, Config, ConfigCli};

/// Run a command in a temporary environment.
Expand Down
2 changes: 1 addition & 1 deletion src/project/repodata.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::project::Project;

use crate::utils::config::from_pixi_config;
use pixi_config::gateway::from_pixi_config;
use rattler_repodata_gateway::Gateway;
use std::path::PathBuf;

Expand Down
1 change: 0 additions & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod conda_environment_file;
pub(crate) mod config;
mod defaults;
pub mod indicatif;
mod prefix_guard;
Expand Down
Loading