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"
```
This commit is contained in:
Zanie Blue 2023-12-20 04:52:00 -06:00 committed by GitHub
parent ab15b08cbe
commit 4e437ba7e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,7 @@ struct PipCompileArgs {
output_file: Option<PathBuf>,
/// 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<PathBuf>,
/// 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`.