diff --git a/doc/api_reference/conf.py b/doc/api_reference/conf.py index ca076f60..fa92fc0a 100644 --- a/doc/api_reference/conf.py +++ b/doc/api_reference/conf.py @@ -81,10 +81,10 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '5.5' +# The short X.Y version. Drop everything after the last "." +version = trappy.__version__[:trappy.__version__.rindex(".")] # The full version, including alpha/beta/rc tags. -release = '5.5.0' +release = trappy.__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 e3dfde7f..fe60a330 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import setup, find_packages -VERSION = "5.5.0" +execfile("trappy/version.py") LONG_DESCRIPTION = """TRAPpy is a framework written in python for analysing and plotting FTrace data by converting it into standardised @@ -48,7 +48,7 @@ } setup(name='TRAPpy', - version=VERSION, + version=__version__, license="Apache v2", author="ARM-TRAPPY", author_email="trappy@arm.com", diff --git a/trappy/__init__.py b/trappy/__init__.py index f8a9581a..b6fcfcf6 100644 --- a/trappy/__init__.py +++ b/trappy/__init__.py @@ -14,12 +14,12 @@ # -import pkg_resources import warnings from trappy.bare_trace import BareTrace from trappy.compare_runs import summary_plots, compare_runs from trappy.ftrace import FTrace from trappy.systrace import SysTrace +from trappy.version import __version__ try: from trappy.plotter.LinePlot import LinePlot except ImportError as exc: @@ -71,8 +71,3 @@ def register_class(*args, **kwargs): __import__("trappy.{}".format(import_name)) del fname, import_name, extension - -try: - __version__ = pkg_resources.get_distribution("trappy").version -except pkg_resources.DistributionNotFound: - __version__ = "local" diff --git a/trappy/version.py b/trappy/version.py new file mode 100644 index 00000000..4b4c082f --- /dev/null +++ b/trappy/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__ = "5.5.0"