Skip to content

Commit a5a05c2

Browse files
committed
chore(sdk-python): release 0.1.0b1 as the first public beta
- Accept canonical PEP 440 pre-releases (X.Y.Z{a|b|rc}N) in release_check.py and cover stable, pre-release and rejected npm-style versions in tests. - Set the version to 0.1.0b1 and add the Beta development status classifier. - Document --pre installation in the README and pre-release rules in RELEASING.md.
1 parent 8c842ea commit a5a05c2

8 files changed

Lines changed: 58 additions & 12 deletions

File tree

‎packages/code-sdk-python/CHANGELOG.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ All notable changes to the `minimax-code-sdk` Python package are documented here
44
versioned independently of the MiniMax Code CLI and of the TypeScript SDK. The first
55
`## X.Y.Z · YYYY-MM-DD` heading is the version being released; see [RELEASING.md](RELEASING.md).
66

7-
## 0.1.0 · 2026-11-03
7+
## 0.1.0b1 · 2026-11-03
88

9-
First public release.
9+
First public beta. Install it with `pip install --pre minimax-code-sdk`; the API may still
10+
change before `0.1.0`.
1011

1112
### Added
1213

‎packages/code-sdk-python/README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ It mirrors the TypeScript SDK
1111
- Python 3.10+
1212
- The `mcode` CLI (0.6.3 or newer): `npm install -g @minimax-ai/code`
1313

14+
## Install
15+
16+
```bash
17+
pip install --pre minimax-code-sdk # or: uv add --prerelease=allow minimax-code-sdk
18+
```
19+
20+
The SDK is in beta, so installers need `--pre` (or an exact version such as
21+
`minimax-code-sdk==0.1.0b1`) until `0.1.0` is released. Import it as `minimax_code`.
22+
1423
The CLI is found from `MCodeOptions(bin=...)`, then the `MCODE_BIN` environment variable,
1524
then `PATH`.
1625

