Skip to main content

PBT

pbt — A build tool for multiple Python projects in a single repository

PyPI Python GitHub Issues Contributions welcome License

Introduction

Having all packages in the same repository make it much easier to develop, share, reuse, and refactor code. Building and publishing the packages should not be done manually because it is time-consuming and may be frustrated if the projects are depending on each other. pbt is a tool designed to help make the process easier and faster. It supports building, installing, and updating versions of your packages and their dependencies consistently. It also provides utility commands to help you work with your packages in multi-repositories as if you are working with a monorepo.

Installation

pip install -U pbt

Usage

Note: currently, pbt supports Python packages configured with Poetry (an awesome dependency management that you should consider using).

Assuming that you organized your packages to different sub-folders, each has their own project configuration file (e.g., pyproject.toml). You can run the following commands in the root directory (containing your projects). Note: pbt will discover the project based on the project name in its configuration file not the folder name.

You can also discover the list of commands by running pbt --help. Many commands have an option --cwd to override the current working directory.

  1. List all packages in the current project, and their dependencies if required
pbt list [-d]
  • -d, --dev: Whether to print to the local (inter-) dependencies
  1. Create virtual environment of a package and install its dependencies
pbt install [-d] [-v] [-p <package>]
  • -d: also install dev-dependencies of the package
  • -v: verbose
  • -p: specify the package we want to build, if empty build all packages.

If you have encounter some errors during the installation, you can checkout the pyproject.failed.toml file that is generated by pbt in ./cache/<package> folder (relative to your current working directory). For example, on M1 chip, if your python version is ^3.8, you can't use the newer scipy (e.g., >1.8 as it requires python <3.11), poetry lock chooses to use an old version 1.6.0, which typically can't build on M1 due to no pre-built numpy for it.

  1. Update all package inter-dependencies
pbt update
  1. Clean packages' build & lock files
pbt clean [-p <package>]
  • -p: specify the package we want to build, if empty build all packages.
  1. Git clone a multi-repository project
pbt git clone --repo <repo_url>

Clone a repository and check out all of its submodules to their correct branches that we were using last time.

  1. Git update a multi-repository project
pbt git update

Pull latest changes from the repository, and check out all of its submodules to their correct branches.

Metadata

Release files for pbt 2.13.0

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

Source distribution (sdist)

Source distribution for pbt 2.13.0
File Size Uploaded Provenance Actions
pbt-2.13.0.tar.gz 32.3 kB Without provenance Details for pbt-2.13.0.tar.gz

Built distribution (wheel)

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

Total release size: 72.7 kB

Release files / pbt-2.13.0.tar.gz

Download URL pbt-2.13.0.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4bb6ed1d3ae9aa93b7a0633f90389d5daa54a030ed9d488bb0aa77d8d33df2fd
BLAKE2b-256 checksum
How to use checksums
afa9ec41fe7e83a3b8a0bd729e67d09778cef596490f753e32411f15be7d3fb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / pbt-2.13.0-py3-none-any.whl

Download URL pbt-2.13.0-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
799438a00e01dda73ff8810b23c916ec8b6d4b5016ed10c1248735bb53b08942
BLAKE2b-256 checksum
How to use checksums
57267e0aee778c0de973a59ea9672f73a1df422fa6a02fcdddda8149f9f7432a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Security for pbt 2.13.0

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.

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