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
30 import multiprocessing # noqa
35 class Toscaparser_build_py(build_py):
36 """Override build_py to call customized build."""
39 print(" === Before nfv toscaparser build === ")
40 # self.run_command('xxx')
41 super(Toscaparser_build_py, self).run()
42 print(" === After nfv toscaparser build === ")
45 class Toscaparser_install(install):
46 """Override install to call customized install."""
49 print(" === Before nfv toscaparser install === ")
50 # Make sure uninstall toscaparser from openstack
51 os.system("pip uninstall -y tosca-parser")
53 super(Toscaparser_install, self).run(self)
55 # distutils.command.install actually has some nice helper methods
56 # and interfaces. I strongly suggest reading the docstrings.
57 print(" === After nfv toscaparser install === ")
60 class Toscaparser_post_install(install_data):
61 """Override install_data to call customized install_data."""
64 print(" === Before nfv toscaparser post install data === ")
66 super(Toscaparser_post_install, self).run(self)
68 print(" === After nfv toscaparser post install data ===")
72 setup_requires=['pbr>=2.0.0'],
74 "build_py": Toscaparser_build_py,
75 "install_data": Toscaparser_install,
76 "post_install": Toscaparser_post_install,