bitprophet / releases

A powerful Sphinx changelog-generating extension.
http://releases.readthedocs.io/
BSD 2-Clause "Simplified" License
176 stars 41 forks source link

PEP 440 Pre-release versioning style? #78

Open tony opened 6 years ago

tony commented 6 years ago

In cihai, I currently have a tag / release like this:

https://github.com/cihai/cihai/blob/v0.9.0a1/cihai/__about__.py

__version__ = '0.9.0a1'

(First, since I prefix my version tags with v, #54/#76 applies by master link breaking by pointing to vmaster as a branch)

But the other issue is PEP440's pre-release semantic

Some projects use an "alpha, beta, release candidate" pre-release cycle to support testing by their users prior to a final release.

If used as part of a project's development cycle, these pre-releases are indicated by including a pre-release segment in the version identifier:

X.YaN # Alpha release X.YbN # Beta release X.YrcN # Release Candidate X.Y # Final release

A version identifier that consists solely of a release segment and a pre-release segment is termed a "pre-release".

The pre-release segment consists of an alphabetical identifier for the pre-release phase, along with a non-negative integer value. Pre-releases for a given release are ordered first by phase (alpha, beta, release candidate) and then by the numerical component within that phase.

- :release:`0.9.0a1 <2018-09-07>`
Exception occurred:
  File "/Users/t/.local/share/virtualenvs/cihai-Ogsz9zWm/lib/python3.6/site-packages/semantic_version/base.py", line 205, in parse
    raise ValueError('Invalid version string: %r' % version_string)
ValueError: Invalid version string: '0.9.0a1'
The full traceback has been saved in /var/folders/v6/d9wjxg3s6ys7r4tqtp2b0w9c0000gn/T/sphinx-err-pdjyfvhh.log, if you want to report the issue to the developers.
- :release:`0.9.0a <2018-09-07>`
Exception occurred:
  File "/Users/t/.local/share/virtualenvs/cihai-Ogsz9zWm/lib/python3.6/site-packages/semantic_version/base.py", line 205, in parse
    raise ValueError('Invalid version string: %r' % version_string)
ValueError: Invalid version string: '0.9.0a'
The full traceback has been saved in /var/folders/v6/d9wjxg3s6ys7r4tqtp2b0w9c0000gn/T/sphinx-err-zr49qx_e.log, if you want to report the issue to the developers.

Version info

cihai-Ogsz9zWm ❯ python --version
Python 3.6.5

cihai-Ogsz9zWm ❯ pip show releases
Name: releases
Version: 1.6.1
Summary: A Sphinx extension for changelog manipulation

cihai-Ogsz9zWm ❯ pip show sphinx
Name: Sphinx
Version: 1.7.9
Summary: Python documentation generator
cihai-Ogsz9zWm ❯ pip show docutils
Name: docutils
Version: 0.14
Summary: Docutils -- Python Documentation Utilities
Home-page: http://docutils.sourceforge.net/
bitprophet commented 6 years ago

Handling pre-release releases is currently out of scope, but I'll leave this open and labeled in case somebody comes up with a well-presented PR to add support for them without rocking the boat too much. Thanks for the request!