aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapileshwar Singh <kapileshwarsingh@gmail.com>2016-07-14 12:39:32 +0200
committerGitHub <noreply@github.com>2016-07-14 12:39:32 +0200
commitbc2ee35e7f087bdc65965b0a4e43bce3e30edbb0 (patch)
tree15f89a0d209845d4697c8c41dd328259ea955547
parentf9054d7f36c9c892f85aad1f0ff79aa3e2f6ce55 (diff)
parentadb8fc25ebaa2a3a46719ad5670613e75f67fa31 (diff)
downloadbart-bc2ee35e7f087bdc65965b0a4e43bce3e30edbb0.tar.gz
Merge pull request #58 from JaviMerino/improve_version
bart: set the version using an explicit file
-rw-r--r--bart/__init__.py7
-rw-r--r--bart/version.py16
-rw-r--r--docs/api_reference/conf.py6
-rw-r--r--setup.py4
4 files changed, 22 insertions, 11 deletions
diff --git a/bart/__init__.py b/bart/__init__.py
index c031ebb..886dbc8 100644
--- a/bart/__init__.py
+++ b/bart/__init__.py
@@ -18,9 +18,4 @@
import bart.sched
import bart.common
import bart.thermal
-import pkg_resources
-
-try:
- __version__ = pkg_resources.get_distribution("bart-py").version
-except pkg_resources.DistributionNotFound:
- __version__ = "local"
+from bart.version import __version__
diff --git a/bart/version.py b/bart/version.py
new file mode 100644
index 0000000..da8af07
--- /dev/null
+++ b/bart/version.py
@@ -0,0 +1,16 @@
+# Copyright 2016-2016 ARM Limited
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+__version__ = "1.5.0"
diff --git a/docs/api_reference/conf.py b/docs/api_reference/conf.py
index 0d54455..32d6653 100644
--- a/docs/api_reference/conf.py
+++ b/docs/api_reference/conf.py
@@ -81,10 +81,10 @@ author = u'Kapileshwar Singh(KP), Javi Merino'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = '1.5'
+# The short X.Y version. Drop everything after the last "."
+version = bart.__version__[:bart.__version__.rindex(".")]
# The full version, including alpha/beta/rc tags.
-release = '1.5.0'
+release = bart.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index 69c3876..c73c225 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
from setuptools import setup, find_packages
-VERSION = "1.5.0"
+execfile("bart/version.py")
LONG_DESCRIPTION = """Behavioural Analysis involves the expressing the general
expectation of the state of the system while targeting a single or set of heuristics.
@@ -34,7 +34,7 @@ REQUIRES = [
]
setup(name='bart-py',
- version=VERSION,
+ version=__version__,
license="Apache v2",
author="ARM-BART",
author_email="bart@arm.com",