Skip to main content

fastship

Tiny, local-first release tools for modern Python projects.

fastship gives you the same workflow feel as the nbdev nbdev-bump-version, release-pypi, and release-gh commands — but for plain (non-notebook) Python projects.

ship-bump uses the same version bumping and synchronization for every Python project. In an nbdev project (one with [tool.nbdev] in pyproject.toml) whose version comes from __init__.py, it then exports the notebooks; ship-pypi, ship-changelog, and ship-gh delegate to their nbdev equivalents. Projects with a static [project].version use fastship’s Python flow.

Install

pip install 'fastship[all]'      # full CLI (release, docs, scaffolding)
pip install 'fastship[docs]'     # docs generation only (ship-docs, ship-preview, ship-llms)
pip install fastship             # minimal core (ship-bump)

Quick start

Create a new project:

ship-new my-project
cd my-project
pip install -e .[dev]

This creates a complete project with pyproject.toml, __version__, LICENSE, README, .github/workflows/docs.yml, and everything wired for fastship. Author metadata comes from Git’s user.name and user.email.

Commands

ship-bump

Bump a semver part (X.Y.Z, counted from the left: 0=major, 1=minor, 2=patch). The default increments patch (or .postN when present). For Rust projects (a Cargo.toml next to pyproject.toml) it bumps the version in Cargo.toml without rebuilding; otherwise it rewrites a static [project].version when present, or __version__ in your package __init__.py:

ship-bump --part 2
ship-bump --part 1
ship-bump --part 0

With a post-release version, the default command increments the post component:

0.0.2026082005.post1 → 0.0.2026082005.post2

Supplying --part explicitly bumps that release component and removes the post component.

Decrement instead:

ship-bump --part 2 --unbump

ship-pypi

Build + upload to PyPI:

ship-pypi

Upload to a named repository in ~/.pypirc (e.g. testpypi):

ship-pypi --repository testpypi

Quiet mode:

ship-pypi --quiet

Build and upload a wheel without creating an sdist, either directly or as part of a plain Python release:

ship-pypi --wheel-only
ship-release --wheel-only

For a permanently wheel-only project:

[tool.fastship]
wheel-only = true

ship-docs and ship-preview

Build or live-preview a pure-Markdown Quarto documentation site (HTML, .html.md, and llms.txt, zero Jupyter) from README.md, public .py modules, optional docs/*.md guides, and pkg/skill.py:

ship-docs                # render site to _docs/
ship-preview             # live preview with automatic re-staging on file edits

Public .py modules become API pages under docs/api/ in source definition order (filtered by __all__, skipping skill.py, guidance.py, _*.py, and modules covered under docs/). Place # - order: 1 or # - title: My Title comments after a module docstring to control page order and title, and use top-level string literals for Markdown section headings and notes. Backticked symbols in README.md, docs/, and docstrings are automatically linkified across the current repo (relative links) and installed nbdev entry-point packages. Add optional guides as .md or .qmd files under docs/. Use {{< doc pkg.mod.sym >}} or {{< doc pkg.mod >}} shortcodes to embed API docs, or omit the module prefix when YAML frontmatter sets module: pkg.mod. In [tool.nbdev] projects, ship-docs and ship-preview delegate to nbdev-docs and nbdev-preview.

ship-pages

Add .github/workflows/docs.yml (calling AnswerDotAI/workflows/fastship-docs@master), remove legacy Jekyll files if present, set [project.urls].Documentation and [project.entry-points.nbdev] (pkg = "pkg._modidx:d"), enable GitHub Pages Actions (build_type="workflow"), and set the repository homepage to the Pages URL:

ship-pages
ship-pages --runner macos-latest

Run this after creating the GitHub repository and making its first push. The repository is inferred from the local origin remote, and authentication uses the same token lookup as ship-gh.

ship-llms

Generate repo-root llms.txt from pkg/skill.py via pyskills.llms:

ship-llms

When .github/workflows/docs.yml is present, llms.txt links directly to the published .html.md pages under docs/ and docs/api/, and pkg/_modidx.py is updated with the public symbol index (d = ...) for cross-repo linkification. Projects with [tool.nbdev] are skipped because nbdev-export manages nbs/llms.txt. Hand-written llms.txt files without a generator marker are never overwritten.

PyO3 / maturin projects

Fastship can also handle the repeated local tooling for PyO3 projects that use maturin and need Rust CLI binaries bundled into wheel scripts.

Create a new PyO3 project:

ship-rs-new my-project
cd my-project
pip install -e .[dev]
cargo develop
pytest -q

The project is a Cargo workspace. Other Rust crates can depend on its root package, a pure Rust crate, without building PyO3. maturin builds the Python extension from the py member through [tool.maturin].manifest-path. The py member is never published. Both crates share the version in [workspace.package].

Use Cargo.toml as the version source:

[project]
name = "my_project"
dynamic = ["version"]

A Cargo workspace root with version.workspace = true, or a virtual workspace without a root package, is read and bumped through [workspace.package]. A root package with a literal version uses [package].version, leaving any shared workspace version unchanged. [tool.fastship].version-files lists synchronized copies of the version, such as an npm package.json beside a wasm crate, and ship-bump rewrites them with the same exactly-once check as Python projects.

Commands:

ship-rs-new my-project  # create a new maturin/PyO3 project
ship-rs-init            # configure an existing maturin/PyO3 project
ship-rs-build            # build a release wheel through the configured backend
ship-bump                # bump Cargo.toml version without rebuilding
ship-release             # tag, publish via CI, then bump

ship-rs-init must be run from an existing maturin project with Cargo.toml. It sets [project].dynamic = ["version"], removes [project].version, and exposes __version__ from CARGO_PKG_VERSION when it finds the PyO3 module in the crate that [tool.maturin].manifest-path names.

ship-rs-build uses python -m build --wheel with the backend in [build-system]. Its default Cargo profile is release; use --profile dist or --profile dev to select another. Projects using fastws.build_backend stage their native binaries automatically. Direct maturin builds bypass that backend and still need explicit staging.

Generated CI runs the Rust and Python tests in parallel with wheel builds using AnswerDotAI/workflows/maturin-build@master across an OS matrix (manylinux: '2_31' with --zig and shared R2 sccache on Linux). On v* tags, after tests and distribution builds succeed, it publishes the crate to crates.io, then the wheels and sdist to GitHub Releases and PyPI. Publish the first crates.io release by hand with cargo publish and a token, then add the repo’s ci.yml as a trusted publisher in the crate’s crates.io settings. Any CLI tools are Python console scripts declared in [project.scripts]; there are no native Rust binaries to build.

Generated projects use fastws.build_backend and list only pyproject.toml and the two Cargo.toml files in tool.uv.cache-keys. uv rebuilds the extension only when packaging changes, while cargo develop rebuilds after Rust source changes. The release profile—shared by cargo develop, cargo test --release, and CI tests—uses package-specific incremental compilation with no LTO and 16 codegen units so local edits stay fast while dependencies remain sccacheable. CI builds distributed wheels with the dist profile: thin LTO, 16 codegen units, no incremental compilation, and stripping.

Zig-backed projects

Create Python CFFI bindings over a bundled Zig shared library:

ship-zig-new my-project
cd my-project
pip install -e .[dev]
python build_lib.py
pytest -q

Commands:

ship-zig-new my-project  # create a CFFI/Zig project
ship-zig-build           # build and check the current platform wheel
ship-bump                # bump the Python package version
ship-release             # tag, publish via CI, then bump

The generated workflow builds one Python-ABI-independent wheel for Linux x86_64, Linux ARM64, macOS Intel, and macOS Apple Silicon. Tagged builds create the GitHub release and publish to PyPI with trusted publishing.

Python + npm and npm-only projects

Configure an existing Python+npm or npm-only repository for tag-triggered OIDC releases via GitHub Actions:

ship-npm-init             # write .github/workflows/ci.yml and configure [tool.fastship]
ship-release              # tag, publish via CI, then bump

For Python+npm projects, ship-npm-init sets release = "tag", appends "package.json" to [tool.fastship].version-files, syncs package.json’s version to the Python version, and generates .github/workflows/ci.yml (using Node lts/* and Python 3.13, running npm run build when scripts.build is defined) to publish to npm, PyPI, and GitHub Releases. Pass --force to overwrite an existing workflow. For the first npm release, publish manually (npm publish), then configure Trusted Publishing on npm (and PyPI) for ci.yml.

ship-pr

Create a PR from uncommitted or unpushed work, merge it immediately, and clean up:

ship-pr "Add new feature"
ship-pr "Fix bug" --label bug
ship-pr "Breaking change" --label breaking

This command: 1. Creates a new branch from your current work 2. Commits any uncommitted changes (using the title as commit message) 3. Pushes to origin and creates a PR 4. Adds the specified label (default: enhancement) 5. Squash-merges the PR 6. Deletes the remote branch and resets local to updated main

You must be on the default branch (usually main) with no unpulled changes.

ship-changelog

Generate or update CHANGELOG.md from closed GitHub issues since your last release:

ship-changelog

This is useful when you want to edit the changelog separately (e.g., in an editor or Claude Code) before releasing. If you already have a CHANGELOG.md, it must include <!-- do not remove --> near the top so fastship knows where to insert the next release notes.

ship-gh

This is an interactive helper:

  1. Creates/updates CHANGELOG.md from closed GitHub issues since your last GitHub release
  2. Opens your $EDITOR (defaults to nano) so you can edit the changelog
  3. Prompts you to confirm
  4. Runs git commit -am release, git push
  5. Creates a GitHub release tagged with your current __version__
ship-gh

If you’ve reviewed a changelog created by ship-changelog, release it without regenerating or reopening it:

ship-gh --no-changelog --no-editor

The confirmation prompt remains. Add --yes only when confirmation has already happened elsewhere.

GitHub token setup

ship-gh looks for a token in this order:

  1. FASTSHIP_TOKEN
  2. a ./token file in your repo root
  3. GITHUB_TOKEN

The token must have permission to create releases (typically repo scope for classic PATs, or appropriate fine-grained permissions).

ship-release

Full release workflow:

ship-release        # generate changelog, release, bump version, push

ship-release selects the project type automatically:

  • Plain Python projects build and check the distribution before creating the GitHub release, upload it to PyPI, then bump.
  • A project with a static [project].version and no package to build is released on GitHub only. There is no build, PyPI upload or changelog. GitHub writes the release notes, and the bump updates pyproject.toml. A uv workspace root is refused, since it is not a project.
  • Maturin and fastship Zig projects push one annotated version tag for their trusted-publishing workflow, then bump - no changelog step, no prompts, no token needed.
  • When pkg/skill.py exists, ship-release refreshes llms.txt (and llms-*.txt companions) before building, releasing, or tagging: nbs/llms.txt for nbdev repos (committed as "update llms"), and repo-root llms.txt for non-nbdev repos (committed as "update llms [skip ci]" on tag releases).
  • npm projects (a package.json with no pyproject.toml anywhere nearer) refuse a dirty tree, push one annotated version tag for their trusted-publishing workflow, then bump package.json. Maturin and Zig releases refuse a dirty tree the same way.

Every flow ends with a bump commit whose message contains [skip ci], so pushing it starts no push-triggered GitHub Actions workflows, such as CI or docs deployment.

For another project whose artifacts must be built and published by CI, select the same tag-driven flow explicitly:

[tool.fastship]
release = "tag"

ship-release then pushes v<version>, increments the version, and leaves publication to the repository’s workflow.

If a native build duplicates the package version, list those synchronized copies:

[tool.fastship]
release = "tag"
version-files = ["bazel/versions.bzl"]

Each file must contain the old version exactly once; fastship validates every file before changing any of them. Tag-driven releases also validate these copies before pushing the release tag.

The final Released message is printed only after the full local publishing workflow succeeds. Tag-driven native releases print Release started because CI owns publication.

To generate and review the changelog separately, then run the rest of the workflow without another editor or prompt:

ship-changelog
# review CHANGELOG.md
ship-release --no-changelog --no-editor --yes

Changelog generation is idempotent: regenerating replaces the pending section for the current version rather than duplicating it. Regeneration also discards manual edits to that pending section, so do not regenerate after the final review.

Notes

  • ship-pypi does not bump your version for you — keep it explicit and boring.
  • ship-gh requires that your project has a git origin remote pointing at GitHub (or use --repo OWNER/REPO).

Existing projects

To add fastship to an existing project:

1) Put your version in __init__.py

In your package’s main __init__.py:

__version__ = "0.0.1"

2) Configure pyproject.toml

[project]
name = "my-project"
dynamic = ["version"]

[tool.setuptools.dynamic]
version = { attr = "my_project.__version__" }

Keep __version__ = "x.y.z" as a simple literal (don’t compute it). ship-bump will rewrite this line near the top of the file to keep builds happy.

3) Optional: specify branch

Fastship infers your package name from [project].name (changing - to _). To override the release branch:

[tool.fastship]
branch = "main"  # defaults to current git branch