Skip to content

package

kubed-io[bot] edited this page Nov 24, 2026 · 6 revisions

Package

What kubed-mcp is as a distribution, before any of its code: its names, the namespace it shares, the interpreters it supports, what it depends on, how a version is decided and how one is published. This area covers pyproject.toml, kubed/mcp/__init__.py's version, package.yml, publish.yml and the changelog's role in a release.

Use cases

  • A server adds kubed-mcp to its dependencies and imports kubed.mcp beside its own kubed.* package, and neither shadows the other.
  • A caller reads kubed.mcp.__version__ and gets the version pip installed.
  • Dr K runs publish.yml as a dry run, reads the next version and its notes, then runs it again to release.
  • A contributor moves the Python floor and finds every place that states it.

Neighbours

PKG-1. How to set up the repo, run the checks and write a changelog entry is in CONTRIBUTING.md and is not restated here. Each consumer's own pin on kubed-mcp belongs to that consumer.

Names

PKG-2. The distribution is kubed-mcp on PyPI, built from the repository kubed-io/quick-mcp and MIT licensed. The repository ships that distribution and nothing else: no image and no Kubernetes manifests.

PKG-3. The import path is kubed.mcp. The distribution name and the import path differ on purpose, and neither is renamed: both are public contracts.

The namespace

PKG-4. kubed is a PEP 420 namespace package. The repository has no kubed/__init__.py, ever, so kubed.mcp installs beside kubed.mcp_kb and kubed.selenium_flow in one environment.

PKG-5. pyproject.toml lists every package by name under [tool.setuptools] packages, starting at kubed.mcp, and never lists kubed. setuptools takes the list literally, so a new subpackage is added to it or does not ship.

PKG-6. Two checks hold PKG-4: tests/test_package.py asserts that the imported kubed has no __file__, and package.yml installs the built wheel into a clean virtualenv and asserts the same there.

Python

PKG-7. requires-python is >=3.11, the floor both consumers already have.

PKG-8. The tested range is 3.11 to 3.14. test.yml runs 3.11 and 3.14 on a pull request, and all four on a push to main and before a release (PKG-14). The trove classifiers name exactly those four versions, and ruff's target-version is py311. Moving the floor or the ceiling moves all three together.

Dependencies

PKG-9. The runtime dependencies are fastmcp>=4.2,<5 and pyyaml>=6,<7, which the plugin layer reads frontmatter with. kubed-mcp owns the FastMCP pin: its servers take FastMCP through it and the facade. The tasks extra adds fastmcp[tasks] in the same range. The build and test extras are for the repository's own pipeline and are never needed at runtime.

PKG-22. The telemetry extra holds every package the telemetry area starts: pyroscope-io, pyroscope-otel, opentelemetry-distro, opentelemetry-sdk, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-prometheus and opentelemetry-instrumentation-logging. None of them is a runtime dependency, so a plain kubed-mcp install carries none. A server's image that wants telemetry installs kubed-mcp[telemetry].

PKG-21. The package ships a py.typed marker, so a consumer's type checker reads the package's own annotations, and Inject[T] as T (DI-13).

Versions

PKG-10. kubed.mcp.__version__ is the installed distribution's version, read at import with importlib.metadata.version("kubed-mcp"). No version literal is written in the source.

PKG-11. A version comes from git tags of the form v<semver>, through setuptools_scm, and pyproject.toml declares version dynamic. A build from an untagged commit gets a development version. Every job that builds checks out the full history (fetch-depth: 0), because a shallow clone yields a wrong version silently.

PKG-12. A tag is made only by publish.yml (PKG-16). No one tags by hand, and no file is edited to bump a version.

Building

PKG-13. package.yml builds the sdist and the wheel, checks their metadata with twine check --strict, installs the wheel into a clean virtualenv, asserts that it imports as kubed.mcp and reports the version it was built as, and uploads both files as one artifact. It runs on every pull request, on every push to main, and for each release.

Publishing

PKG-14. publish.yml is the only way a version is released. It is dispatched by hand, with the bump (patch, minor, major or a pre-release) and a push input that defaults to false. A run with push true is refused from any branch but main.

PKG-15. A run with push false is the dry run: the full test matrix, the next version and its notes, and both builds, with nothing tagged, uploaded or released. A release is a dry run first and then the same inputs with push true, so a broken build is found before a tag exists that never reached PyPI.

PKG-16. A run with push true runs, in order: the full test matrix; the version job, which rolls the changelog (PKG-19) and commits and tags on main as the kubed.io GitHub App; package.yml at that tag; the PyPI upload; and the GitHub release. Nothing outward-facing happens before every artifact it refers to exists.

PKG-17. The PyPI upload uses trusted publishing, with no stored token. PyPI binds it to the workflow file publish.yml and the environment pypi, so the upload is a job in publish.yml, never in a called workflow, and renaming the file breaks publishing until the binding on PyPI is changed to match.

PKG-18. The GitHub release is made on the new tag and carries the same sdist and wheel that went to PyPI, downloaded from the one artifact package.yml uploaded. A tag with a - in it is marked a pre-release.

Release notes

PKG-19. The changelog's [Unreleased] section is the release notes. The version job stamps a dated version heading on it, and the release body is that section followed by GitHub's generated notes. Notes that come back empty fail the run before anything reaches PyPI.

PKG-20. Only [Unreleased] is edited by hand. Every section below it carries a version and is never changed, and no one writes a version heading: the release writes it.

Clone this wiki locally