diff --git a/README.md b/README.md index 77149a8..67a27c9 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ as `dev` as long as `pyipmi/version.py` has not been generated, e.g. by The version of the package is taken from, in this order: -1. `git describe --tags` in a git checkout, e.g. `0.5.8.dev77+g7c853b0` +1. `git describe --tags` in a git checkout, e.g. `0.5.8.post77+g7c853b0` for the 77th commit after the tag `0.5.8` 2. `pyipmi/version.py`, which is generated by `setup.py` and is part of the source distribution on PyPI diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index def6b71..683c7f9 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -150,7 +150,7 @@ Package version The version of the package is taken from, in this order: -#. ``git describe --tags`` in a git checkout, e.g. ``0.5.8.dev77+g7c853b0`` +#. ``git describe --tags`` in a git checkout, e.g. ``0.5.8.post77+g7c853b0`` for the 77th commit after the tag ``0.5.8`` #. ``pyipmi/version.py``, which is generated by ``setup.py`` and is part of the source distribution on PyPI diff --git a/pyipmi/interfaces/ipmb.py b/pyipmi/interfaces/ipmb.py index 77c53e7..2ba4634 100644 --- a/pyipmi/interfaces/ipmb.py +++ b/pyipmi/interfaces/ipmb.py @@ -37,7 +37,6 @@ from collections.abc import Iterable, Sequence from .. import Routing, Target -from ..errors import IpmiTimeoutError from ..msgs import (create_message, create_request_by_name, encode_message, decode_message, constants) from ..utils import check_rsp_completion_code diff --git a/setup.py b/setup.py index 5136794..426ae98 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,10 @@ def pep440_version(describe): """Convert the output of 'git describe' to a PEP 440 version. - 0.5.8-77-g7c853b0.dirty -> 0.5.8.dev77+g7c853b0.dirty + 0.5.8-77-g7c853b0.dirty -> 0.5.8.post77+g7c853b0.dirty + + The commits after a tag are counted as a post-release: a version + newer than the tag, so that it satisfies e.g. python-ipmi>=0.5.8. Without tags, e.g. in a shallow clone, 'git describe --always' prints only the abbreviated commit: @@ -32,7 +35,7 @@ def pep440_version(describe): tag, distance, commit, dirty = m.groups() version = tag if distance: - version += f'.dev{distance}+{commit}' + version += f'.post{distance}+{commit}' if dirty: version += ('.' if distance else '+') + dirty[1:] return version