From 4e437ba7e592c46b785bdb150e19796919e1718b Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 20 Dec 2023 04:52:00 -0600 Subject: [PATCH] Allow the default index url to be configured with `PUFFIN_INDEX_URL` (#704) This allows the default index URL to be easily overridden with a local index e.g. a `packse` server ``` export PUFFIN_INDEX_URL="http://localhost:3141/packages/all/+simple" ``` --- crates/puffin-cli/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/puffin-cli/src/main.rs b/crates/puffin-cli/src/main.rs index 700af7587..ed81fb66a 100644 --- a/crates/puffin-cli/src/main.rs +++ b/crates/puffin-cli/src/main.rs @@ -148,7 +148,7 @@ struct PipCompileArgs { output_file: Option, /// The URL of the Python Package Index. - #[clap(long, short, default_value = IndexUrl::Pypi.as_str())] + #[clap(long, short, default_value = IndexUrl::Pypi.as_str(), env = "PUFFIN_INDEX_URL")] index_url: IndexUrl, /// Extra URLs of package indexes to use, in addition to `--index-url`. @@ -214,7 +214,7 @@ struct PipSyncArgs { link_mode: install_wheel_rs::linker::LinkMode, /// The URL of the Python Package Index. - #[clap(long, short, default_value = IndexUrl::Pypi.as_str())] + #[clap(long, short, default_value = IndexUrl::Pypi.as_str(), env = "PUFFIN_INDEX_URL")] index_url: IndexUrl, /// Extra URLs of package indexes to use, in addition to `--index-url`. @@ -305,7 +305,7 @@ struct PipInstallArgs { output_file: Option, /// The URL of the Python Package Index. - #[clap(long, short, default_value = IndexUrl::Pypi.as_str())] + #[clap(long, short, default_value = IndexUrl::Pypi.as_str(), env = "PUFFIN_INDEX_URL")] index_url: IndexUrl, /// Extra URLs of package indexes to use, in addition to `--index-url`.