Skip to content

pypi + conda deps monorepo best practices #4924

@pablovela5620

Description

@pablovela5620

Problem description

I have a lot of different code spread across a bunch of repos, and I'm starting to think that maybe a monorepo might be a better setup for me. There are a few discussions about how to use Pixi in this way.

#387
#3636

and also something that it seems that uv supports in a cargo like manner

https://docs.astral.sh/uv/concepts/projects/workspaces/

As I understand, this will basically work for PyPI dependencies only in the dependencies = []
and not those found in [tool.pixi.pypi-dependencies] or [tool.pixi.dependencies]

This is sort of what I'm thinking, such that the dev/gpu-related are the same for all subpackages.

pvlabs-mono/
├─ README.md
├─ pixi.toml              # Pixi workspace manifest (single source of truth)
├─ pixi.lock              # Single lockfile for entire workspace
├─ packages/
│  ├─ simplecv/
│  │  ├─ pyproject.toml   # package metadata + CLI entrypoints
│  │  ├─ simplecv/        # source code
│  │  ├─ tools/           # package-specific scripts
│  │  ├─ tests/
│  │  └─ data/
│  ├─ rtmlib/
│  │  ├─ pyproject.toml
│  │  ├─ rtmlib/
│  │  └─ tests/
│  ├─ monoprior/
│  │  ├─ pyproject.toml
│  │  ├─ monoprior/
│  │  └─ tests/
│  └─ wilor-nano/
│     ├─ pyproject.toml
│     ├─ wilor_nano/
│     └─ tests/
└─ .github/workflows/ci.yml
[workspace]
name = "pvlabs-mono"
channels = ["https://prefix.dev/conda-forge"]
platforms = ["linux-64", "osx-arm64", "win-64"]

[dependencies]
python = "==3.12"

# ---- Install all member packages via path ----
[pypi-dependencies]
simplecv   = { path = "packages/simplecv",   editable = true }
rtmlib     = { path = "packages/rtmlib",     editable = true }
monoprior  = { path = "packages/monoprior",  editable = true }
wilor-nano = { path = "packages/wilor-nano", editable = true }

# ---- GPU Feature ----
[feature.gpu.system-requirements]
cuda = "12.8"

[feature.gpu.dependencies]
pytorch-gpu  = "*"
cuda-version = "12.8.*"
torchvision  = "*"
xformers     = "*"

# ---- Dev Feature ----
[feature.dev.pypi-dependencies]
pytest = "*"
ruff   = "*"
mypy   = "*"

# ---- Environments ----
[environments]
gpu = { features = ["gpu", "dev"], solve-group = "base" }
cpu = { features = ["dev"],        solve-group = "base" }

My questions are

  1. any plans to make this work with conda deps
  2. can I make tasks work in each pyproject.toml, as I understand if I have [tool.pixi.task] in the pyproject then the top level pixi.toml wouldn't get picked up
  3. Are there best practices here? I don't know if this top-level toml is the right/recommended approach

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions