Skip to content

Poetry support for groups dependencies #500

@marrataj

Description

@marrataj

Is your request related to a problem? Please describe.

For managing dependencies of our lambdas we're using poetry, however it makes it frustraiting that in order to build dependencies for different lambdas in one project you either need to specify separate pyproject.toml file for each lambda, even though they might share same packages, or do some tricks with commands in source_path that will install and zip dependecies for specific lambda, specially when in one pyproject.toml you can specify common packages and create separate groups of packages for specific lambda, then, it's enough to either call:
poetry install --with=<group_name> -- this will install common and specific lambda packages
or
poetry export --with=<group_name> --directory=<pyproject dir> > requirements.txt -- this will export common and lambda specific dependencies to requirements.txt

Describe the solution you'd like.

It would be nice to have groups parameter passed to poetry command, which would then include groups dependencies, and avoid a need of having multiple pyproject.toml files in one project, which would make it easier to maintain.
Also then, whenever new dependency needs to be added it's then enough to do it from root path of the project.

Tricky part with this solution might be that lambda deployment shouldn't be dependent on changes in pyproject.toml, as adding dependency to one lambda would cause rebuild of all lambdas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions