Skip to content

Allow overriding BASE_WHEEL_URL via an environment variable#892

Open
songyz2019 wants to merge 1 commit intostate-spaces:mainfrom
songyz2019:main
Open

Allow overriding BASE_WHEEL_URL via an environment variable#892
songyz2019 wants to merge 1 commit intostate-spaces:mainfrom
songyz2019:main

Conversation

@songyz2019
Copy link
Copy Markdown

@songyz2019 songyz2019 commented Apr 2, 2026

Abstract

This is a simple patch to allow overriding BASE_WHEEL_URL in setup.py via an environment variable MAMBA_BASE_WHEEL_URL.

Motivation

  1. In some environments (e.g., corporate networks or air-gapped setups), direct access to GitHub Releases may be slow or unavailable. This causes installation to fail even when prebuilt wheels exist.
  2. Currently, the wheel download URL is hardcoded to GitHub: https://github.com/state-spaces/mamba/releases/download/{tag_name}/{wheel_name}

Related Issues

#848
#277

Proposal

This PR simply allows overriding the base URL via an environment variable:

BASE_WHEEL_URL = os.getenv(
    "MAMBA_BASE_WHEEL_URL",
    "https://github.com/state-spaces/mamba/releases/download/{tag_name}/{wheel_name}",
)

This preserves the existing behavior by default, while enabling users to redirect downloads
to mirrors or proxies (e.g., ghproxy, internal artifact stores, etc.).

Example

export MAMBA_BASE_WHEEL_URL="https://<your_mirror>/state-spaces/mamba/releases/download/{tag_name}/{wheel_name}"
pip install mamba-ssm

Benefits

  • Fully backward compatible (no behavior change by default)
  • Enables usage in restricted, internal or offline-friendly environments

Note

  • The URL format is expected to include {tag_name} and {wheel_name}
  • No changes to build or release workflow
  • This is tested on my machine locally with uv

Allow overriding the wheel download host (e.g., for mirrors or proxies)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant