Skip to main content

Python project build and development tool - CLI for workspace management (Norwegian: 'to build')

Project description

bygge

CI PyPI Python Version License

bygge (pronounced BYG-eh, Norwegian for "to build") โ€” A CLI tool for Python project development and workspace management.

bygge simplifies development workflows for Python projects by providing a consistent interface for common tasks: testing, linting, type-checking, formatting, and more. It works with both single-package projects and multi-package monorepos.

Features

  • ๐Ÿ”ง Unified CLI โ€” One command (bygge check) runs all your quality checks
  • ๐Ÿ“ฆ Monorepo support โ€” Manages multiple packages with inter-dependencies
  • ๐Ÿ”Œ Plugin-based โ€” Automatically detects and configures tools (pytest, ruff, basedpyright)
  • ๐ŸŽฏ Convention over configuration โ€” Works out-of-the-box with standard Python project layouts
  • ๐Ÿš€ Fast โ€” Runs checks in topological order for correct dependency resolution
  • ๐Ÿช Git hooks โ€” Built-in pre-commit hook support

Installation

pip install bygge

For development:

pip install bygge[dev]

Quick Start

Initialize your project:

# Create .bygge.toml configuration
cat > .bygge.toml << 'EOF'
[workspace]
venv_dir = ".venv"
optional_deps = ["dev"]
coverage_baseline = 100
EOF

# Install git hooks
bygge hooks

# Run all checks (format, lint, typecheck, test with coverage)
bygge check

Usage

Common commands

bygge test              # Run tests
bygge coverage          # Run tests with coverage report
bygge fmt               # Format code and sort imports
bygge lint              # Lint code
bygge typecheck         # Type-check code
bygge check             # Run all checks (same as pre-commit)

Check modes

Most commands support --check mode for CI/validation:

bygge fmt --check       # Verify formatting without changes
bygge lint --check      # Verify linting without changes

Environment setup

bygge init              # Create venv and install packages
bygge info              # Show environment information

Git integration

bygge hooks             # Install pre-commit hook
bygge unhook            # Remove pre-commit hook
bygge commit-unchecked  # Commit bypassing hooks (use sparingly)

Configuration

Create a .bygge.toml file at your project root:

Single package project

[workspace]
venv_dir = ".venv"
optional_deps = ["dev"]
coverage_baseline = 100

Monorepo (multiple packages)

[workspace]
package_root_dir = "packages"  # Directory containing your packages
venv_dir = ".venv"
optional_deps = ["dev"]
coverage_baseline = 95

Tool Detection

bygge automatically detects and uses tools from your project dependencies:

Tool Purpose Detected from
pytest Unit testing pytest in dependencies
pytest-cov Coverage reporting pytest-cov in dependencies
basedpyright Type checking basedpyright in dependencies
ruff Linting & formatting Built-in (no detection needed)

Configuration is read from your pyproject.toml:

  • Pytest: [tool.pytest.ini_options]
  • Basedpyright: [tool.basedpyright]
  • Ruff: [tool.ruff]

Monorepo Support

For projects with multiple packages, bygge handles:

  • Topological sorting โ€” Installs packages in dependency order
  • Multi-package discovery โ€” Finds all packages under package_root_dir
  • Unified testing โ€” Runs tests across all packages
  • Cross-package coverage โ€” Reports combined coverage

Example monorepo structure:

myproject/
โ”œโ”€โ”€ .bygge.toml
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ common/
โ”‚   โ”‚   โ”œโ”€โ”€ pyproject.toml
โ”‚   โ”‚   โ”œโ”€โ”€ src/common/
โ”‚   โ”‚   โ””โ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ pyproject.toml
โ”‚   โ”‚   โ”œโ”€โ”€ src/lib/
โ”‚   โ”‚   โ””โ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ app/
โ”‚       โ”œโ”€โ”€ pyproject.toml
โ”‚       โ”œโ”€โ”€ src/app/
โ”‚       โ””โ”€โ”€ tests/
โ””โ”€โ”€ .venv/

Why bygge?

  • Consistency โ€” Same commands work across all your projects
  • Simplicity โ€” No need to remember different tool invocations
  • Reliability โ€” Runs checks in the right order for monorepos
  • Speed โ€” No overhead from meta-build systems; direct tool invocation
  • Transparency โ€” Just a thin wrapper; you can always call tools directly

Name

bygge is Norwegian for "to build" โ€” fitting for a build and development tool. Pronounced BYG-eh (rhymes with "dig-eh").

Contributing

See DEV.md for development setup and guidelines.

License

MIT License - see LICENSE for details.

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

bygge-0.1.0.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

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

bygge-0.1.0-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file bygge-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for bygge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa0871a5c0862d3cd02e5df968c3ee9f06a28d6d4a1fa6d2f0966308217cb782
MD5 86fa4a03ace1f03e02a40fe523944968
BLAKE2b-256 d50dd7efa87a0594df1e0f2777b8746ec3ce9ea3e58cc0b14397a33856b58d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bygge-0.1.0.tar.gz:

Publisher: publish.yml on rcook/bygge

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

File details

Details for the file bygge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bygge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bygge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b8548fcc1c1163d700dc6f5ea5eeda8441f43e126f1c58c29da3c73b392c343
MD5 da4cd1a07b27876696a6383cb07b513e
BLAKE2b-256 c5322f05585c8d7686b68f28dbd6c8667d208e3be88f24170ff1b6c4d65f5b5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bygge-0.1.0-py3-none-any.whl:

Publisher: publish.yml on rcook/bygge

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