Skip to content
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

Create toml for blocks #6

Closed
wants to merge 4 commits into from
Closed

Create toml for blocks #6

wants to merge 4 commits into from

Conversation

sharky98
Copy link

pyproject.toml might be needed for the blocks to define the deps. Polylith does so with its own tool.

@sharky98
Copy link
Author

Warning: I did not test (yet) if everything still work.

@DavidVujic
Copy link
Owner

Thank you for this pull request @sharky98!

If I understand it correctly, a pyproject.toml is added in a block. Will that one be picked up by the Poetry tool when building?

@DavidVujic DavidVujic self-requested a review September 12, 2022 06:28
@DavidVujic DavidVujic mentioned this pull request Sep 12, 2022
@sharky98
Copy link
Author

Like I said I didn't test anything yet. Also, with the current version of the plugin, poetry does not seems to recognize the pyproject.toml in the Projects sub directory. At least, I didn't find a way (this is my first day with Poetry).

However, your Multiproject plugin should do the trick of running the build inside either bases or components with the poetry build-project -t path/to/pyproject.toml command.

But I think a better idea would be to have a simple generic wrapper over poetry (inside the multi plugin?). This wrapper could list in the workspaces.toml all the directory that has the pyproject.toml (with the "project" name) file and when you run poetry multi {commands} it loop the base poetry {commands} over all directory with a pyproject.toml. This could also add a new flag -p {projectName} to launch the command only on the selected projects (project in the sense of pyproject.toml, not Polylith project).

@DavidVujic
Copy link
Owner

DavidVujic commented Sep 12, 2022

Like I said I didn't test anything yet. Also, with the current version of the plugin, poetry does not seems to recognize the pyproject.toml in the Projects sub directory. At least, I didn't find a way (this is my first day with Poetry).

However, your Multiproject plugin should do the trick of running the build inside either bases or components with the poetry build-project -t path/to/pyproject.toml command.

But I think a better idea would be to have a simple generic wrapper over poetry (inside the multi plugin?). This wrapper could list in the workspaces.toml all the directory that has the pyproject.toml (with the "project" name) file and when you run poetry multi {commands} it loop the base poetry {commands} over all directory with a pyproject.toml. This could also add a new flag -p {projectName} to launch the command only on the selected projects (project in the sense of pyproject.toml, not Polylith project).

I think this might be a feature considered in the future. Today, I would like to let the official Poetry tool do the actual building (because it does that very well), and just help it out with the current limitations of it (not being able to reference dependencies outside of a project hiearchy). So I'm leaning on letting the actual project define external dependencies. That's the way the Clojure Polylith tool did until recently.

I hope the developers of Poetry will like my current PR that will add the possibility of workspaces in a natural way (so I can archive the multiproject plugin).

@DavidVujic
Copy link
Owner

I am currently working on a way to make the dependencies experience better, and am trying out a different path than the one suggested in this Pull Request. I like your approach very much even if it is not complete and fully working, and I also like that it is much like the Clojure implementation.

I have been inspired by your work and will hopefully release a new command that will make dependency management across projects visual and a smooth experience.

Thank you for contributing to this project, it is very appreciated! ⭐

@DavidVujic DavidVujic closed this Jan 28, 2023
@DavidVujic DavidVujic mentioned this pull request Feb 19, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants