pbt


Namepbt JSON
Version 2.12.3 PyPI version JSON
download
home_pagehttps://github.com/binh-vu/pbt
SummaryA build tool for multiple Python projects in a single repository
upload_time2023-06-11 04:19:07
maintainer
docs_urlNone
authorBinh Vu
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">PBT</h1>

<div align="center">
<b>pbt</b> — A build tool for multiple Python projects in a single repository
    
![PyPI](https://img.shields.io/pypi/v/pbt)
![Python](https://img.shields.io/badge/python-v3.8+-blue.svg)
[![GitHub Issues](https://img.shields.io/github/issues/binh-vu/pbt.svg)](https://github.com/binh-vu/pbt/issues)
![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

</div>

## 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](https://github.com/binh-vu/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

```bash
pip install -U pbt
```

## Usage

Note: currently, [pbt](https://github.com/binh-vu/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](https://github.com/binh-vu/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**

```bash
pbt list [-d]
```

- `-d`, `--dev`: Whether to print to the local (inter-) dependencies

2. **Create virtual environment of a package and install its dependencies**

```bash
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.

3. **Update all package inter-dependencies**

```bash
pbt update
```

4. **Clean packages' build & lock files**

```bash
pbt clean [-p <package>]
```

- `-p`: specify the package we want to build, if empty build all packages.

6. **Git clone a multi-repository project**

```bash
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.

7. **Git update a multi-repository project**

```bash
pbt git update
```

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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/binh-vu/pbt",
    "name": "pbt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Binh Vu",
    "author_email": "binh@toan2.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/5b/2ea5760fd53ac6d57b8ebaee27054f60001f1bbb47d2ae08bca2dbcd8a0c/pbt-2.12.3.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">PBT</h1>\n\n<div align=\"center\">\n<b>pbt</b> \u2014 A build tool for multiple Python projects in a single repository\n    \n![PyPI](https://img.shields.io/pypi/v/pbt)\n![Python](https://img.shields.io/badge/python-v3.8+-blue.svg)\n[![GitHub Issues](https://img.shields.io/github/issues/binh-vu/pbt.svg)](https://github.com/binh-vu/pbt/issues)\n![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n</div>\n\n## Introduction\n\nHaving 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](https://github.com/binh-vu/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.\n\n## Installation\n\n```bash\npip install -U pbt\n```\n\n## Usage\n\nNote: currently, [pbt](https://github.com/binh-vu/pbt) supports Python packages configured with Poetry (an awesome dependency management that you should consider using).\n\nAssuming 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](https://github.com/binh-vu/pbt) will discover the project based on the project name in its configuration file not the folder name.\n\nYou can also discover the list of commands by running `pbt --help`. Many commands have an option `--cwd` to override the current working directory.\n\n1. **List all packages in the current project, and their dependencies if required**\n\n```bash\npbt list [-d]\n```\n\n- `-d`, `--dev`: Whether to print to the local (inter-) dependencies\n\n2. **Create virtual environment of a package and install its dependencies**\n\n```bash\npbt install [-d] [-v] [-p <package>]\n```\n\n- `-d`: also install dev-dependencies of the package\n- `-v`: verbose\n- `-p`: specify the package we want to build, if empty build all packages.\n\nIf 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.\n\n3. **Update all package inter-dependencies**\n\n```bash\npbt update\n```\n\n4. **Clean packages' build & lock files**\n\n```bash\npbt clean [-p <package>]\n```\n\n- `-p`: specify the package we want to build, if empty build all packages.\n\n6. **Git clone a multi-repository project**\n\n```bash\npbt git clone --repo <repo_url>\n```\n\nClone a repository and check out all of its submodules to their correct branches that we were using last time.\n\n7. **Git update a multi-repository project**\n\n```bash\npbt git update\n```\n\nPull latest changes from the repository, and check out all of its submodules to their correct branches.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A build tool for multiple Python projects in a single repository",
    "version": "2.12.3",
    "project_urls": {
        "Homepage": "https://github.com/binh-vu/pbt",
        "Repository": "https://github.com/binh-vu/pbt"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a2c20a03ad37e81b44de6e5df3bee6713a73876f3de353240b850c835ab90341",
                "md5": "af82afeaa44ffc4ac46f20b0e2624759",
                "sha256": "1bfaef4e15c354554a6781771dc6ad43828a687de1f496b9cfad8e479018f4a3"
            },
            "downloads": -1,
            "filename": "pbt-2.12.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af82afeaa44ffc4ac46f20b0e2624759",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 40280,
            "upload_time": "2023-06-11T04:19:05",
            "upload_time_iso_8601": "2023-06-11T04:19:05.877475Z",
            "url": "https://files.pythonhosted.org/packages/a2/c2/0a03ad37e81b44de6e5df3bee6713a73876f3de353240b850c835ab90341/pbt-2.12.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f5b2ea5760fd53ac6d57b8ebaee27054f60001f1bbb47d2ae08bca2dbcd8a0c",
                "md5": "65650e275ae2e5a9e41e39c6935efec1",
                "sha256": "d50c8321d8e2c5f472b27fde9b3dc928a2cc5e4e4a92a50bd8fcfa99898535df"
            },
            "downloads": -1,
            "filename": "pbt-2.12.3.tar.gz",
            "has_sig": false,
            "md5_digest": "65650e275ae2e5a9e41e39c6935efec1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 32150,
            "upload_time": "2023-06-11T04:19:07",
            "upload_time_iso_8601": "2023-06-11T04:19:07.108990Z",
            "url": "https://files.pythonhosted.org/packages/0f/5b/2ea5760fd53ac6d57b8ebaee27054f60001f1bbb47d2ae08bca2dbcd8a0c/pbt-2.12.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-11 04:19:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "binh-vu",
    "github_project": "pbt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pbt"
}
        
Elapsed time: 0.16618s