X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FIM.git;a=blobdiff_plain;f=setup.py;h=ec75988921c242aaa2817e9695f81c101814c963;hp=71c7eaefbbdd4509492bcff11a21ef93210b32d6;hb=HEAD;hpb=5b3f4b6983b2957df33e5995ce32f3351a089290;ds=sidebyside diff --git a/setup.py b/setup.py index 71c7eae..4cd2be2 100644 --- a/setup.py +++ b/setup.py @@ -30,16 +30,28 @@ class Install_osm_im(install): subprocess.call([sys.executable, "-m", "pip", "install", package]) def run(self): - self.pipinstall('pyang') - self.pipinstall('pyangbind') + self.pipinstall('pyang==2.5.3') + self.pipinstall('pyangbind==0.8.3.post1') import pyangbind print("Using dir {}/{} for python artifacts".format(os.getcwd(), self.im_dir)) path = "{}/{}".format(os.getcwd(), self.im_dir) + protoc_command = ["make", "models"] if subprocess.call(protoc_command) != 0: sys.exit(-1) + # To ensure generated files are copied to the python installation folder - self.copy_tree(self.im_dir, "{}{}".format(self.install_lib, self.im_dir)) + install_path = "{}{}".format(self.install_lib, self.im_dir) + self.copy_tree(self.im_dir, install_path) + if os.path.isfile("{}/etsi-nfv-nsd.py".format(install_path)): + self.move_file( + "{}/etsi-nfv-nsd.py".format(install_path), "{}/etsi_nfv_nsd.py".format(install_path) + ) + if os.path.isfile("{}/etsi-nfv-vnfd.py".format(install_path)): + self.move_file( + "{}/etsi-nfv-vnfd.py".format(install_path), "{}/etsi_nfv_vnfd.py".format(install_path) + ) + install.run(self)