Skip to content

How to handle dependecies? #113

Closed
Closed

Description

@anentropic

I have seen the Polylith concept before but have not used it

Seeing you had this Poetry plugin and I had a new monorepo to structure I decided to give it a go

I am a bit confused about how to handle dependencies

I can see there is a root pyproject.toml and then individual ones for each project

Should I poetry add all deps at the root level and then use poetry poly sync to let the plugin apply only relevant deps to the project pyproject.toml files? i.e. I shouldn't manage the project files manually myself at all?

Activity

  1. anentropic commented on Sep 25, 2023

    @anentropic
    Author

    I guess I do manage the project pyproject.tomls manually, as in I should manually add bases and components to them (?)

    so I tried e.g.

    • poetry add django at the root level
    • import something from django in one of my bases' core.py
    • add that base to a project's pyproject.toml packages directive
    • poetry poly sync

    but this didn't update the project dependencies

    does this mean I have to keep these in sync manually and poetry add everything twice? am I missing something?

    it'd be nice if I can add packages to a project from the root without cd into its subdir first

  2. anentropic commented on Sep 25, 2023

    @anentropic
    Author

    another question...

    I can see that poly create base generates a structure like:

    bases/
      myworkspace/
        mybase/
          __init__.py
          core.py
    

    and __init__.py looks like:

    from reporting.infra import core
    
    __all__ = ["core"]

    This is quite a nice default, but my question is: is this structure something that the plugin relies on for being able to parse the code structure?

    Can I deviate from this if I wanted to and omit the __all__ from __init__.py ?

  3. DavidVujic commented on Sep 25, 2023

    @DavidVujic
    Owner

    (converting this into a GitHub discussion)

  4. Repository owner locked and limited conversation to collaborators on Sep 25, 2023
  5. converted this issue into a discussion #114 on Sep 25, 2023
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