-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce support for relative include of non-package modules ("workspaces") #273
Conversation
Hello @DavidVujic, thanks a lot for your contribution and feature idea. In general I like the idea of "workspaces" and think it is a valuable thing. Currently we are working hard to get poetry 1.2 ready. Once it is ready there will be very likely a phase where we will need to stabilize all the new stuff. Once this is done we can focus on new feature again. So please be prepared that it will take some time (unfortunately a can not say how long) until we can have a closer look on your implementation. I'm telling you that now, because I don't want you to be frustrated, if you didn't receive feedback within a certain time from us. We really appreciated your willing to contribute to Poetry. 👍 🙏 fin swimmer |
Hi @finswimmer, No worries! Great job with the new stuff, I can imagine it is a lot of work. 💪 By working with this PR, I have learned more about Poetry and got some new ideas for how to develop an upcoming plugin, that aims to simplify working with Monorepos. I will do a couple of updates on this one and additions before switching it from a |
2060392
to
f5e36d8
Compare
A solution: in this commit - introducing namespaced shared package includes.
Alternatively, pass in other params to BuildIncludeFile and/or call a new function from the builders. ✅ done |
90f01f6
to
71b0f8d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@DavidVujic Thank you for kicking this off. This is definitely a great feature for the python ecosystem. I have not gone into the details of implementation yet, but I amd definitely keen on getting this or a similar concept into poetry. Hence python-poetry/poetry#2270. :) A few high level questions:
Asking these because I would really love to have the feature flushed out a bit more before we start the implementation. |
Hi! I have released a Poetry plugin (based on the preview that has support for plugins) that takes the idea of a workspace - a monorepo - containing components and a simplistic way of reusing code in several projects. It is based on the Polylith architecture. The difference between a component and a library is that a component is much smaller, more like a LEGO brick to be used with other components 😄 In short, this approach encourages you to use the I found it most simplistic to use a A I have written a post about this and a short demo/video, explaining the idea and the tooling (based on Poetry): Here's the Poetry plugin repo (also published to pypi): |
120963b
to
469878b
Compare
469878b
to
bc76189
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hi 👋 Any chance of getting this one reviewed, and 🤞 maybe even merged? 😄 |
2c15dd6
to
8397e37
Compare
a719575
to
546743f
Compare
9a0d42b
to
ce925be
Compare
Here's a video (sound on!) where I explain the feature that is added in this Pull Request. Please let me know if you have any questions, thoughts or feedback about this. (I had to downsize the quality to be able to post it in a comment like this) workspaces-in-python-poetry.-.SD.480p.mov |
7044dd3
to
d434a0e
Compare
Hi @DavidVujic i am also interested in this feature and I could see you have put tremendous effort here. I hope this is reviewed and merged. |
for more information, see https://pre-commit.ci
…g the workspace path
…n building in a workspace
for more information, see https://pre-commit.ci
…es into the function instead of inline code
for more information, see https://pre-commit.ci
…ject.toml file is. The cwd could be somewhere else if the build command would accept a path to pyproject.toml.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…spaces into separate function
for more information, see https://pre-commit.ci
90509f9
to
b9d806f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This Pull Request has come full circle 🟢 😄 I understand the hesitation to add the functionality of this Pull Request into poetry-core. Meanwhile, I have updated the The plugin will allow relative includes in a
Give it a try and please let me know if you find any 🐛 🐛 . Please add an issue to the github page of the project. 🙏 |
The purpose of the changes here is to enable Workspace support. A workspace is a place for code and projects. Within the workspace, code can be shared. A workspace is usually at the root of your repository.
To identify a workspace in a Python repo, an empty
workspace.toml
file is put at the top of the workspace. Future plugins that extends workspaces could use that file to store configuration and settings.The feature in this pull request will make this this plugin redundant 😄 (I am the author of that plugin)
Why workspaces?
A workspace can contain more than one project. Different projects will likely use the same code. A very simplistic example would be a logger. To avoid code duplication, code could be moved out from the project into packages, and each project can reference the package from the project specific
pyproject.toml
file.This requires that Poetry allows package includes (note the difference from dependencies) that are "outside" of the project path, but within a workspace. That's what this pull request will do.
An example & simplified tree workspace structure (note the namespacing for shared package includes):
I think this feature resolves the issues raised in:
python-poetry/poetry#936
and probably also
python-poetry/poetry#2270