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

Support controlling development releases with semver #148

Closed
wants to merge 2 commits into from

Conversation

ofek
Copy link
Sponsor Contributor

@ofek ofek commented Nov 2, 2018

https://semver.org/#spec-item-10

It would be incredibly useful to allow the parsing/bumping of dev versions https://www.python.org/dev/peps/pep-0440/#developmental-releases via traditional semver methods and have pip recognize it.

For example, pip being able to understand this workflow:

>>> import semver
>>>
>>> semver.bump_minor('6.7.0')
'6.8.0'
>>> semver.bump_prerelease('6.8.0')
'6.8.0-rc.1'
>>> semver.bump_build('6.8.0-rc.1', token='dev')
'6.8.0-rc.1+dev.1'
>>> semver.bump_build('6.8.0-rc.1+dev.1', token='dev')
'6.8.0-rc.1+dev.2'

A use case for us would be in https://github.com/DataDog/integrations-core and would allow for just using semver without any custom logic.

We occasionally need to have one release candidate where we rapidly iterate with customers. To do this, each new wheel will first go through our secure wheel distribution pipeline before becoming available on our index server and subsequently to the Agent running on their machines. As this will happen often in short succession, we don't want to assign each new test/preview its own prerelease as those have meaning to us.

Seeing as how the current regex allows for more specifiers than the original, I think allowing + before dev in addition to the current -_. would be acceptable.

cc @dstufft @benoit-pierre @pradyunsg WDYT?

@ofek ofek changed the title Support controlling development releases with sevmer Support controlling development releases with semver Nov 2, 2018
@pradyunsg
Copy link
Member

pradyunsg commented Nov 3, 2018

PEP 440 is the standardized format for version we implement here and it does not really treat the version numbers differently and supports an arbitrary number of them. 1.2.3.4.5.6.7 is a valid version, if someone wants to do that. That's why treating semver differently isn't something we'd do in packaging. (Edit: I just realized you're proposing that a higher level library, it's semver not packaging.semver would do that, making this point invalid)

Basically, changing the regex isn't something we'd do without a PEP update at the least, which would need to be discussed over on distutils-sig.

@pradyunsg
Copy link
Member

I think this should be discussed with the broader audience at Packaging on discuss.python.org or disutils-sig.

Please start a discussion there, linking back to this issue/PR. :)

@pradyunsg pradyunsg closed this Jun 5, 2019
@ofek ofek deleted the patch-1 branch May 29, 2021 20:14
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

2 participants