Skip to content

Conversation

@nforro
Copy link
Member

@nforro nforro commented Dec 12, 2024

Fixes #404.

RELEASE NOTES BEGIN

There is a new convenience method Sections.get_or_create() that allows you to manipulate a section without checking if it exists first. If a section doesn't exist, it will be appended to the end. For example, this will work properly even on spec files without %changelog:

with spec.sections() as sections:
    changelog = sections.get_or_create("changelog")
    changelog[:] = ["%autochangelog"]

RELEASE NOTES END

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/e6d4a773ab6844e399a4023c6e7ae82e

✔️ pre-commit SUCCESS in 1m 55s
✔️ specfile-tests-rpm-deps SUCCESS in 1m 02s
✔️ specfile-tests-pip-deps SUCCESS in 1m 01s

Copy link
Member

@lachmanfrantisek lachmanfrantisek left a comment

Choose a reason for hiding this comment

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

Seems handy. Thanks for the example in the release notes.

@nforro nforro added the mergeit Merge via Zuul label Dec 13, 2024
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/fc79606bbb7d4d28b9614770736f4ae2

✔️ pre-commit SUCCESS in 1m 49s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit b5b95e9 into main Dec 13, 2024
36 of 37 checks passed
@nforro nforro deleted the sections branch December 13, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mergeit Merge via Zuul

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'Sections' object has no attribute 'changelog'

3 participants