Skip to content

Commit

Permalink
fix: user agent string was wrong (#1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Aug 7, 2024
1 parent 608a65d commit 8b102b3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
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 crates/pixi_consts/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub const PYPROJECT_MANIFEST: &str = "pyproject.toml";
pub const PROJECT_LOCK_FILE: &str = "pixi.lock";
pub const CONFIG_FILE: &str = "config.toml";
pub const PIXI_DIR: &str = ".pixi";
pub const PIXI_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const PIXI_VERSION: &str = "0.27.0";
pub const PREFIX_FILE_NAME: &str = "pixi_env_prefix";
pub const ENVIRONMENTS_DIR: &str = "envs";
pub const SOLVE_GROUP_ENVIRONMENTS_DIR: &str = "solve-group-envs";
Expand Down
1 change: 1 addition & 0 deletions crates/pixi_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ itertools = { workspace = true }
miette = { workspace = true }
pep508_rs = { workspace = true }
pixi_config = { workspace = true }
pixi_consts = { workspace = true }
rattler_conda_types = { workspace = true }
rattler_networking = { workspace = true }
reqwest = { workspace = true }
Expand Down
5 changes: 3 additions & 2 deletions crates/pixi_utils/src/reqwest.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{path::PathBuf, sync::Arc, time::Duration};

use pixi_consts::consts;
use rattler_networking::{
authentication_storage::{self, backends::file::FileStorageError},
mirror_middleware::Mirror,
Expand Down Expand Up @@ -75,7 +76,7 @@ pub fn oci_middleware() -> OciMiddleware {
}

pub fn build_reqwest_clients(config: Option<&Config>) -> (Client, ClientWithMiddleware) {
static APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),);
let app_user_agent = format!("pixi/{}", consts::PIXI_VERSION);

// If we do not have a config, we will just load the global default.
let config = if let Some(config) = config {
Expand All @@ -91,7 +92,7 @@ pub fn build_reqwest_clients(config: Option<&Config>) -> (Client, ClientWithMidd
let timeout = 5 * 60;
let client = Client::builder()
.pool_max_idle_per_host(20)
.user_agent(APP_USER_AGENT)
.user_agent(app_user_agent)
.danger_accept_invalid_certs(config.tls_no_verify())
.read_timeout(Duration::from_secs(timeout))
.build()
Expand Down
4 changes: 4 additions & 0 deletions tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ src = "src/cli/mod.rs"
search = "PIXI_VERSION = \"{current_version}\""
src = "tests/integration/test_main_cli.py"

[[file]]
search = "pub const PIXI_VERSION: &str = \"{current_version}\";"
src = "crates/pixi_consts/src/consts.rs"

[[field]]
# the name of the field
name = "candidate"
Expand Down

0 comments on commit 8b102b3

Please sign in to comment.