baml icon indicating copy to clipboard operation
baml copied to clipboard

Publish baml package to `baml` instead of `baml-py`

Open aaronvg opened this issue 10 months ago • 4 comments

we own baml already. We should publish to this package and deprecate baml-py. It will reduce new-user onboarding friction.

aaronvg avatar Feb 22 '25 20:02 aaronvg

We could fix pip install baml with CI/CD Stub Package

Problem

pip install baml is currently broken, leading to undefined behavior. Many users likely try installing it, only to hit unexpected issues.

Simple Solution

Automate a CI/CD pipeline to publish a stub baml package that strictly depends on baml-py with the exact same version.

Example:

  • baml==0.12.3 → requires exactly baml-py==0.12.3

Why This Works

  • Immediate fix: Users no longer get a broken experience.
  • Minimal effort: Just an automated sync in CI/CD.
  • Future flexibility: We can later flip the dependency direction (make baml-py the stub) and eventually deprecate baml-py (warnings → errors).

This makes the issue low priority after implementation, with no user disruption.

Elijas avatar Feb 22 '25 21:02 Elijas

Put simply, this is the smallest setup needed to automate baml uploads to PyPI.

  1. Detect a new baml-py release
  2. Generate pyproject.toml with the same version
  3. Run the build & upload script

Contents of baml source code:

baml/
├── pyproject.toml  # Defines the package and its dependency on `baml-py`

Contents of pyproject.toml:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "baml"
version = "0.76.2"  # Must match `baml-py`
dependencies = ["baml-py==0.76.2"]
description = "Stub package for baml-py"
readme = "This package exists only to install `baml-py`. Use `baml-py` directly instead."

Elijas avatar Feb 22 '25 21:02 Elijas

Hi, just revisiting this before the ship sails too far away from the port :)

prrao87 avatar Mar 14 '25 12:03 prrao87