source: pyomo/trunk/pyomo/version/__init__.py @ 9478

Last change on this file since 9478 was 9478, checked in by wehart, 4 years ago

Changes to improve coverage

  • Property svn:keywords set to URL
File size: 1.9 KB
Line 
1#  _________________________________________________________________________
2#
3#  Pyomo: Python Optimization Modeling Objects
4#  Copyright (c) 2008 Sandia Corporation.
5#  This software is distributed under the BSD License.
6#  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7#  the U.S. Government retains certain rights in this software.
8#  For more information, see the Pyomo README.txt file.
9#  _________________________________________________________________________
10
11"""Pyomo: Python Optimization Modeling Objects
12
13Pyomo provides Python packages for formulating and solving complex
14optimization applications.  Most of Pyomo's packages rely on externally
15built optimization solvers.
16
17The pyomo.pyomo package provides a mechanism for managing stuff
18that is related to releases of the entire Pyomo software.
19"""
20
21_init_url="$URL: pyomo/trunk/pyomo/version/__init__.py $"
22
23# The micro number should be set when tagging a release or generating a
24# VOTD build
25_major=4
26_minor=0
27_micro=0
28_releaselevel='invalid'
29_serial=0
30
31if '/trunk/' in _init_url:
32    # __file__ fails if script is called in different ways on Windows
33    # __file__ fails if someone does os.chdir() before
34    # sys.argv[0] also fails because it doesn't not always contains the path
35    from os.path import abspath, dirname, exists, join
36    from inspect import getfile, currentframe
37    if exists(join( dirname( abspath( getfile( currentframe() ) ) ), '..', '..', '.svn' )):
38        _releaselevel = 'trunk'             #pragma:nocover
39    else:
40        _releaselevel = 'VOTD'              #pragma:nocover
41elif '/tags/' in _init_url:                 #pragma:nocover
42    _releaselevel = 'final'
43
44version_info = (_major, _minor, _micro, _releaselevel, _serial)
45
46if _micro:
47    version = '.'.join(str(x) for x in version_info[:3])        #pragma:nocover
48else:
49    version = '.'.join(str(x) for x in version_info[:2])        #pragma:nocover
50if _releaselevel != 'final':
51    version += ' ('+_releaselevel+')'
Note: See TracBrowser for help on using the repository browser.