Skip to main content

Publish WaterJuice projects: wheels to PyPI and docs to the Cloudflare Pages git repo

Project description

wj-publish

Publish WaterJuice projects: upload platform wheels to PyPI and push built documentation into the git repository that Cloudflare Pages serves.

wj-publish is the publish step that runs after a project is built — the WaterJuice-specific successor to cal-publish-python, trimmed to the one PyPI upload method and the one docs method actually used. It is a small pure-Python tool.

Install

pip install wj-publish
# or
uvx wj-publish --help

Usage

wj-publish [options] DIR

DIR is the build output directory (usually output/) containing the .whl files and the <project>-<version>-docs.zip. By default both PyPI and docs are published.

wj-publish output/              # publish wheels + docs
wj-publish --pypi-only output/  # wheels only
wj-publish --docs-only output/  # docs only
wj-publish --force output/      # overwrite an existing docs version
wj-publish --example-config     # print a starter config
Option Description
-c, --config FILE Config file (default: $WJ_PUBLISH_CONFIG or ~/.config/wj-publish/config.json)
-p, --profile NAME Profile (default: $WJ_PUBLISH_PROFILE or [tool.wj-publish] in pyproject.toml)
--pypi-only / --docs-only Limit what is published
-f, --force Overwrite an existing docs version
-v, --verbose Verbose output
--example-config Print an example config file and exit
--version / --help Info and exit

How it works

  • PyPI — uploads each .whl with twine to the configured repository (the public PyPI registry by default), using token authentication.
  • Docs — keeps its own cached clone of the docs repository, drops the docs into <project>/<version>/, regenerates the site index with the repo's own tools/gen_index.py, then commits and pushes. Cloudflare Pages serves the result at https://docs.waterjuice.org/<project>/.

External tool needed at runtime: git (for the docs push). twine is a bundled dependency.

Configuration

A JSON file with named profiles (default ~/.config/wj-publish/config.json):

{
  "profiles": {
    "waterjuice": {
      "pypi": {
        "token": "pypi-AgEI..."
      },
      "docs": {
        "mode": "cloudflare-pages",
        "repo": "git@github.com:WaterJuice/docs.git"
      }
    }
  }
}

Generate a starter file with wj-publish --example-config. Every value can be overridden by a WJ_PUBLISH_* environment variable (so CI can run with no config file). See config.example.json and the Configuration docs for the full reference.

Build

make build      # build the wheel + docs into output/
make publish    # publish output/ (dogfoods wj-publish)
make check      # ruff lint + format check

Licence

Released under the Unlicense — public domain.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wj_publish-1.0.0b1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file wj_publish-1.0.0b1-py3-none-any.whl.

File metadata

  • Download URL: wj_publish-1.0.0b1-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for wj_publish-1.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c4ef7e5f2206bb33fb7ed6c86084a77ca436925a70fb79769c51aaa3d6527e
MD5 55803d52a953cd895f2b26d73c49d086
BLAKE2b-256 5248adf504096b48f2b2711db0b2270a5e0d32ec153e47c8d543eea1a9d65a73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page