Skip to content

Multiproject support #667

Closed
Closed

Description

@tmirzoev
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Hello!
From reading the docs and issues, it is rather unclear if Poetry supports working with multiple subprojects.

Like, I've got one big project A, which has several modules. I'd like to publish some of the modules as separate packages, and, preferably, with one command.

Sample project structure:
root_project_A:

  • module_1(should be packaged and published)
  • module_2 (should not be packaged)
  • module_3 (should be packaged and published)
  • pyproject.toml

How can I achieve this?
One solution is, of course, to make separate pyproject.toml for each of the modules to be packaged and run poetry build on each of them via some shell script. I could even make a poetry task for this.

But maybe there's some simpler solution?
I've read #161 #356 #167 and the subject is still a bit unclear.

Activity

  1. sdispater commented on Mar 2, 2019

    @sdispater
    Member

    This is not supported by Poetry and the recommended approach is to have separate pyproject.toml files.

  2. Conchylicultor commented on Jun 19, 2020

    @Conchylicultor

    @sdispater, is there any instruction on how to have two pyproject.toml on the same directory ? I would like to release two packages independently while avoiding deeply nested file hierarchy:

    ─ pyproject.toml
    ─ pyproject-2.toml
    ─ package1/
    ─ package2/
    

    Rather than:

    ─ project1
       ├── pyproject.toml
       └── package1/
    ─ project2
       ├── pyproject.toml
       └── package2/
    

    Another use case for which it would be useful to have two pyproject.toml in the same directory would be to release my_package (stable version) and my_package-nightly (released every night), each having their own name/version.

  3. finswimmer commented on Jun 20, 2020

    @finswimmer
    Member

    Hello @Conchylicultor ,

    if you want to release two packages independently it is absolutely best-practice to keep the project folder and therefor the pyproject.toml separated, IMO.

    For your second use case: I guess this could be realized via the planned plugin system.

    fin swimmer

  4. danieleades commented on Oct 28, 2020

    @danieleades
    Contributor

    another use-case for this-

    i'm using Poetry to build gRPC bindings. I need to build multiple packages of bindings to be named and published separately, but the projects have identical dependencies, build scripts, test scripts, etc. They even share a common source directory (since the proto files form a single tree)

    It would be really useful to have a single pyproject.toml file specifying multiple packages for this use case. The alternative (having a number of parallel projects) introduces a massive amount of duplication.

  5. sinoroc commented on Oct 28, 2020

    @sinoroc

    Is this somehow related to the following?

    I see that it is different, but I could also see some intersection between the two approaches for some use cases.

  6. github-actions commented on Mar 2, 2024

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  7. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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