Skip to main content

Project scaffolded with PyScaffold Clickstart.

Project description

ClickStart

PyPI-Server Tests Project generated with PyScaffold

A PyScaffold extension to generate modern Click-based CLI projects with batteries included.

ClickStart generates a complete, production-ready Python CLI project structure with sensible defaults and modern tooling. It eliminates the boilerplate of setting up a new CLI application so you can focus on writing your actual code.

Installation

pip install pyscaffoldext-clickstart

This installs the extension alongside PyScaffold. You can verify installation with:

putup --help | grep clickstart

Quick Start

Generate a new CLI project:

putup --clickstart my_project
cd my_project
make bootstrap    # Create venv and install dependencies
make test         # Run tests
my_project --help # Run your CLI

That's it! You have a working CLI application with tests, documentation, and all the tooling configured.

What Gets Generated

my_project/
├── src/
│   └── my_project/
│       ├── __init__.py       # Package initialization
│       ├── __main__.py       # python -m support
│       ├── cli.py            # Click CLI entry point
│       └── api.py            # Core API logic
├── tests/
│   ├── README.md             # Testing guide
│   ├── unit/
│   │   └── test_import.py    # Package import smoke test
│   └── integration/
│       └── test_layout.py    # Project structure tests
├── docs/
│   ├── index.md              # Documentation home
│   ├── conf.py               # Sphinx configuration
│   └── ...                   # Other doc files
├── Makefile                  # Development task automation
├── pyproject.toml            # Project configuration (PEP 621)
├── .pre-commit-config.yaml   # Pre-commit hooks (Ruff)
├── .gitignore                # Git ignore patterns
├── README.md                 # Project readme
├── LICENSE.txt               # MIT license
├── AUTHORS.md                # Author credits
├── CHANGELOG.md              # Version history
└── CONTRIBUTING.md           # Contribution guide

Makefile Targets

The generated Makefile provides common development tasks:

Target Description
make help Show all available targets
make venv Create virtual environment
make bootstrap Create venv and install .[dev]
make precommit Install pre-commit hooks
make test Run cached unit + integration tests
make test-all Run all tests (no cache)
make test-live Run @live marked tests
make lint Run Ruff checks
make format Auto-fix with Ruff
make docs Build Sphinx documentation
make build Build wheel and sdist
make upload Upload to PyPI via Twine
make version Show setuptools_scm version
make changelog Show changes since last tag
make release Run tests and create git tag
make clean Remove build artifacts
make run-cli Run CLI via python -m

Release Workflow

The Makefile includes Git-tag-based release automation:

make release KIND=patch  # v1.0.0 -> v1.0.1
make release KIND=minor  # v1.0.0 -> v1.1.0
make release KIND=major  # v1.0.0 -> v2.0.0

This runs tests, generates changelog, creates a signed git tag, and pushes to origin.

Configuration Options

ClickStart works with all standard PyScaffold options:

# Basic usage
putup --clickstart my_project

# With package name different from project
putup --clickstart my-project -p my_package

# With namespace package
putup --clickstart my_project --namespace my.ns

# Skip creating git repo
putup --clickstart my_project --no-git

# Show what would be generated
putup --clickstart my_project --pretend

Features

Modern Python Packaging

  • pyproject.toml only - No setup.py or setup.cfg
  • setuptools-scm - Automatic version from git tags
  • PEP 621 compliant project metadata

Testing Infrastructure

  • pytest with sensible defaults
  • Unit/Integration separation - Fast vs slow tests
  • Coverage reporting configured
  • pytest-xdist for parallel testing
  • pytest-timeout for hanging test protection

Code Quality

  • Ruff for linting and formatting (replaces Black, isort, flake8)
  • Pre-commit hooks configured
  • Consistent code style enforced

Documentation

  • Sphinx with MyST-Parser for Markdown
  • ReadTheDocs configuration included
  • API autodoc generation

CLI Framework

  • Click for command-line interface
  • Entry point configured in pyproject.toml
  • python -m support via __main__.py
  • Logging with -v/-vv verbosity flags

Customization

Modifying the CLI

Edit src/<package>/cli.py to add commands:

@cli.command()
@click.argument('name')
def greet(name):
    """Greet someone by name."""
    click.echo(f'Hello, {name}!')

Adding Dependencies

Edit pyproject.toml:

dependencies = [
    "click>=8.1",
    "requests>=2.31",  # Add your dependency
]

Then reinstall: pip install -e ".[dev]"

Adding Tests

  • Fast unit tests go in tests/unit/
  • Slower integration tests go in tests/integration/

Mark integration tests:

import pytest

@pytest.mark.integration
def test_something_slow():
    ...

Environment Variables

The Makefile supports customization via environment variables:

# Use a different venv location
make bootstrap VENV=~/.venvs/my_project

# Force test re-run
make test NO_CACHE=1

# Pass arguments to CLI
make run-cli CLI_ARGS="--help"

Requirements

  • Python 3.12+
  • PyScaffold 4.5+
  • Git (for version detection)

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT License - see LICENSE.txt

Acknowledgments

This project extends PyScaffold, the Python project generator. Thanks to the PyScaffold maintainers for the excellent foundation.

Project details


Download files

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

Source Distribution

pyscaffoldext_clickstart-2.2.4.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

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

pyscaffoldext_clickstart-2.2.4-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file pyscaffoldext_clickstart-2.2.4.tar.gz.

File metadata

  • Download URL: pyscaffoldext_clickstart-2.2.4.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyscaffoldext_clickstart-2.2.4.tar.gz
Algorithm Hash digest
SHA256 ce6f4da5d6bb5f20adb3f0d5f7ed0bc69068eecc0ca81e0820ca59791e3589dd
MD5 e5d2aaea4390ff34c32f7a7cb74f2598
BLAKE2b-256 477966ee54a8b21419135c85fc2b9c9dd4e1728b59de839d106fc5621a6d1124

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyscaffoldext_clickstart-2.2.4.tar.gz:

Publisher: publish-package.yml on ksteptoe/pyscaffoldext-ClickStart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyscaffoldext_clickstart-2.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pyscaffoldext_clickstart-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4655b245573343bd3efd240bc36bf4e7e9e6ff4793c807a7621e34aec855478
MD5 60ee0dbaaab8b8b29b892a8844d5325b
BLAKE2b-256 c40fada2ae65b4bda6e529654413e4cb53e7e4b7e66c5ef3aa5934f43b36fdf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyscaffoldext_clickstart-2.2.4-py3-none-any.whl:

Publisher: publish-package.yml on ksteptoe/pyscaffoldext-ClickStart

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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