Changeset 9588


Ignore:
Timestamp:
Feb 2, 2015, 4:53:54 PM (9 years ago)
Author:
steve
Message:

Trying to get svn revisions to work with versioning

Location:
trunk/anuga_core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/anuga/__init__.py

    r9587 r9588  
    2828from .version import git_revision as __git_revision__
    2929from .version import version as __version__
    30 __svn_version__ = filter(str.isdigit, "$Revision$")
     30
     31
    3132
    3233
  • trunk/anuga_core/setup.cfg

    r9582 r9588  
    11
    22[pytest]
    3 addopts = --ignore=anuga/test_all.py
     3addopts = --ignore=test_all.py
    44        --ignore=build
    55        --ignore=setup.py
    6         --ignore=anuga/build
    7         --ignore=anuga/parallel
     6        --ignore=anuga
     7        --ignore=demos
     8        --ignore=tools
     9        --ignore=validation_tests
     10        --ignore=user_manual
    811        --cov-report term --cov .
  • trunk/anuga_core/setup.py

    r9582 r9588  
    3030    raise RuntimeError("Python version 2.6, 2.7. ")
    3131
    32 if sys.version_info[0] >= 3:
    33     import builtins
    34 else:
    35     import __builtin__ as builtins
     32# if sys.version_info[0] >= 3:
     33#     import builtins
     34# else:
     35#     import __builtin__ as builtins
     36import __builtin__ as builtins
    3637
    3738
     
    5859
    5960
     61# Return the svn revision as a string
     62def svn_revision():
     63
     64    return filter(str.isdigit, "$Revision: 9587 $")
     65
     66
     67
     68
    6069# Return the git revision as a string
    61 def git_version():
     70def git_revision():
    6271
    6372    #return "Unknown"
     
    100109    # otherwise the import of anuga.version messes up the build under Python 3.
    101110    FULLVERSION = VERSION
     111    SVN_REVISION = svn_revision()
     112   
    102113    if os.path.exists('.git'):
    103         GIT_REVISION = git_version()
     114        GIT_REVISION = git_revision()
    104115    elif os.path.exists('anuga/version.py'):
    105116        # must be a source distribution, use existing version file
     
    114125
    115126    if not ISRELEASED:
    116         FULLVERSION += '.dev+' + GIT_REVISION[:7]
    117 
    118     return FULLVERSION, GIT_REVISION
     127        FULLVERSION += '.dev+' + SVN_REVISION
     128        #FULLVERSION += '.dev+' + GIT_REVISION[:7]
     129         
     130
     131    return FULLVERSION, GIT_REVISION, SVN_REVISION
    119132
    120133
     
    126139full_version = '%(full_version)s'
    127140git_revision = '%(git_revision)s'
     141svn_revision = '%(svn_revision)s'
    128142release = %(isrelease)s
    129143
     
    131145    version = full_version
    132146"""
    133     FULLVERSION, GIT_REVISION = get_version_info()
     147    FULLVERSION, GIT_REVISION, SVN_REVISION = get_version_info()
    134148
    135149    a = open(filename, 'w')
     
    138152                       'full_version' : FULLVERSION,
    139153                       'git_revision' : GIT_REVISION,
     154                       'svn_revision' : SVN_REVISION,
    140155                       'isrelease': str(ISRELEASED)})
    141156    finally:
Note: See TracChangeset for help on using the changeset viewer.