Commit ca3f8d0d authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Remove devflow form build dependency

parent 34db31da
......@@ -46,11 +46,11 @@ from astakos import get_version
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
update_version('astakos', 'version', HERE)
# try to update the version file
from synnefo.util import version
version.update_version('astakos', 'version', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from astakos.version import __version__
......
......@@ -44,11 +44,11 @@ from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
# try to update the version file
from synnefo.util.version import update_version
update_version('synnefo.versions', 'common', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from synnefo.versions.common import __version__
......
......@@ -82,7 +82,8 @@ def get_version_from_describe(describe):
version = version.lstrip('v')
return version
def update_version(module, name='version', root="."):
def update_version_old(module, name='version', root="."):
"""
Helper util to generate/replace a version.py file containing version
information retrieved from get_version_from_describe as a submodule of passed `module`
......@@ -106,3 +107,15 @@ __version_vcs_info__ = %(vcs_info)s
module_file.write(content)
module_file.close()
def update_version(module, name='version', root='.'):
try:
from devflow import versioning
return versioning.update_version(module, name, root)
except ImportError:
import sys
paths = [root] + module.split(".") + ["%s.py" % name]
module_filename = os.path.join(*paths)
sys.stdout.write("WARNING: Can not update version because `devflow` is"
" not installed. Please make sure to manually"
" update version file: '%s'\n" % module_filename)
......@@ -44,11 +44,11 @@ from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
# try to update the version file
from synnefo.util.version import update_version
update_version('synnefo.versions', 'app', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from synnefo.versions.app import __version__
......
......@@ -40,11 +40,11 @@ from setuptools import setup
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
# try to update the version file
from synnefo.util.version import update_version
update_version('synnefo.versions', 'ganeti', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from synnefo.versions.ganeti import __version__
......
......@@ -42,13 +42,12 @@ from fnmatch import fnmatchcase
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
update_version('pithos.api', 'version', HERE)
# try to update the version file
from synnefo.util import version
version.update_version('pithos.api', 'version', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from pithos.api.version import __version__
......
......@@ -42,13 +42,12 @@ from fnmatch import fnmatchcase
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
update_version('pithos.backends', 'version', HERE)
# try to update the version file
from synnefo.util import version
version.update_version('pithos.backends', 'version', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from pithos.backends.version import __version__
......
......@@ -44,13 +44,12 @@ from fnmatch import fnmatchcase
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
update_version('pithos.tools', 'version', HERE)
# try to update the version file
from synnefo.util import version
version.update_version('pithos.tools', 'version', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from pithos.tools.version import __version__
......
......@@ -44,11 +44,11 @@ from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
# try to update the version file
from synnefo.util.version import update_version
update_version('synnefo_tools', 'version', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from synnefo_tools.version import __version__
......
......@@ -44,11 +44,11 @@ from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
try:
# use devflow to update the version file
from devflow.versioning import update_version
# try to update the version file
from synnefo.util.version import update_version
update_version('synnefo.versions', 'webproject', HERE)
except ImportError:
raise RuntimeError("devflow is a build dependency")
pass
from synnefo.versions.webproject import __version__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment