summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-04-26 16:15:37 -0700
committerscheibelp <scheibel1@llnl.gov>2018-05-17 14:10:30 -0700
commitbc9f5f084f36ee56b707616437d33739879e4890 (patch)
treeaa2e3f09b63d34b40f213419bca08f589fda3b5f /lib
parent678639749c447ba79cea9dfd731bdfd40f9f5dac (diff)
downloadspack-bc9f5f084f36ee56b707616437d33739879e4890.tar.gz
spack-bc9f5f084f36ee56b707616437d33739879e4890.tar.bz2
spack-bc9f5f084f36ee56b707616437d33739879e4890.tar.xz
spack-bc9f5f084f36ee56b707616437d33739879e4890.zip
init: remove dependency on spack.version
- no longer require `spack_version` to be a Version (it isn't used that way anyway) - use a simple tuple `spack_version_info` with major, minor, patch versions - generate `spack_version` from the tuple
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/conf.py4
-rw-r--r--lib/spack/spack/__init__.py18
-rw-r--r--lib/spack/spack/test/cmd/python.py2
3 files changed, 8 insertions, 16 deletions
diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py
index 18779c5d0c..c269c7ee27 100644
--- a/lib/spack/docs/conf.py
+++ b/lib/spack/docs/conf.py
@@ -192,9 +192,9 @@ copyright = u'2013-2018, Lawrence Livermore National Laboratory.'
# built documents.
#
# The short X.Y version.
-version = str(spack.spack_version.up_to(2))
+version = '.'.join(str(s) for s in spack.spack_version_info[:2])
# The full version, including alpha/beta/rc tags.
-release = str(spack.spack_version.up_to(2))
+release = spack.spack_version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index 714f0e7377..002e9185de 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -25,19 +25,11 @@
##############################################################################
import sys
-#-----------------------------------------------------------------------------
-# Initialize various data structures & objects at the core of Spack.
-#
-# TODO: move all of these imports out of __init__ to avoid importing the whole
-# TODO: world on Spack startup. There are some design changes that need to be
-# TODO: made to enable this (decoupling Spec, repo, DB, and store state).
-#
-# TODO: Spack probably needs some kind of object to manage this state so that
-# TODO: this stuff doesn't have to be at module scope.
-# -----------------------------------------------------------------------------
-# Version information
-from spack.version import Version
-spack_version = Version("0.11.2")
+#: major, minor, patch version for Spack, in a tuple
+spack_version_info = (0, 11, 2)
+
+#: String containing Spack version joined with .'s
+spack_version = '.'.join(str(v) for v in spack_version_info)
# Set up the default packages database.
diff --git a/lib/spack/spack/test/cmd/python.py b/lib/spack/spack/test/cmd/python.py
index 73221d7316..380d7838ce 100644
--- a/lib/spack/spack/test/cmd/python.py
+++ b/lib/spack/spack/test/cmd/python.py
@@ -30,4 +30,4 @@ python = SpackCommand('python')
def test_python():
out = python('-c', 'import spack; print(spack.spack_version)')
- assert out.strip() == str(spack.spack_version)
+ assert out.strip() == spack.spack_version