feat: Migrate package management from conda to uv
Author: phpmacCreated May 9, 2026Updated Aug 31, 2026
Summary
Migrate Hummingbot's package management from conda to uv, significantly improving installation speed and developer experience.
Motivation
- Installation speed: conda environment creation takes 10-15 minutes;
uv synconly 1-2 minutes - Dependency management: conda's
environment.ymlis complex to maintain;pyproject.toml+uv.lockis the Python ecosystem standard - Docker build: No need for a full conda distribution; smaller image size and faster builds
- Compatibility:
pysha3fails to compile under Python 3.12 + conda, requiring extra workarounds
Changes
18 files changed, +2241/-686 lines:
| Type | File | Description |
|---|---|---|
| Rewrite | Dockerfile |
conda multi-stage → uv multi-stage build |
| Rewrite | Makefile |
All conda commands → uv commands; added clean target |
| Rewrite | install |
conda env create → uv sync |
| Rewrite | pyproject.toml |
Full dependency declaration, Python 3.12, pysha3 shim source |
| Added | uv.lock |
173 packages locked |
| Added | third_party/pysha3_shim/ |
Local shim to fix pysha3 compilation failure on Python 3.12 |
| Updated | .github/workflows/ |
setup-python + setup-uv replacing conda cache |
| Removed | setup/environment.yml |
conda env file no longer needed |
| Removed | setup/environment_dydx.yml |
dYdX-specific conda env |
| Removed | setup/pip_packages.txt |
Dependencies now declared in pyproject.toml |
Key Design Decisions
pysha3 shim
pysha3 fails to compile on Python 3.12 and is unmaintained. Created third_party/pysha3_shim/ to redirect imports to safe-pysha3 (maintained fork):
# pyproject.toml
[tool.uv.sources]
pysha3 = { path = "third_party/pysha3_shim" }Docker multi-stage build
# Install stage
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
# Cython compilation stage
RUN uv run python setup.py build_ext --inplaceMakefile command mapping
| Old (conda) | New (uv) |
|---|---|
conda env create -f setup/environment.yml |
uv sync |
conda activate hummingbot |
uv run |
conda env remove -n hummingbot |
rm -rf .venv |
coverage run |
uv run coverage run |
Testing
-
make install— all dependencies installed successfully -
make run— CLI starts normally -
docker compose build && docker compose up— Docker build and run work correctly -
make test— pytest executes normally - V2 strategies (Controller-Executor) work correctly
- Binance Perpetual connector REST/WS connections work normally
- Cython
.pyxcompilation works correctly
Migration Guide for Users
# Old (conda)
conda env create -f setup/environment.yml
conda activate hummingbot
# New (uv)
uv sync
uv run python bin/hummingbot.pyDocker workflow unchanged:
docker compose build && docker compose up -dRelated
- uv official docs: https://docs.astral.sh/uv/
- uv has become the mainstream replacement for pip/pip-tools/poetry/conda in the Python ecosystem
Source: hummingbot/hummingbot