From b5508debe5ac0e61e372e2ebad2e2a9da0c673c9 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Thu, 4 Jun 2026 10:52:24 -0500 Subject: [PATCH 1/2] Make baseten a namespace package and add PyPI publish workflow --- .github/workflows/publish.yml | 19 +++++++++++++++++++ README.md | 7 ++++++- baseten/__init__.py | 0 baseten/{ => client}/py.typed | 0 pyproject.toml | 6 ++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 baseten/__init__.py rename baseten/{ => client}/py.typed (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7667bf9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish to PyPI + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: astral-sh/setup-uv@v6 + + - run: uv build + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 3c7c787..2dcfd53 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,9 @@ from baseten.client import AsyncManagementClient async with AsyncManagementClient(api_key="my-api-key") as client: for model in (await client.api.get_models()).models: print(model.name) -``` \ No newline at end of file +``` + +## Upgrading from 0.8.2 and earlier + +Version 0.9.0 is a rewrite and shares no API with the earlier `baseten` releases. +Code written against 0.8.2 or earlier will not work. Pin `baseten<0.9` to keep it. \ No newline at end of file diff --git a/baseten/__init__.py b/baseten/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/baseten/py.typed b/baseten/client/py.typed similarity index 100% rename from baseten/py.typed rename to baseten/client/py.typed diff --git a/pyproject.toml b/pyproject.toml index 4603260..651e247 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,5 +53,11 @@ exclude = ["scripts/e2e_test_bootstrap/"] requires = ["hatchling"] build-backend = "hatchling.build" +# baseten is a PEP 420 namespace package shared across baseten-* distributions +# (e.g. baseten-loops provides baseten.loops). There is intentionally no +# baseten/__init__.py; this names the namespace dir for hatchling to package. +[tool.hatch.build.targets.wheel] +packages = ["baseten"] + [tool.pytest.ini_options] testpaths = ["tests"] From 7defb2a46be15e3ec4caf75389d3fff77c4bd990 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Thu, 4 Jun 2026 12:25:38 -0500 Subject: [PATCH 2/2] Add contents: read permission for checkout in publish workflow --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7667bf9..089114a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write + contents: read steps: - uses: actions/checkout@v4