diff options
Diffstat (limited to 'tosca2heat/heat-translator')
-rw-r--r-- | tosca2heat/heat-translator/requirements.txt | 3 | ||||
-rw-r--r-- | tosca2heat/heat-translator/setup.cfg | 2 | ||||
-rw-r--r-- | tosca2heat/heat-translator/setup.py | 47 | ||||
-rw-r--r-- | tosca2heat/heat-translator/tox.ini | 2 |
4 files changed, 51 insertions, 3 deletions
diff --git a/tosca2heat/heat-translator/requirements.txt b/tosca2heat/heat-translator/requirements.txt index 2de8022..b147d83 100644 --- a/tosca2heat/heat-translator/requirements.txt +++ b/tosca2heat/heat-translator/requirements.txt @@ -7,7 +7,8 @@ cliff>=2.6.0 # Apache-2.0 PyYAML>=3.10.0 # MIT python-dateutil>=2.4.2 # BSD six>=1.9.0 # MIT -tosca-parser>=0.8.1 # Apache-2.0 +#tosca-parser>=0.8.1 # Apache-2.0 +nfv-toscaparser>=0.5.0 keystoneauth1>=2.21.0 # Apache-2.0 python-novaclient>=9.0.0 # Apache-2.0 python-heatclient>=1.6.1 # Apache-2.0 diff --git a/tosca2heat/heat-translator/setup.cfg b/tosca2heat/heat-translator/setup.cfg index 863b97d..2a10811 100644 --- a/tosca2heat/heat-translator/setup.cfg +++ b/tosca2heat/heat-translator/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = heat-translator +name = nfv-heattranslator version = url = https://wiki.opnfv.org/display/parser summary = Tool to translate non-heat templates to Heat Orchestration Template in nfv. diff --git a/tosca2heat/heat-translator/setup.py b/tosca2heat/heat-translator/setup.py index 566d844..bf9aa00 100644 --- a/tosca2heat/heat-translator/setup.py +++ b/tosca2heat/heat-translator/setup.py @@ -14,8 +14,13 @@ # limitations under the License. # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import os import setuptools +from distutils.command.install_data import install_data +from setuptools.command.build_py import build_py +from setuptools.command.install import install + # In python < 2.7.4, a lazy loading of package `pbr` will break # setuptools if some other modules registered functions in `atexit`. # solution from: http://bugs.python.org/issue15881#msg170215 @@ -24,6 +29,48 @@ try: except ImportError: pass + +class HeatTranslator_build_py(build_py): + """Override build_py to call customized build.""" + + def run(self): + print(" === Before nfv heat translator build === ") + # self.run_command('xxx') + super(HeatTranslator_build_py, self).run() + print(" === After nfv heat heat translator build === ") + + +class HeatTranslator_install(install): + """Override install to call customized install.""" + + def run(self): + print(" === Before nfv heat translator install === ") + # Make sure uninstall toscaparser from openstack + os.system("pip uninstall -y heat-translator") + + super(HeatTranslator_install, self).run(self) + # Custom stuff here + # distutils.command.install actually has some nice helper methods + # and interfaces. I strongly suggest reading the docstrings. + print(" === After nfv heat translator install === ") + + +class HeatTranslator_post_install(install_data): + """Override install_data to call customized install_data.""" + + def run(self): + print(" === Before nfv heat translator post install data === ") + # Call parent + super(HeatTranslator_post_install, self).run(self) + # Execute commands + print(" === After nfv heat translator post install data ===") + + setuptools.setup( setup_requires=['pbr>=2.0.0'], + cmdclass={ + "build_py": HeatTranslator_build_py, + "install_data": HeatTranslator_install, + "post_install": HeatTranslator_post_install, + }, pbr=True) diff --git a/tosca2heat/heat-translator/tox.ini b/tosca2heat/heat-translator/tox.ini index b1299bf..6ba58c3 100644 --- a/tosca2heat/heat-translator/tox.ini +++ b/tosca2heat/heat-translator/tox.ini @@ -5,7 +5,7 @@ skipsdist = True [testenv] usedevelop = True -install_command = pip install -U {opts} {packages} +install_command = pip install --pre -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt |