0

Publishing MTPX To PyPI

Build and validate a distribution, check metadata, and publish a package release.

Pu
Publishing MTPX To PyPI
Chapter 017ReleasePublishingIndex
01Orientation

This guide documents the release workflow for the mtpx package.

Use this when

Build and validate a distribution, check metadata, and publish a package release.

  • Prerequisites
  • Build
  • Validate Distributions
  • Publish To TestPyPI (Recommended First)
02 / syntax starter
python -m pip install --upgrade build twine
03 / manual

Read the system

The complete source manual—syntax, examples, linked references, edge cases, and implementation notes.

Documentation index ↗

This guide documents the release workflow for the mtpx package.

Prerequisites

  • PyPI account
  • Project ownership for mtpx on PyPI
  • Build tools:
bashpython -m pip install --upgrade build twine

Build

From repository root:

bashpython -m build

Artifacts:

  • dist/*.whl
  • dist/*.tar.gz

Validate Distributions

bashpython -m twine check dist/*
bashpython -m twine upload --repository testpypi dist/*

Install test package:

bashpip install --index-url https://test.pypi.org/simple/ mtpx

Publish To PyPI

bashpython -m twine upload dist/*

After upload:

bashpip install mtpx

Releasing A New Version

  1. Update version in pyproject.toml.
  2. Update CHANGELOG.md.
  3. Verify optional dependency extras are current and valid.
  4. Rebuild and validate.
  5. Publish with Twine.

Versioning policy uses semantic versioning:

  • Patch: bug fixes
  • Minor: backward-compatible features
  • Major: breaking changes

Suggested Release Checklist

bash# update pyproject.toml version first
python -m pytest tests/test_packaging_extras.py
python -m pip install -e ".[all]"
python -m build
python -m twine check dist/*
python -m twine upload dist/*

Optional git tagging:

bashgit tag v0.1.4
git push origin v0.1.4

Troubleshooting

  • File already exists
  • Version already published. Bump version and rebuild.
  • 403 Forbidden
  • Invalid or expired PyPI token.
  • Invalid distribution
  • Remove old artifacts and build again.

Notes

  • Core package import remains import mtp.
  • Package name for installation is mtpx.
  • Provider SDKs and database drivers are optional and installed separately.

Step 1: Clean old build files

Remove-Item -Recurse -Force dist, build -ErrorAction SilentlyContinue Remove-Item -Recurse -Force src\*.egg-info -ErrorAction SilentlyContinue

Step 2: Build the package

python -m build

Step 3: Validate the package

python -m twine check dist/*

Step 4: Upload to PyPI

python -m twine upload dist/release-0.1.37/mtpx-0.1.37-py3-none-any.whl dist/release-0.1.37/mtpx-0.1.37.tar.gz

pip install -e .

01

Read

Understand where Publishing MTPX To PyPI sits in the agent loop before adding abstractions.

02

Wire

Connect the smallest useful provider, registry, store, or event stream first.

03

Observe

Expose events, logs, results, and failure states while the runtime is still moving.

04

Harden

Add policy, tests, retries, and audit traces after the behavior is visible.

Next docMTP Roadmap