‎packages/code-sdk-python/RELEASING.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ independently of the CLI and of `@minimax-ai/code-sdk`.
1212
- A published version is immutable. PyPI never accepts the same file name twice, even after a
1313
release is deleted. Fix problems in a new version; prefer **yanking** a broken release over
1414
deleting it.
15-
- Versions are stable `X.Y.Z`. There is no prerelease channel yet.
16-
- Release tags are `code-sdk-python-vX.Y.Z`. They are separate from CLI tags (`vX.Y.Z`) and
15+
- Versions are stable `X.Y.Z` or PEP 440 pre-releases `X.Y.ZaN`, `X.Y.ZbN` and `X.Y.ZrcN` (for
16+
example `0.1.0b1`), written in canonical form. Never use npm-style `0.1.0-beta.1`. See
17+
[Pre-releases](#pre-releases).
18+
- Release tags are `code-sdk-python-v<version>`, for example `code-sdk-python-v0.1.0b1`. They are separate from CLI tags (`vX.Y.Z`) and
1719
TypeScript SDK tags (`code-sdk-vX.Y.Z`). Never move or delete a pushed release tag.
1820
- Do not upload from a workstation. If the workflow is unavailable, fix the workflow.
1921

@@ -86,6 +88,19 @@ The tag push starts the workflow. Its `build` job:
8688
The `publish-pypi` job then waits for approval on the `pypi` environment and uploads exactly the
8789
checked files with `pypa/gh-action-pypi-publish`, which also attaches PyPI attestations.
8890

91+
## Pre-releases
92+
93+
Pre-releases go to the real PyPI index through the same workflow and checks; only the version
94+
differs. Installers skip them unless the user passes `--pre` (pip), `--prerelease=allow` (uv) or
95+
pins the exact version, so `pip install minimax-code-sdk` keeps resolving to the newest stable
96+
release once one exists. Keep the README install instructions in line with the latest release.
97+
98+
- Fix a broken pre-release with the next number (`0.1.0b2`), not by reusing a version.
99+
- Promote by releasing `0.1.0` with its own CHANGELOG section; earlier pre-releases stay in the
100+
history and need no cleanup.
101+
- When the first stable release ships, drop `--pre` from the README install instructions and
102+
replace `Development Status :: 4 - Beta` in `pyproject.toml` as appropriate.
103+
89104
## 4. Read back
90105

91106
```bash

‎packages/code-sdk-python/pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "minimax-code-sdk"
7-
version = "0.1.0"
7+
version = "0.1.0b1"
88
description = "Python SDK for driving the local MiniMax Code (mcode) agent."
99
readme = "README.md"
1010
license = "MIT"
@@ -13,6 +13,7 @@ requires-python = ">=3.10"
1313
dependencies = ["typing_extensions>=4.7"]
1414
keywords = ["minimax", "minimax-code", "mcode", "agent", "coding-agent", "sdk"]
1515
classifiers = [
16+
"Development Status :: 4 - Beta",
1617
"Programming Language :: Python :: 3",
1718
"Operating System :: OS Independent",
1819
"Typing :: Typed",

‎packages/code-sdk-python/scripts/release_check.py‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
ROOT = Path(__file__).resolve().parent.parent
2727
INDEXES = {"pypi": "https://pypi.org", "testpypi": "https://test.pypi.org"}
2828

29-
_VERSION = re.compile(r"\d+\.\d+\.\d+")
29+
# Stable X.Y.Z or a PEP 440 pre-release X.Y.Z{a|b|rc}N, in canonical form.
30+
_VERSION = re.compile(
31+
r"(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:(?:a|b|rc)(?:0|[1-9]\d*))?"
32+
)
3033
_PROJECT_VERSION = re.compile(r'^version\s*=\s*"([^"]*)"\s*$', re.MULTILINE)
3134
_INIT_VERSION = re.compile(r'^__version__\s*=\s*"([^"]*)"\s*$', re.MULTILINE)
3235
_CHANGELOG_HEADING = re.compile(r"^## (\S+) · (\d{4}-\d{2}-\d{2})\s*$", re.MULTILINE)
@@ -73,19 +76,22 @@ def check_metadata(root: Path = ROOT, tag: str | None = None) -> str:
7376
version = meta.project_version
7477
problems: list[str] = []
7578
if version is None or not _VERSION.fullmatch(version):
76-
problems.append(f"pyproject.toml [project].version must be X.Y.Z; found {version!r}.")
79+
problems.append(
80+
"pyproject.toml [project].version must be X.Y.Z or X.Y.Z{a|b|rc}N; "
81+
f"found {version!r}."
82+
)
7783
if meta.init_version != version:
7884
problems.append(
7985
f"src/{IMPORT_NAME}/__init__.py __version__ is {meta.init_version!r}, "
8086
f"pyproject.toml has {version!r}."
8187
)
8288
if meta.changelog_version != version:
8389
problems.append(
84-
"The first CHANGELOG.md heading must be '## X.Y.Z · YYYY-MM-DD' for the release "
90+
"The first CHANGELOG.md heading must be '## <version> · YYYY-MM-DD' for the release "
8591
f"version {version!r}; found {meta.changelog_version!r}."
8692
)
8793
if tag is not None and tag != f"{TAG_PREFIX}{version}":
88-
problems.append(f"Tag {tag!r} does not match version {version!r} ({TAG_PREFIX}X.Y.Z).")
94+
problems.append(f"Tag {tag!r} does not match version {version!r} ({TAG_PREFIX}<version>).")
8995
if problems:
9096
raise ReleaseCheckError("\n".join(problems))
9197
assert version is not None
@@ -178,7 +184,7 @@ def main(argv: list[str] | None = None) -> int:
178184
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0] if __doc__ else None)
179185
sub = parser.add_subparsers(dest="command", required=True)
180186
meta = sub.add_parser("metadata", help="check versions, changelog and tag")
181-
meta.add_argument("--tag", help=f"release tag, {TAG_PREFIX}X.Y.Z")
187+
meta.add_argument("--tag", help=f"release tag, {TAG_PREFIX}<version>")
182188
meta.add_argument("--index", choices=sorted(INDEXES), help="fail if already published there")
183189
dist = sub.add_parser("dist", help="check the built wheel and sdist")
184190
dist.add_argument("dist_dir", type=Path)

‎packages/code-sdk-python/src/minimax_code/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Usage,
3232
)
3333

34-
__version__ = "0.1.0"
34+
__version__ = "0.1.0b1"
3535

3636
__all__ = [
3737
"MCODE_EXEC_EXIT_CODES",

‎packages/code-sdk-python/tests/test_release_check.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ def test_repository_metadata_is_consistent() -> None:
3838
assert rc.check_metadata() == minimax_code.__version__
3939

4040

41+
@pytest.mark.parametrize("version", ["0.1.0b1", "1.0.0a2", "2.3.4rc10", "1.2.3"])
42+
def test_metadata_accepts_stable_and_pre_release_versions(tmp_path: Path, version: str) -> None:
43+
root = project(tmp_path, version=version, init=version, log=version)
44+
assert rc.check_metadata(root, tag=f"code-sdk-python-v{version}") == version
45+
46+
47+
@pytest.mark.parametrize(
48+
"version", ["0.1.0-beta.1", "0.1.0.dev1", "0.1.0beta1", "01.0.0", "0.1.0b"]
49+
)
50+
def test_metadata_rejects_non_canonical_versions(tmp_path: Path, version: str) -> None:
51+
with pytest.raises(rc.ReleaseCheckError, match=r"X\.Y\.Z"):
52+
rc.check_metadata(project(tmp_path, version=version, init=version, log=version))
53+
54+
4155
def test_metadata_accepts_matching_tag(tmp_path: Path) -> None:
4256
assert rc.check_metadata(project(tmp_path), tag="code-sdk-python-v1.2.3") == "1.2.3"
4357

‎packages/code-sdk-python/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)