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

Add buildout2pip command #72

Merged
merged 16 commits into from
May 30, 2024
Merged

Add buildout2pip command #72

merged 16 commits into from
May 30, 2024

Conversation

mauritsvanrees
Copy link
Member

We already had bin/manage version2constraints. Now we have bin/manage buildout2pip. It translates versions*.cfg, checkouts*.cfg and sources*.cfg to their pip/mxdev equivalents.

This aims to create what @thet added in plone/buildout.coredev#903. @jensens there suggested mxsources.ini and mxcheckouts.ini and I went with that.

The base code has tests, but I would like to add a few more high level tests. But you can try it out in buildout.coredev. plone.releaser is already in the checkouts. So go to src/plone.releaser and checkout the branch of this PR, and then in the buildout run bin/manage buildout2pip and see what files it creates.

Note that this PR mostly removes support for a mxdev.ini file with both sources and checkouts in one: you must separate them into two files. This matches what we are doing in coredev with buildout since years.

Also, I hardcode putting default-use = false in mxsources.ini, without looking at the [buildout] always-checkout value in checkouts.cfg. We may want to make clearer in the readme that this package is really only meant for core Plone development, not as a package for general use. It just gets too complicated if we want to support use cases that we do not have in core Plone.

So this has no url, branch, etc.
For an example, see plone/buildout.coredev#903
From now on we only want source information in here, not checkout information.
For that we have MxCheckoutsFile.
I want to use this in pip.py as well.
Pass a name to create_from_string.
In create_from_section use the name of the section.
This translates buildout versions, sources, and checkouts to their pip/mxdev variants.
@mauritsvanrees mauritsvanrees requested a review from gforcada May 14, 2024 20:55
@mister-roboto
Copy link

@mauritsvanrees thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@wesleybl
Copy link
Member

@mauritsvanrees this is one step towards a "pip.coredev"? Will you plan on using pip instead of buildout someday?

@mauritsvanrees
Copy link
Member Author

@mauritsvanrees this is one step towards a "pip.coredev"? Will you plan on using pip instead of buildout someday?

@wesleybl This brings buildout and pip more on the same level, but still with buildout leading, being the source.
Next step would be to create a pip2buildout command, and then pip can become leading. We could already do that in 6.1, but needs more work in buildout.coredev.
Then at some point we could completely drop buildout. But that would at the earliest be in Plone 7.0. Until then I definitely want to support buildout. Unless it breaks...

And yes, at some point (Plone 7.0?) we might rename or copy buildout.coredev to pip.coredev. Probably just coredev: I already am often not sure whether it is buildout.coredev or coredev.buildout. :-)

@jensens
Copy link
Member

jensens commented May 17, 2024

this should generate ini files not txt.

@mauritsvanrees
Copy link
Member Author

this should generate ini files not txt.

Done. And I have added tests.

This is now ready for review.

@mauritsvanrees mauritsvanrees marked this pull request as ready for review May 27, 2024 19:25
@mauritsvanrees mauritsvanrees merged commit 43afa17 into master May 30, 2024
9 checks passed
@jensens jensens deleted the maurits-pip-sources branch May 30, 2024 20:11
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.

4 participants