Skip to content

Keep pyproject.toml project table#359

Open
gforcada wants to merge 3 commits into2.xfrom
315-pyproject-static-section
Open

Keep pyproject.toml project table#359
gforcada wants to merge 3 commits into2.xfrom
315-pyproject-static-section

Conversation

@gforcada
Copy link
Member

@gforcada gforcada commented Mar 18, 2026

This is split from #355 as that is getting broader and broader 😅

Or rather, smaller PRs are simpler to review and merge ✨

Here, we ensure that if there is some special comments on pyproject.toml whatever is between them it is kept verbatim whenever config-package is run.

This is a stepping stone for #355

@gforcada gforcada requested a review from mauritsvanrees March 18, 2026 09:17
Copy link
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.

LGTM. I tried with a simple text like this and it remained:

# START-MARKER-MANUAL-CONFIG
[random]
stuff = "test"
# END-MARKER-MANUAL-CONFIG

It breaks when the file does not exist yet though. See inline suggestion.

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

Wouldn't it be possible to make it keep the project table without special markers?

@gforcada gforcada force-pushed the 315-pyproject-static-section branch from 0ea9879 to e4f814b Compare March 18, 2026 22:23
@gforcada gforcada requested a review from mauritsvanrees March 18, 2026 22:23
@gforcada
Copy link
Member Author

@davisagli I guess so, yes, we can read the file with tomlkit store the table and apply it after the changes.

OTOH, all other files managed by plone.meta (and also pyproject.toml) have a comment at the very top stating "DO NOT TOUCH, MANAGED BY PLONE.META".

By keeping these comments we ensure that anyone wanting to modify the trove classifiers of a random python distribution might first think "oops I can not do it (reading the comment at the top)" but then by seen the markers will think "oh, but here I can edit freely, cool".

From a developers experience I would say that keeping the markers makes more sense.

Either that, or we modify the comment at the top stating that the project table is copied verbatim whenver plone.meta is run 🤷🏾

@davisagli
Copy link
Member

@gforcada I don't feel strongly. Try something (this way is fine) and we can adjust if needed.

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.

3 participants