Pull request 47: the project moves from pip to uv

1 hour ago

This pull request makes uv the only Python toolchain for the MikroTik MCP server. pip and setuptools are gone, the build backend is hatchling, and a committed lock file pins every dependency with hashes. CI, the release pipeline, the Docker image and local development all install from that same frozen lock.

Ask about this presentation

Chapters

  1. 0:00One toolchain
  2. 0:21Why
  3. 0:43The pipeline
  4. 1:08Evidence
  5. 1:36Still open
Show transcript
  1. This pull request makes uv the only Python toolchain for the MikroTik MCP server. pip and setuptools are gone, the build backend is hatchling, and a committed lock file pins every dependency with hashes. CI, the release pipeline, the Docker image and local development all install from that same frozen lock.

    Slide text
    PR 47

    One toolchain: uv replaces pip and setuptools

    uv.lock · hatchling · uv sync --frozen
  2. The author measured creating a fresh environment and installing everything. With pip it took about thirteen seconds. With uv it takes under one, roughly sixteen times faster. The bigger win is reproducibility. pip had no lock file, so two installs could resolve different versions. Now every flow installs the same hash-verified set.

    Slide text
    Why

    13 seconds of setup becomes under 1

    pip 13.16 s · uv 0.84 s · one lock for every flow
  3. CI gets a gate that fails any pull request whose pyproject changed without a matching lock file. A second job builds the wheel and checks both documented install paths, uvx and pip with python -m mcp_mikrotik, and confirms that Python below 3.10 is refused. The release build is gated on a current lock, and the MCP publisher is pinned and checksum verified.

    Slide text
    The work

    CI now fails a pull request with a stale lock

    drift gate · install paths · pinned publisher
  4. The first reviewer asked for strong test results, because swapping the toolchain is a core change. The author compared the published version, a local uv build and the Docker image on a real RouterOS 7.22 router. More than 45 read-only tool calls gave identical output. After the final rebase, the unit tests pass on three Python versions from the frozen lock, and the Docker image is about 150 megabytes against 200 for the published one.

    Slide text
    Evidence

    Identical output on a real router

    45+ tool calls · RouterOS 7.22 · 717 unit tests
  5. Some limits remain. A plain pip install of the published package still resolves version ranges, so the exact pin guarantee only covers uv flows. The arm64 Docker build was not run, only checked statically. And merging triggers a release, so that release is the first real run of uv build and the pinned publisher. If you maintain releases, watch that run.

    Slide text
    Still open

    The first release will exercise the new pipeline

    pip users get ranges · arm64 not run · uv build untested live

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York