From e795a4a240df0039bca711999ec57f7856189547 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 10 Jul 2015 14:32:36 +1200 Subject: [PATCH] Cleanup version number handling. --- __version__.py | 1 - docs/index.txt | 3 +++ mock/mock.py | 10 +++++++--- requirements.txt | 4 ++++ 4 files changed, 14 insertions(+), 4 deletions(-) delete mode 100644 __version__.py diff --git a/__version__.py b/__version__.py deleted file mode 100644 index fcf5b083..00000000 --- a/__version__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '1.1.0dev1' diff --git a/docs/index.txt b/docs/index.txt index b840f458..d6d620f4 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -132,6 +132,9 @@ Python 2.7 or higher. Releasing ========= +NB: please use semver. Bump the major component on API breaks, minor on all +non-bugfix changes, patch on bugfix only changes. + 1. tag -s, push --tags origin master 2. setup.py sdist bdist_wheel upload -s diff --git a/mock/mock.py b/mock/mock.py index b9c2222a..269f17d4 100644 --- a/mock/mock.py +++ b/mock/mock.py @@ -35,6 +35,8 @@ from __future__ import absolute_import __all__ = ( + '__version__', + 'version_info', 'Mock', 'MagicMock', 'patch', @@ -52,9 +54,6 @@ ) -__version__ = '1.1.0dev1' - - from functools import partial import inspect import pprint @@ -67,6 +66,11 @@ import six from six import wraps +from pbr.version import VersionInfo + +_v = VersionInfo('mock').semantic_version() +__version__ = _v.release_string() +version_info = _v.version_tuple() import mock diff --git a/requirements.txt b/requirements.txt index fe98ba13..d598a4e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ funcsigs;python_version<"3.3" +# For runtime needs this is correct. For setup_requires needs, 1.2.0 is needed +# but setuptools can't cope with conflicts in setup_requires, so thats +# unversioned. +pbr>=0.11 six