Skip to main content

Shipped a standard `npm publish` workflow with one click for Python packages

Project description

quick-publish

PyPI version Python versions CI

Shipped a standard publish workflow with one click for Python packages.

Note: This is the Python version of the popular npm package. It provides the same streamlined publishing experience for Python packages.

Motivation

As a maintainer for a large number of Python packages, it will be very cumbersome if you manually input the semantic version, generate changelog, git and PyPI tag etc. This tooling is to help you do all these things with one click.

Features

  • Semantic version selection with interactive prompts
  • Create git tag and push to remote
  • Generate or update CHANGELOG.md from conventional commits
  • Update version in pyproject.toml
  • Build package for distribution
  • Full integration with modern Python packaging standards (PEP 517/518/621)

Install

Using pip (recommended for users)

pip install quick-publish        # Global installation
pip install quick-publish -D     # Local development installation

Using uv (recommended for developers)

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and install from source
git clone https://github.com/quick-publish/quick-publish-py.git
cd quick-publish-py
uv sync --dev

# Run the CLI
uv run publish

Usage

For Python Projects

Create a one-click release flow:

publish

For NPM Projects (Original Use Case)

If you're working with NPM projects and want to use the original version:

npm i quick-publish -g
publish

Command Options

Usage: publish [OPTIONS]

  Shipped a standard `publish` workflow with one click.

Options:
  --depcost      Generate or update `DEPCOST.md`, defaults to `false`
  --push         Execute git push & tag push to remote git origin, defaults to `true`
  --dry-run      Show what would be done without making changes
  --version TEXT Specify version directly instead of interactive selection
  -v, --verbose  Enable verbose output
  -h, --help     Display this message

Examples

Interactive version selection

$ publish
Current version: 1.2.3
Select next version:
❯ 1.2.4 (patch)
  1.3.0 (minor)
  2.0.0 (major)
  Custom version

Dry run to preview changes

publish --dry-run --verbose

Specify version directly

publish --version 2.0.0

Skip git push

publish --no-push

How It Works

  1. Version Selection: Interactively selects next semantic version or uses provided override
  2. Update Files: Updates version in pyproject.toml and generates CHANGELOG.md
  3. Git Operations: Commits changes, creates git tag, and pushes to remote
  4. Build: Builds the package using modern Python build tools
  5. Publish Prep: Prepares distribution files for PyPI upload

Requirements

  • Python 3.8+
  • Git repository initialized
  • pyproject.toml with [project] section (PEP 621 compliant)

Integration with NPM Projects

This Python version maintains compatibility with the original npm workflow. If you're managing mixed Python/NPM projects:

# For Python packages
pip install quick-publish
publish

# For NPM packages  
npm i quick-publish -g
publish

Both versions provide the same streamlined experience with language-specific optimizations.

Development

Quick Start with uv

# Clone repository
git clone https://github.com/quick-publish/quick-publish-py.git
cd quick-publish-py

# Install dependencies and set up development environment
uv sync --dev

# Run tests
uv run pytest

# Run all quality checks
make check

# Or run individual checks
uv run ruff check src tests
uv run black --check src tests
uv run mypy src

Using Makefile

# Install dependencies and run tests
make dev-setup

# Run all quality checks
make check

# Build the package
make build

# See all available commands
make help

Contributing

Please see CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

Credits

quick-publish wouldn't exist without the inspirations from following projects:

License

MIT © quick-publish contributors

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.

quick_publish-0.1.7-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file quick_publish-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for quick_publish-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 612c768c7f416a814a135aabc2959b7c780fa825a0530bec410d21a0df5d1d0b
MD5 6c6f7eb2901c1479aec15af5182050c6
BLAKE2b-256 c2314343d44286b1fbeb6afd14b466bd02108446e29ba7f6af04d11d1ecba916

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