You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've been thinking about making an automation with Towncrier where setuptools-scm would be made aware of which segment should be updated when guessing the next version.
I know there are multiple strategies available, but they are all pretty much hardcoded. What I want is to keep using a strategy that's already available but be able to tell setuptools-scm whether the next guessed version would bump MAJOR, MINOR, PATCH or whatever segment bit.
What I was imagining is a sort of a setting that would allow pointing at an arbitrary callable (typically in-tree) that would return an integer telling setuptools-scm which part of the version needs to be bumped.
So API-wise, it'd align with https://github.com/pypa/setuptools_scm#extending-setuptools_scm. Let's say the name could be setuptools_scm.get_bump_segment_position.
Then, the end-users could provide a custom implementation of the version segment to be bumped detection. It'd look something like this:
MAJOR_SEGMENT=1MINOR_SEGMENT=2MICRO_SEGMENT=3defget_bump_segment_position(): # dunno if it needs to access any context through args
... # detect what types of the Towncrier fragments are present on diskif<there'ssomebreakingchanges>:
returnMAJOR_SEGMENTif<it'sanewfeature>:
returnMINOR_SEGMENTif<it'smisc/docs/internal>:
returnMICRO_SEGMENTreturnNone# delegate the auto-detection back to setuptools-scm
I think this design would provide enough flexibility to the end-users while not forcing them to revert to using the legacy setup.py or an in-tree PEP 517 backend wrapping setuptools, for example.
The text was updated successfully, but these errors were encountered:
So I've been thinking about making an automation with Towncrier where setuptools-scm would be made aware of which segment should be updated when guessing the next version.
I know there are multiple strategies available, but they are all pretty much hardcoded. What I want is to keep using a strategy that's already available but be able to tell setuptools-scm whether the next guessed version would bump MAJOR, MINOR, PATCH or whatever segment bit.
What I was imagining is a sort of a setting that would allow pointing at an arbitrary callable (typically in-tree) that would return an integer telling setuptools-scm which part of the version needs to be bumped.
So API-wise, it'd align with https://github.com/pypa/setuptools_scm#extending-setuptools_scm. Let's say the name could be
setuptools_scm.get_bump_segment_position
.Then, the end-users could provide a custom implementation of the version segment to be bumped detection. It'd look something like this:
I think this design would provide enough flexibility to the end-users while not forcing them to revert to using the legacy
setup.py
or an in-tree PEP 517 backend wrapping setuptools, for example.The text was updated successfully, but these errors were encountered: