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

get the news fragment "types" #684

Open
ewohnlich opened this issue Feb 6, 2025 · 1 comment
Open

get the news fragment "types" #684

ewohnlich opened this issue Feb 6, 2025 · 1 comment

Comments

@ewohnlich
Copy link

I want to get some metadata on the current news fragments, specifically the type. The idea is to save this result somewhere and use it to determine the semantic version to use. For instance, if the fragments were validated against my config and returned "bugfix,feat,bugfix,doc" I would use that and say, ok "feat" is the highest so I can run hatch version minor in my pipeline. Is this a good idea? bad idea?

As far as I can tell the closest way to do this is parse the towncrier check output. But that's not ideal because I can't take advantage of all of the useful utility functions already in place like parse_newfragment_basename. Is there an existing practical solution I am missing?

@adiroiban
Copy link
Member

Hi Eric

Thanks for the feedback.

Towncrier is not really designed to be integrated with other tools ... like hatch.

Also... there is no public Python API.

I think that if you need to implement a smart tool for hatch is better to create a custom plugin for hatching

I think that it's best to implement a tool outside of towncrier ... for example, before calling Towncrier, just check the content of your newsfragemnt directory and decide how to call the hatch command

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

No branches or pull requests

2 participants