1 # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
20 from distutils.command.install_data import install_data
21 from setuptools.command.build_py import build_py
22 from setuptools.command.install import install
24 # In python < 2.7.4, a lazy loading of package `pbr` will break
25 # setuptools if some other modules registered functions in `atexit`.
26 # solution from: http://bugs.python.org/issue15881#msg170215
28 import multiprocessing # noqa
33 class HeatTranslator_build_py(build_py):
34 """Override build_py to call customized build."""
37 print(" === Before nfv heat translator build === ")
38 # self.run_command('xxx')
39 super(HeatTranslator_build_py, self).run()
40 print(" === After nfv heat heat translator build === ")
43 class HeatTranslator_install(install):
44 """Override install to call customized install."""
47 print(" === Before nfv heat translator install === ")
48 # Make sure uninstall toscaparser from openstack
49 os.system("pip uninstall -y heat-translator")
51 super(HeatTranslator_install, self).run(self)
53 # distutils.command.install actually has some nice helper methods
54 # and interfaces. I strongly suggest reading the docstrings.
55 print(" === After nfv heat translator install === ")
58 class HeatTranslator_post_install(install_data):
59 """Override install_data to call customized install_data."""
62 print(" === Before nfv heat translator post install data === ")
64 super(HeatTranslator_post_install, self).run(self)
66 print(" === After nfv heat translator post install data ===")
70 setup_requires=['pbr>=2.0.0'],
72 "build_py": HeatTranslator_build_py,
73 "install_data": HeatTranslator_install,
74 "post_install": HeatTranslator_post_install,