Skip to main content

No project description provided

Project description

Poetry compose

A poetry plugin to manage multiple project from a single root, a-la monorepo.

Docs available here

Work in progress

This is a work in progress, you might find some bugs, some improvements and some annoyance. Do not hesitate to report them through github issues.

Getting started

Install plugin

poetry self add poetry-plugin-compose

Start linting all sub projects in a single line

poetry compose run flake8 .

or running pytest in every package that has it installed

poetry compose run -i pytest -- pytest -vvv

Project layout

Poetry compose is intended to run in a flat setup where each subdirectory that contains a pyproject.toml file is considered a sub-project. Such as

database
    __init__.py
    pyproject.toml
    database
        __init__.py
    tests
        __init__.py
users
    __init__.py
    pyproject.toml
    users
        __init__.py
    tests
        __init__.py
profiles
    __init__.py
    pyproject.toml
    profiles
        __init__.py
    tests
        __init__.py
posts
    __init__.py
    pyproject.toml
    posts
        __init__.py
    tests
        __init__.py
scripts
    run.sh

but poetry will recursively descend into every subdirectory, so you could have other setups such as

packages
    database
        __init__.py
        pyproject.toml
        database
            __init__.py
        tests
            __init__.py
    users
        __init__.py
        pyproject.toml
        users
            __init__.py
        tests
            __init__.py
    profiles
        __init__.py
        pyproject.toml
        profiles
            __init__.py
        tests
            __init__.py
    posts
        __init__.py
        pyproject.toml
        posts
            __init__.py
        tests
            __init__.py
scripts
    run.sh

Dependencies

poetry compose supports finding dependency order of your packages and always compose commands in a valid order. poetry compose does not support circular dependencies though, and you should avoid them between your packages. You can find the computed dependency order using the following command:

   poetry compose dependency-order

Linking two packages

the easiest way to link two sub packages is to cd into the dependent one and run the followng command:

cd profiles
poetry add -e ../users

local development

The recommended way to run plugin as you develop them is to install them in editable mode through poetry's packaged pip executable.

Example:

/Users/macbook/Library/"Application Support"/pypoetry/venv/bin/pip install -e ../poetry_multi_package

Documentation

Documentation is mostly generated from the command themselves. Also the root readme of the project serves as the welcome page of the docs. In order to sync the doc runs the following

cd scripts
poetry compose run -d scripts -- python generate_doc.py

Then to deploy

poetry compose run -d doc -- mkdocs gh-deploy

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

poetry_plugin_compose-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

poetry_plugin_compose-0.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file poetry_plugin_compose-0.1.2.tar.gz.

File metadata

  • Download URL: poetry_plugin_compose-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Darwin/19.6.0

File hashes

Hashes for poetry_plugin_compose-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a68ca690558a6074baf95b8f374f585a04dc04afcb809a16d78dfc6ff397a124
MD5 6f9f8ed59ab27d31c7cfd608dafdd969
BLAKE2b-256 b4f8d4b727e5f4ac7455b7bb37fb802e1b54f503ba56ce4d6908014b60203b94

See more details on using hashes here.

File details

Details for the file poetry_plugin_compose-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_plugin_compose-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f2ac21532fb5496846085310ff141b8c3d1f92e6bfe24fcc47f583a7bbc5026
MD5 ca19c393f8e7a0d1c2c2ef83bb8673c2
BLAKE2b-256 f17b22706e1835ee0f5cc41e57d0b45f129ed8fca5ab977ea72166c527b464da

See more details on using hashes here.

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