From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 529ED11D4 for ; Tue, 29 Aug 2017 17:09:11 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 08:09:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,445,1498546800"; d="scan'208";a="1008873067" Received: from dpdk-test38.sh.intel.com ([10.67.111.97]) by orsmga003.jf.intel.com with ESMTP; 29 Aug 2017 08:09:09 -0700 From: Marvin Liu To: dts@dpdk.org Cc: Marvin Liu Date: Tue, 29 Aug 2017 11:06:51 -0400 Message-Id: <1504019211-58188-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH] dts: add version file and enable it in doc conf.py X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2017 15:09:11 -0000 When Sphinx building doc, version of DTS can be stripped from source code and inserted to html header. Signed-off-by: Marvin Liu diff --git a/doc/dts_gsg/conf.py b/doc/dts_gsg/conf.py index 568150e..fa5f0e4 100644 --- a/doc/dts_gsg/conf.py +++ b/doc/dts_gsg/conf.py @@ -27,6 +27,7 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import subprocess try: import sphinx_rtd_theme @@ -38,4 +39,10 @@ except: project = 'DPDK Test Suite' copyright = '2017, dpdk.org' + +strip_version_cmd = 'import sys;sys.path.append(\'../..\');import version; print version.dts_version()' +version = subprocess.check_output(['python', '-c', strip_version_cmd]) +version = version.decode('utf-8').rstrip() +release = version + master_doc = 'index' diff --git a/version.py b/version.py new file mode 100755 index 0000000..f657133 --- /dev/null +++ b/version.py @@ -0,0 +1,19 @@ +# + +VERSION_MAJOR = "17" +VERSION_MINOR = "08" +VERSION_PATCH = "0" +VERSION_EXTRA = "" + +__version__ = '%s.%s.%s' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH) + +if VERSION_EXTRA: + __version__ = "%s-%s" % (__version__, VERSION_EXTRA) + +def dts_version(): + """ + Return the version of dts package + """ + return __version__ + +__all__ = ['dts_version', '__version__'] -- 1.9.3