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 mxdev sources and checkouts #903

Open
wants to merge 6 commits into
base: 6.1
Choose a base branch
from
Open

Create mxdev sources and checkouts #903

wants to merge 6 commits into from

Conversation

thet
Copy link
Member

@thet thet commented Dec 9, 2023

Add scripts to create mxdev compatible ini files from sources.cfg and checkouts.cfg.

This feature is useful with the mxdev include feature, available since mxdev 3.1.0 and done at the Kitchen Sprint 2023 in Völs. See: mxstack/mxdev#37

TODO

  • integrate it in tox release workflow.
  • document somewhere
  • test a with mxdev

@thet thet requested a review from jensens December 9, 2023 22:42
@thet thet changed the base branch from 6.0 to 6.1 December 9, 2023 22:43
@thet thet marked this pull request as draft December 9, 2023 22:43
@thet thet force-pushed the create-mxsources branch 2 times, most recently from 7e6ae90 to f1e63a3 Compare December 10, 2023 11:28
@thet thet changed the title Create mxdev sources Create mxdev sources and checkouts Dec 10, 2023
@thet thet force-pushed the create-mxsources branch 3 times, most recently from 53e9369 to 34301ff Compare December 10, 2023 13:13
@thet thet marked this pull request as ready for review December 11, 2023 10:17
Copy link
Sponsor Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks.

Have you seen the work I did on plone.releaser the past months? For example in plone/plone.releaser#62 I added a bin/manage versions2constraints command and recently used this on the coredev 6.1 branch.
There is code to read on the one hand a checkouts.cfg and sources.cfg and on the other hand a mxdev ini file. Just the translation between the two needs to be hooked up.
And I obviously did not yet use the new include functionality.

My preferred solution would be:

  • Use the code that already is in plone.releaser, as this has tests.
  • Improve it so it can use the new include functionality from mxdev.
  • Add a bin/manage buildout2mxdev (or buildout2pip) command that translates all Buildout versions, checkouts and sources files to pip/mxdev files.

We can consider using your code for now, as it is available and seems to be working. Later we could switch to using plone.releaser.

Well, the tox command currently fails for me:

$ tox -c release/tox.ini -e mxdev
mxdev: commands[0] /Users/maurits/community/plone-coredev/6.1/release> python create-mxsources.py /Users/maurits/community/plone-coredev/6.1/release/../buildout.cfg /Users/maurits/community/plone-coredev/6.1/release/../sources.ini
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.1/release/create-mxsources.py", line 15, in <module>
    from zc.buildout import buildout
ModuleNotFoundError: No module named 'zc'

@mauritsvanrees
Copy link
Sponsor Member

BTW, do you and @jensens indeed prefer to split the sources and checkouts in two files? I would be fine with either one or two files, but two files make it a bit easier to translate between our current buildout config and mxdev, so I would be happy with that approach. A short checkouts.ini makes it easier to see which packages are checked out.

BTW, several commands already work on both buildout and mxdev files. If you temporarily rename or copy checkouts.ini to mxdev.ini, you get this:

$ bin/manage check-checkout Products.CMFPlone
YES, your package Products.CMFPlone is on auto checkout in mxdev.ini.
YES, your package Products.CMFPlone is on auto checkout in checkouts.cfg.

@jensens
Copy link
Sponsor Member

jensens commented Dec 11, 2023

I think having 3 files has it advantages.

  • mx.ini over all setup
  • mxsources.ini (yes prefix, so it stands together)
  • mxcheckout.ini with only the checkouts.

This way one may use only sources with own checkouts/branches(think PLIPS) overrides.

print("ERROR. Usage: create-mxcheckouts.py buildout.cfg checkouts.ini")
sys.exit(1)
config_file = sys.argv[1]
config_file = os.path.realpath(config_file)
Copy link
Sponsor Contributor

@gforcada gforcada Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using pathlib.Path makes it all much nicer to read 😃

Sorry on the phone ,I can provide suggestions later 😃

Copy link
Sponsor Contributor

@gforcada gforcada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with @mauritsvanrees plone.releaser changes we are getting closer and closer to replace zc.buildout finally 😃

mauritsvanrees added a commit to plone/plone.releaser that referenced this pull request May 13, 2024
So this has no url, branch, etc.
For an example, see plone/buildout.coredev#903
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.

None yet

4 participants