Add Make target for PyPI publishing
This commit is contained in:
parent
7ccab61a1b
commit
fb718af154
3 changed files with 30 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ This repository ships `pyro-mcp`, an MCP-compatible package for ephemeral VM lif
|
||||||
- Run `make setup` after cloning.
|
- Run `make setup` after cloning.
|
||||||
- Run `make check` before opening a PR.
|
- Run `make check` before opening a PR.
|
||||||
- Run `make dist-check` when you change packaging, entrypoints, or install docs.
|
- Run `make dist-check` when you change packaging, entrypoints, or install docs.
|
||||||
|
- Use `make pypi-publish` for manual PyPI uploads after setting `TWINE_PASSWORD`.
|
||||||
- Public user-facing CLI is `pyro`.
|
- Public user-facing CLI is `pyro`.
|
||||||
- Public Python SDK entrypoint is `from pyro_mcp import Pyro`.
|
- Public Python SDK entrypoint is `from pyro_mcp import Pyro`.
|
||||||
- The packaged runtime images under `src/pyro_mcp/runtime_bundle/` are stored in Git LFS.
|
- The packaged runtime images under `src/pyro_mcp/runtime_bundle/` are stored in Git LFS.
|
||||||
|
|
|
||||||
20
Makefile
20
Makefile
|
|
@ -11,8 +11,11 @@ RUNTIME_MATERIALIZED_DIR ?= build/runtime_sources
|
||||||
RUNTIME_OCI_LAYOUT_DIR ?= build/oci_layouts
|
RUNTIME_OCI_LAYOUT_DIR ?= build/oci_layouts
|
||||||
RUNTIME_ENVIRONMENT ?= debian:12-base
|
RUNTIME_ENVIRONMENT ?= debian:12-base
|
||||||
RUNTIME_ENVIRONMENTS ?= debian:12-base debian:12 debian:12-build
|
RUNTIME_ENVIRONMENTS ?= debian:12-base debian:12 debian:12-build
|
||||||
|
PYPI_DIST_DIR ?= dist
|
||||||
|
TWINE_USERNAME ?= __token__
|
||||||
|
PYPI_REPOSITORY_URL ?=
|
||||||
|
|
||||||
.PHONY: help setup lint format typecheck test check dist-check demo network-demo doctor ollama ollama-demo run-server install-hooks runtime-bundle runtime-binaries runtime-kernel runtime-rootfs runtime-agent runtime-validate runtime-manifest runtime-sync runtime-clean runtime-fetch-binaries runtime-build-kernel-real runtime-build-rootfs-real runtime-materialize runtime-export-environment-oci runtime-export-official-environments-oci runtime-publish-environment-oci runtime-publish-official-environments-oci runtime-boot-check runtime-network-check
|
.PHONY: help setup lint format typecheck test check dist-check pypi-publish demo network-demo doctor ollama ollama-demo run-server install-hooks runtime-bundle runtime-binaries runtime-kernel runtime-rootfs runtime-agent runtime-validate runtime-manifest runtime-sync runtime-clean runtime-fetch-binaries runtime-build-kernel-real runtime-build-rootfs-real runtime-materialize runtime-export-environment-oci runtime-export-official-environments-oci runtime-publish-environment-oci runtime-publish-official-environments-oci runtime-boot-check runtime-network-check
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@printf '%s\n' \
|
@printf '%s\n' \
|
||||||
|
|
@ -25,6 +28,7 @@ help:
|
||||||
' test Run pytest' \
|
' test Run pytest' \
|
||||||
' check Run lint, typecheck, and tests' \
|
' check Run lint, typecheck, and tests' \
|
||||||
' dist-check Smoke-test the installed pyro CLI and environment UX' \
|
' dist-check Smoke-test the installed pyro CLI and environment UX' \
|
||||||
|
' pypi-publish Build, validate, and upload the package to PyPI' \
|
||||||
' demo Run the deterministic VM demo' \
|
' demo Run the deterministic VM demo' \
|
||||||
' network-demo Run the deterministic VM demo with guest networking enabled' \
|
' network-demo Run the deterministic VM demo with guest networking enabled' \
|
||||||
' doctor Show runtime and host diagnostics' \
|
' doctor Show runtime and host diagnostics' \
|
||||||
|
|
@ -77,6 +81,20 @@ dist-check:
|
||||||
.venv/bin/pyro env inspect debian:12 >/dev/null
|
.venv/bin/pyro env inspect debian:12 >/dev/null
|
||||||
.venv/bin/pyro doctor >/dev/null
|
.venv/bin/pyro doctor >/dev/null
|
||||||
|
|
||||||
|
pypi-publish:
|
||||||
|
@if [ -z "$$TWINE_PASSWORD" ]; then \
|
||||||
|
printf '%s\n' 'TWINE_PASSWORD is required; use a PyPI API token.' >&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
rm -rf "$(PYPI_DIST_DIR)"
|
||||||
|
uv build --out-dir "$(PYPI_DIST_DIR)"
|
||||||
|
uvx --from twine twine check "$(PYPI_DIST_DIR)"/*
|
||||||
|
@if [ -n "$(PYPI_REPOSITORY_URL)" ]; then \
|
||||||
|
TWINE_USERNAME="$(TWINE_USERNAME)" uvx --from twine twine upload --repository-url "$(PYPI_REPOSITORY_URL)" "$(PYPI_DIST_DIR)"/*; \
|
||||||
|
else \
|
||||||
|
TWINE_USERNAME="$(TWINE_USERNAME)" uvx --from twine twine upload "$(PYPI_DIST_DIR)"/*; \
|
||||||
|
fi
|
||||||
|
|
||||||
demo:
|
demo:
|
||||||
uv run pyro demo
|
uv run pyro demo
|
||||||
|
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -212,3 +212,13 @@ The publisher accepts either `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN` or
|
||||||
Docker Hub uploads are chunked by default for large rootfs layers; if you need to tune a slow
|
Docker Hub uploads are chunked by default for large rootfs layers; if you need to tune a slow
|
||||||
link, use `PYRO_OCI_UPLOAD_TIMEOUT_SECONDS`, `PYRO_OCI_UPLOAD_CHUNK_SIZE_BYTES`, and
|
link, use `PYRO_OCI_UPLOAD_TIMEOUT_SECONDS`, `PYRO_OCI_UPLOAD_CHUNK_SIZE_BYTES`, and
|
||||||
`PYRO_OCI_REQUEST_TIMEOUT_SECONDS`.
|
`PYRO_OCI_REQUEST_TIMEOUT_SECONDS`.
|
||||||
|
|
||||||
|
For a local PyPI publish:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export TWINE_PASSWORD='pypi-...'
|
||||||
|
make pypi-publish
|
||||||
|
```
|
||||||
|
|
||||||
|
`make pypi-publish` defaults `TWINE_USERNAME` to `__token__`.
|
||||||
|
Set `PYPI_REPOSITORY_URL=https://test.pypi.org/legacy/` to publish to TestPyPI instead.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue