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[release]'  # full CLI (release, scaffolding, PRs)
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

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 and repo-root llms.txt for non-nbdev repos, committed as "update llms".
  • 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

Metadata

Release files for fastship 0.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastship 0.1.17
File Size Uploaded Provenance Actions
fastship-0.1.17.tar.gz 45.6 kB Without provenance Details for fastship-0.1.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastship 0.1.17
File Interpreter ABI Platform Actions
fastship-0.1.17-py3-none-any.whl Python 3 none any Details for fastship-0.1.17-py3-none-any.whl

Total release size: 87.5 kB

Release files / fastship-0.1.17.tar.gz

Download URL fastship-0.1.17.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8159d29516ba61b433836b072d4e7316feaecd2d990d9d2a5c1e496f860cb222
BLAKE2b-256 checksum
How to use checksums
4ba1a660ee8ce299390863ae6b0f99652ba87d67fa48ca7dca81230e89078d8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / fastship-0.1.17-py3-none-any.whl

Download URL fastship-0.1.17-py3-none-any.whl
Size 41.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1c22c430bf2b38e7df7f386cca31bd744936f83a092b629d61ecde2f25e4636
BLAKE2b-256 checksum
How to use checksums
c168496f6096925d91d9e814730d253280d80f91dd9e496ec77395b70b6fff3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for fastship 0.1.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page