Revision 473e2b08

b/snf-astakos-app/setup.py
46 46

  
47 47
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
48 48
try:
49
    # use devflow to update the version file
50
    from devflow.versioning import update_version
51
    update_version('astakos', 'version', HERE)
49
    # try to update the version file
50
    from synnefo.util import version
51
    version.update_version('astakos', 'version', HERE)
52 52
except ImportError:
53
    raise RuntimeError("devflow is a build dependency")
53
    pass
54 54

  
55 55
from astakos.version import __version__
56 56

  
b/snf-common/setup.py
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45 45

  
46 46
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
47
    # try to update the version file
48
    from synnefo.util.version import update_version
49 49
    update_version('synnefo.versions', 'common', HERE)
50 50
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
51
    pass
52 52

  
53 53
from synnefo.versions.common import __version__
54 54

  
b/snf-common/synnefo/util/version.py
82 82
    version = version.lstrip('v')
83 83
    return version
84 84

  
85
def update_version(module, name='version', root="."):
85

  
86
def update_version_old(module, name='version', root="."):
86 87
    """
87 88
    Helper util to generate/replace a version.py file containing version
88 89
    information retrieved from get_version_from_describe as a submodule of passed `module`
......
106 107
    module_file.write(content)
107 108
    module_file.close()
108 109

  
110

  
111
def update_version(module, name='version', root='.'):
112
    try:
113
        from devflow import versioning
114
        return versioning.update_version(module, name, root)
115
    except ImportError:
116
        import sys
117
        paths = [root] + module.split(".") + ["%s.py" % name]
118
        module_filename = os.path.join(*paths)
119
        sys.stdout.write("WARNING: Can not update version because `devflow` is"
120
                         " not installed. Please make sure to manually"
121
                         " update version file: '%s'\n" % module_filename)
b/snf-cyclades-app/setup.py
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45 45

  
46 46
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
47
    # try to update the version file
48
    from synnefo.util.version import update_version
49 49
    update_version('synnefo.versions', 'app', HERE)
50 50
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
51
    pass
52 52

  
53 53
from synnefo.versions.app import __version__
54 54

  
b/snf-cyclades-gtools/setup.py
40 40
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
41 41

  
42 42
try:
43
    # use devflow to update the version file
44
    from devflow.versioning import update_version
43
    # try to update the version file
44
    from synnefo.util.version import update_version
45 45
    update_version('synnefo.versions', 'ganeti', HERE)
46 46
except ImportError:
47
    raise RuntimeError("devflow is a build dependency")
47
    pass
48 48

  
49 49
from synnefo.versions.ganeti import __version__
50 50

  
b/snf-pithos-app/setup.py
42 42
from setuptools import setup, find_packages
43 43

  
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45

  
46 45
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
49
    update_version('pithos.api', 'version', HERE)
46
    # try to update the version file
47
    from synnefo.util import version
48
    version.update_version('pithos.api', 'version', HERE)
50 49
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
50
    pass
52 51

  
53 52
from pithos.api.version import __version__
54 53

  
b/snf-pithos-backend/setup.py
42 42
from setuptools import setup, find_packages
43 43

  
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45

  
46 45
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
49
    update_version('pithos.backends', 'version', HERE)
46
    # try to update the version file
47
    from synnefo.util import version
48
    version.update_version('pithos.backends', 'version', HERE)
50 49
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
50
    pass
52 51

  
53 52
from pithos.backends.version import __version__
54 53

  
b/snf-pithos-tools/setup.py
44 44
from setuptools import setup, find_packages
45 45

  
46 46
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
47

  
48 47
try:
49
    # use devflow to update the version file
50
    from devflow.versioning import update_version
51
    update_version('pithos.tools', 'version', HERE)
48
    # try to update the version file
49
    from synnefo.util import version
50
    version.update_version('pithos.tools', 'version', HERE)
52 51
except ImportError:
53
    raise RuntimeError("devflow is a build dependency")
52
    pass
54 53

  
55 54
from pithos.tools.version import __version__
56 55

  
b/snf-tools/setup.py
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45 45

  
46 46
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
47
    # try to update the version file
48
    from synnefo.util.version import update_version
49 49
    update_version('synnefo_tools', 'version', HERE)
50 50
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
51
    pass
52 52

  
53 53
from synnefo_tools.version import __version__
54 54

  
b/snf-webproject/setup.py
44 44
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
45 45

  
46 46
try:
47
    # use devflow to update the version file
48
    from devflow.versioning import update_version
47
    # try to update the version file
48
    from synnefo.util.version import update_version
49 49
    update_version('synnefo.versions', 'webproject', HERE)
50 50
except ImportError:
51
    raise RuntimeError("devflow is a build dependency")
51
    pass
52 52

  
53 53
from synnefo.versions.webproject import __version__
54 54

  

Also available in: Unified diff