Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Create semver package #304

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

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 3 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ fabric.properties
# --------



# Patch/Diff Files
*.patch
*.diff
docs/_api
!docs/_api/semver.__about__.rst
317 changes: 0 additions & 317 deletions 317 CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,323 +102,6 @@ Trivial/Internal Changes
* :pr:`290`: Add supported Python versions to :command:`black`.



----


Version 2.13.0
==============

:Released: 2020-10-20
:Maintainer: Tom Schraitle


Features
--------

* :pr:`287`: Document how to create subclass from ``VersionInfo``


Bug Fixes
---------

* :pr:`283`: Ensure equal versions have equal hashes.
Version equality means for semver, that ``major``,
``minor``, ``patch``, and ``prerelease`` parts are
equal in both versions you compare. The ``build`` part
is ignored.


Additions
---------

n/a


Deprecations
------------

n/a


----


Version 2.12.0
==============

:Released: 2020-10-19
:Maintainer: Tom Schraitle


Bug Fixes
---------

* :gh:`291` (:pr:`292`): Disallow negative numbers of
``major``, ``minor``, and ``patch`` for :class:`semver.VersionInfo`


----


Version 2.11.0
==============

:Released: 2020-10-17
:Maintainer: Tom Schraitle


Bug Fixes
---------

* :gh:`276` (:pr:`277`): ``VersionInfo.parse`` should be a class method
Also add authors and update changelog in :gh:`286`
* :gh:`274` (:pr:`275`): Py2 vs. Py3 incompatibility TypeError


----


Version 2.10.2
==============

:Released: 2020-06-15
:Maintainer: Tom Schraitle

Features
--------

:gh:`268`: Increase coverage


Bug Fixes
---------

* :gh:`260` (:pr:`261`): Fixed ``__getitem__`` returning None on wrong parts
* :pr:`263`: Doc: Add missing "install" subcommand for openSUSE


Deprecations
------------

* :gh:`160` (:pr:`264`):
* :func:`semver.max_ver`
* :func:`semver.min_ver`


----


Version 2.10.1
==============

:Released: 2020-05-13
:Maintainer: Tom Schraitle


Features
--------

* :pr:`249`: Added release policy and version restriction in documentation to
help our users which would like to stay on the major 2 release.
* :pr:`250`: Simplified installation semver on openSUSE with ``obs://``.
* :pr:`256`: Made docstrings consistent



Bug Fixes
---------

* :gh:`251` (:pr:`254`): Fixed return type of ``semver.VersionInfo.next_version``
to always return a ``VersionInfo`` instance.


----



Version 2.10.0
==============

:Released: 2020-05-05
:Maintainer: Tom Schraitle

Features
--------

* :pr:`138`: Added ``__getitem__`` magic method to ``semver.VersionInfo`` class.
Allows to access a version like ``version[1]``.
* :pr:`235`: Improved documentation and shift focus on ``semver.VersionInfo`` instead of advertising
the old and deprecated module-level functions.
* :pr:`230`: Add version information in some functions:

* Use ``.. versionadded::`` RST directive in docstrings to
make it more visible when something was added
* Minor wording fix in docstrings (versions -> version strings)


Bug Fixes
---------

* :gh:`224` (:pr:`226`): In ``setup.py``, replaced in class ``clean``,
``super(CleanCommand, self).run()`` with ``CleanCommand.run(self)``
* :gh:`244` (:pr:`245`): Allow comparison with ``VersionInfo``, tuple/list, dict, and string.


Additions
---------

* :pr:`228`: Added better doctest integration


Deprecations
------------
* :gh:`225` (:pr:`229`): Output a DeprecationWarning for the following functions:

- ``semver.parse``
- ``semver.parse_version_info``
- ``semver.format_version``
- ``semver.bump_{major,minor,patch,prerelease,build}``
- ``semver.finalize_version``
- ``semver.replace``
- ``semver.VersionInfo._asdict`` (use the new, public available
function ``semver.VersionInfo.to_dict()``)
- ``semver.VersionInfo._astuple`` (use the new, public available
function ``semver.VersionInfo.to_tuple()``)

These deprecated functions will be removed in semver 3.


----


Version 2.9.1
=============
:Released: 2020-02-16
:Maintainer: Tom Schraitle

Features
--------

* :gh:`177` (:pr:`178`): Fixed repository and CI links (moved https://github.com/k-bx/python-semver/ repository to https://github.com/python-semver/python-semver/)
* :pr:`179`: Added note about moving this project to the new python-semver organization on GitHub
* :gh:`187` (:pr:`188`): Added logo for python-semver organization and documentation
* :gh:`191` (:pr:`194`): Created manpage for pysemver
* :gh:`196` (:pr:`197`): Added distribution specific installation instructions
* :gh:`201` (:pr:`202`): Reformatted source code with black
* :gh:`208` (:pr:`209`): Introduce new function :func:`semver.VersionInfo.isvalid`
and extend :command:`pysemver` with :command:`check` subcommand
* :gh:`210` (:pr:`215`): Document how to deal with invalid versions
* :pr:`212`: Improve docstrings according to PEP257

Bug Fixes
---------

* :gh:`192` (:pr:`193`): Fixed "pysemver" and "pysemver bump" when called without arguments


----

Version 2.9.0
=============
:Released: 2019-10-30
:Maintainer: Sébastien Celles <s.celles@gmail.com>

Features
--------

* :gh:`59` (:pr:`164`): Implemented a command line interface
* :gh:`85` (:pr:`147`, :pr:`154`): Improved contribution section
* :gh:`104` (:pr:`125`): Added iterator to :func:`semver.VersionInfo`
* :gh:`112`, :gh:`113`: Added Python 3.7 support
* :pr:`120`: Improved test_immutable function with properties
* :pr:`125`: Created :file:`setup.cfg` for pytest and tox
* :gh:`126` (:pr:`127`): Added target for documentation in :file:`tox.ini`
* :gh:`142` (:pr:`143`): Improved usage section
* :gh:`144` (:pr:`156`): Added :func:`semver.replace` and :func:`semver.VersionInfo.replace`
functions
* :gh:`145` (:pr:`146`): Added posargs in :file:`tox.ini`
* :pr:`157`: Introduce :file:`conftest.py` to improve doctests
* :pr:`165`: Improved code coverage
* :pr:`166`: Reworked :file:`.gitignore` file
* :gh:`167` (:pr:`168`): Introduced global constant :data:`SEMVER_SPEC_VERSION`

Bug Fixes
---------

* :gh:`102`: Fixed comparison between VersionInfo and tuple
* :gh:`103`: Disallow comparison between VersionInfo and string (and int)
* :gh:`121` (:pr:`122`): Use python3 instead of python3.4 in :file:`tox.ini`
* :pr:`123`: Improved :func:`__repr__` and derive class name from :func:`type`
* :gh:`128` (:pr:`129`): Fixed wrong datatypes in docstring for :func:`semver.format_version`
* :gh:`135` (:pr:`140`): Converted prerelease and build to string
* :gh:`136` (:pr:`151`): Added testsuite to tarball
* :gh:`154` (:pr:`155`): Improved README description

Removals
--------

* :gh:`111` (:pr:`110`): Dropped Python 3.3
* :gh:`148` (:pr:`149`): Removed and replaced ``python setup.py test``


----

Version 2.8.2
=============
:Released: 2019-05-19
:Maintainer: Sébastien Celles <s.celles@gmail.com>

Skipped, not released.

----

Version 2.8.1
=============
:Released: 2018-07-09
:Maintainer: Sébastien Celles <s.celles@gmail.com>

Features
--------

* :gh:`40` (:pr:`88`): Added a static parse method to VersionInfo
* :gh:`77` (:pr:`47`): Converted multiple tests into pytest.mark.parametrize
* :gh:`87`, :gh:`94` (:pr:`93`): Removed named tuple inheritance.
* :gh:`89` (:pr:`90`): Added doctests.

Bug Fixes
---------

* :gh:`98` (:pr:`99`): Set prerelease and build to None by default
* :gh:`96` (:pr:`97`): Made VersionInfo immutable


----

Version 2.8.0
=============
:Released: 2018-05-16
:Maintainer: Sébastien Celles <s.celles@gmail.com>


Changes
-------

* :gh:`82` (:pr:`83`): Renamed :file:`test.py` to :file:`test_semver.py` so
py.test can autodiscover test file

Additions
---------

* :gh:`79` (:pr:`81`, :pr:`84`): Defined and improve a release procedure file
* :gh:`72`, :gh:`73` (:pr:`75`): Implemented :func:`__str__` and :func:`__hash__`

Removals
--------

* :gh:`76` (:pr:`80`): Removed Python 2.6 compatibility


..
Local variables:
coding: utf-8
Expand Down
15 changes: 8 additions & 7 deletions 15 README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ A Python module for `semantic versioning`_. Simplifies comparing versions.
.. |MAINT| replace:: ``maint/v2``
.. _MAINT: https://github.com/python-semver/python-semver/tree/maint/v2


The module follows the ``MAJOR.MINOR.PATCH`` style:

* ``MAJOR`` version when you make incompatible API changes,
Expand All @@ -45,11 +46,11 @@ To import this library, use:
>>> import semver

Working with the library is quite straightforward. To turn a version string into the
different parts, use the ``semver.VersionInfo.parse`` function:
different parts, use the ``semver.Version.parse`` function:

.. code-block:: python

>>> ver = semver.VersionInfo.parse('1.2.3-pre.2+build.4')
>>> ver = semver.Version.parse('1.2.3-pre.2+build.4')
>>> ver.major
1
>>> ver.minor
Expand All @@ -62,21 +63,21 @@ different parts, use the ``semver.VersionInfo.parse`` function:
'build.4'

To raise parts of a version, there are a couple of functions available for
you. The function ``semver.VersionInfo.bump_major`` leaves the original object untouched, but
returns a new ``semver.VersionInfo`` instance with the raised major part:
you. The function ``semver.Version.bump_major`` leaves the original object untouched, but
returns a new ``semver.Version`` instance with the raised major part:

.. code-block:: python

>>> ver = semver.VersionInfo.parse("3.4.5")
>>> ver = semver.Version.parse("3.4.5")
>>> ver.bump_major()
VersionInfo(major=4, minor=0, patch=0, prerelease=None, build=None)
Version(major=4, minor=0, patch=0, prerelease=None, build=None)

It is allowed to concatenate different "bump functions":

.. code-block:: python

>>> ver.bump_major().bump_minor()
VersionInfo(major=4, minor=1, patch=0, prerelease=None, build=None)
Version(major=4, minor=1, patch=0, prerelease=None, build=None)

To compare two versions, semver provides the ``semver.compare`` function.
The return value indicates the relationship between the first and second
Expand Down
1 change: 1 addition & 0 deletions 1 changelog.d/169.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate CLI functions not imported from ``semver.cli``.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we add another file 305.deprecation.rst to describe the deprecation of VersionInfo > Version?

Oh, I see, you have that as a documentation issue. Hmn... not sure, if people will find it. IMHO it wouldn't hurt to add this here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I will just rename the file 305.doc.rst to 305.deprecation.rst.

10 changes: 10 additions & 0 deletions 10 changelog.d/169.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Create semver package and split code among different modules in the packages.

* Remove :file:`semver.py`
* Create :file:`src/semver/__init__.py`
* Create :file:`src/semver/cli.py` for all CLI methods
* Create :file:`src/semver/_deprecated.py` for the ``deprecated`` decorator and other deprecated functions
* Create :file:`src/semver/__main__.py` to allow calling the CLI using :command:`python -m semver`
* Create :file:`src/semver/_types.py` to hold type aliases
* Create :file:`src/semver/version.py` to hold the :class:`Version` class (old name :class:`VersionInfo`) and its utility functions
* Create :file:`src/semver/__about__.py` for all the metadata variables
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.