summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-02-10 04:19:30 -0600
committerMonty Taylor <mordred@inaugust.com>2013-02-10 04:21:24 -0600
commit46834756f972d213e1aceb54e79139efae02c6f0 (patch)
tree33fb70387f9a10ce8aa9958bb197e4d29f482d81 /setup.py
parentad5ac5d2e824262c7b1fc109b87b4e6df73cb7ee (diff)
downloadoslo-version-46834756f972d213e1aceb54e79139efae02c6f0.tar.gz
Allow running test in uninstalled source tree.
It was pointed out that we missed the use-case that running tests in a fresh tree checkout should work - and we missed that by reaching too far into the setup module interface. Shame on us. Change-Id: Ic0056a3113b308f063d927484e1e4a44c9316a2d
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index fb187ff..35680b3 100644
--- a/setup.py
+++ b/setup.py
@@ -274,7 +274,7 @@ def _get_revno():
return len(revlist.splitlines())
-def get_version_from_git(pre_version):
+def _get_version_from_git(pre_version):
"""Return a version which is equal to the tag that's on the current
revision if there is one, or tag plus number of additional revisions
if the current revision has no tag."""
@@ -294,7 +294,7 @@ def get_version_from_git(pre_version):
return None
-def get_version_from_pkg_info(package_name):
+def _get_version_from_pkg_info(package_name):
"""Get the version from PKG-INFO file if we can."""
try:
pkg_info_file = open('PKG-INFO', 'r')
@@ -325,10 +325,10 @@ def get_version(package_name, pre_version=None):
version = os.environ.get("OSLO_PACKAGE_VERSION", None)
if version:
return version
- version = get_version_from_pkg_info(package_name)
+ version = _get_version_from_pkg_info(package_name)
if version:
return version
- version = get_version_from_git(pre_version)
+ version = _get_version_from_git(pre_version)
if version:
return version
raise Exception("Versioning for this project requires either an sdist"