kapla-cli-v2


Namekapla-cli-v2 JSON
Version 0.32.0 PyPI version JSON
download
home_page
SummaryPython monorepo package manager
upload_time2024-02-28 12:53:02
maintainer
docs_urlNone
author
requires_python>=3.7
licenseApache-2.0
keywords nats nats-server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `kapla` project manager

`kapla-cli` is a packaging and build system for Python codebases. It can be used to develop several python packages in a single repository, and easily manage shared dependencies accross the packages.

It relies on:
  - venv
  - pip
  - poetry
  - poetry-core

## `poetry` and `pip` usage

`poetry` is used in order to manage packages dependencies:

- A pyproject.toml must exist at the root of the monorepo.
- This pyproject.toml file use dependency groups to keep track of each package dependencies.
- A single lock file is thus used to pin dependency versions accross all packages. 
    It avoids resolving dependency lock for each package, and shorten time required to update dependencies accross all packages.
- Each package in the monorepo must have a valid `project.yml` file.
- `project.yml` files are written according to a well known schema  (`KProjectSpec`).
- At build or install time, `pyproject.toml` files are generated in each package directory from both the content of `project.yml` and the monorepo `pyproject.toml` file.
- Packages are either built using `poetry build`.
- Or installed using `pip install -e /path/to/package` (aka *editable install*). (See [PEP 660 -- Editable installs for pyproject.toml based builds](https://www.python.org/dev/peps/pep-0660/))

> Packages are **not installed using Poetry**. Instead, `pip` is used to install packages in editable mode. This is possible using the master branch of `poetry-core` (not released yet)  which supports PEP 660 as `build system` for the editable install.

## Why `poetry` ?

Poetry is really powerful when it comes to declaring and resolving dependencies in a consistent manner. Without it, it would be difficult to ensure that all dependencies versions are compatible together.

## Why `pip` and `editable` install ?

Even though `poetry` provides an install feature out of the box, things can become quite slow when working with dozens of project.

Moreover, `poetry` provide some support for local dependencies, the experience is far from optimal.

By using `pip` to install packages, it's possible to install several local dependencies in parallel without messing with `.venv/lib/pythonX.X/site-packages/` directory.

# Quick Start

## Virtual environment

- Ensure a virtual environment exists at the root of a monorepo:

```bash
k venv
```

- Update pip toolkit within a virtual environment

```bash
k venv update
```

- Run a command within the virtual environment

```bash
k run python -c "import sys; print(sys.executable)"
```

## Global actions

- Install all projects:

```bash
k install
```

- Install only two projects (and their dependencies)

```bash
k install pkg1 pkg2
```

- Build all projects

```bash
k build
```

- Build only two projects

```bash
k build pkg1 pkg2
```

## Projects actions

- Add a project dependency (run the command from the package directory)

```bash
k project add package@version  # @version is optional
```

- Install the current project

```bash
k project install
```

- Show project dependencies

```bash
k project show [--latest] [--outdated] [--tree]
```


## Configuration
Respects the use of venv environment variable `VIRTUAL_ENV` for the location of 
the virtual env should it be different from `<project_roo>/.venv`

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "kapla-cli-v2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nats,nats-server",
    "author": "",
    "author_email": "Guillaume Charbonnier <guillaume.charbonnier@araymond.com>",
    "download_url": "https://files.pythonhosted.org/packages/03/9b/f88e5a82fbe11384e605dcefd8411f38455f4b0782978ad8b2bd261db9f3/kapla-cli-v2-0.32.0.tar.gz",
    "platform": null,
    "description": "# `kapla` project manager\n\n`kapla-cli` is a packaging and build system for Python codebases. It can be used to develop several python packages in a single repository, and easily manage shared dependencies accross the packages.\n\nIt relies on:\n  - venv\n  - pip\n  - poetry\n  - poetry-core\n\n## `poetry` and `pip` usage\n\n`poetry` is used in order to manage packages dependencies:\n\n- A pyproject.toml must exist at the root of the monorepo.\n- This pyproject.toml file use dependency groups to keep track of each package dependencies.\n- A single lock file is thus used to pin dependency versions accross all packages. \n    It avoids resolving dependency lock for each package, and shorten time required to update dependencies accross all packages.\n- Each package in the monorepo must have a valid `project.yml` file.\n- `project.yml` files are written according to a well known schema  (`KProjectSpec`).\n- At build or install time, `pyproject.toml` files are generated in each package directory from both the content of `project.yml` and the monorepo `pyproject.toml` file.\n- Packages are either built using `poetry build`.\n- Or installed using `pip install -e /path/to/package` (aka *editable install*). (See [PEP 660 -- Editable installs for pyproject.toml based builds](https://www.python.org/dev/peps/pep-0660/))\n\n> Packages are **not installed using Poetry**. Instead, `pip` is used to install packages in editable mode. This is possible using the master branch of `poetry-core` (not released yet)  which supports PEP 660 as `build system` for the editable install.\n\n## Why `poetry` ?\n\nPoetry is really powerful when it comes to declaring and resolving dependencies in a consistent manner. Without it, it would be difficult to ensure that all dependencies versions are compatible together.\n\n## Why `pip` and `editable` install ?\n\nEven though `poetry` provides an install feature out of the box, things can become quite slow when working with dozens of project.\n\nMoreover, `poetry` provide some support for local dependencies, the experience is far from optimal.\n\nBy using `pip` to install packages, it's possible to install several local dependencies in parallel without messing with `.venv/lib/pythonX.X/site-packages/` directory.\n\n# Quick Start\n\n## Virtual environment\n\n- Ensure a virtual environment exists at the root of a monorepo:\n\n```bash\nk venv\n```\n\n- Update pip toolkit within a virtual environment\n\n```bash\nk venv update\n```\n\n- Run a command within the virtual environment\n\n```bash\nk run python -c \"import sys; print(sys.executable)\"\n```\n\n## Global actions\n\n- Install all projects:\n\n```bash\nk install\n```\n\n- Install only two projects (and their dependencies)\n\n```bash\nk install pkg1 pkg2\n```\n\n- Build all projects\n\n```bash\nk build\n```\n\n- Build only two projects\n\n```bash\nk build pkg1 pkg2\n```\n\n## Projects actions\n\n- Add a project dependency (run the command from the package directory)\n\n```bash\nk project add package@version  # @version is optional\n```\n\n- Install the current project\n\n```bash\nk project install\n```\n\n- Show project dependencies\n\n```bash\nk project show [--latest] [--outdated] [--tree]\n```\n\n\n## Configuration\nRespects the use of venv environment variable `VIRTUAL_ENV` for the location of \nthe virtual env should it be different from `<project_roo>/.venv`\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Python monorepo package manager",
    "version": "0.32.0",
    "project_urls": {
        "Issues": "https://github.com/charbonnierg/kapla-cli-v2/issues",
        "Repository": "https://github.com/charbonnierg/kapla-cli-v2"
    },
    "split_keywords": [
        "nats",
        "nats-server"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fcaacf303c1dcd06b272cd98458813ca72e6c36c89098dd0789356bee17a58d",
                "md5": "f22db254440578366f074a149d336f58",
                "sha256": "de421a09e770d792da1be821805bcb3c90c81e97c767756dfc7f1abb128184ac"
            },
            "downloads": -1,
            "filename": "kapla_cli_v2-0.32.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f22db254440578366f074a149d336f58",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 48985,
            "upload_time": "2024-02-28T12:53:00",
            "upload_time_iso_8601": "2024-02-28T12:53:00.805827Z",
            "url": "https://files.pythonhosted.org/packages/5f/ca/acf303c1dcd06b272cd98458813ca72e6c36c89098dd0789356bee17a58d/kapla_cli_v2-0.32.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "039bf88e5a82fbe11384e605dcefd8411f38455f4b0782978ad8b2bd261db9f3",
                "md5": "4a94bcf7de5713b1a2c57f256d38ce89",
                "sha256": "434af294d5c65d11cdf21e336f64db4b5f26145c6a5f8a073c52a90dbd0c5202"
            },
            "downloads": -1,
            "filename": "kapla-cli-v2-0.32.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4a94bcf7de5713b1a2c57f256d38ce89",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 39142,
            "upload_time": "2024-02-28T12:53:02",
            "upload_time_iso_8601": "2024-02-28T12:53:02.190162Z",
            "url": "https://files.pythonhosted.org/packages/03/9b/f88e5a82fbe11384e605dcefd8411f38455f4b0782978ad8b2bd261db9f3/kapla-cli-v2-0.32.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 12:53:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "charbonnierg",
    "github_project": "kapla-cli-v2",
    "github_not_found": true,
    "lcname": "kapla-cli-v2"
}
        
Elapsed time: 0.30593s