How to handle dependecies? #114
-
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 Should I |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
I guess I do manage the project so I tried e.g.
but this didn't update the project dependencies does this mean I have to keep these in sync manually and it'd be nice if I can add packages to a project from the root without |
Beta Was this translation helpful? Give feedback.
-
another question... I can see that
and 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 |
Beta Was this translation helpful? Give feedback.
-
(converting this into a GitHub discussion) |
Beta Was this translation helpful? Give feedback.
-
Hi! The The The sync command is totally optional, you can add the packages manually if you like! Polylith for Python separates the bricks (the code in the components and bases folder) from third-party dependencies. The bricks is defined in |
Beta Was this translation helpful? Give feedback.
The
poetry poly sync
would need an entry point defined in the project-specific toml files. You could add your base in the project-specific toml and then run the command. If the base is importing a component, it will add it to the project toml if it is missing.poetry add
is for the third-party dependencies, such as django or requests. You can add the dependencies to the root workspace pyproject.toml for development, and add the needed third-party dependencies to each project in the workspace. Thepoetry poly check
andpoetry poly libs
commands will highlight any missing libraries, helping developers catch any missing dependencies.All commands support the
--directory
option (coming from P…