Issue creating wheel while running setup.py

22 views Asked by At

In my setup.py ,where I have a post install condition , saying copy some files to destination after installing the package kick While I am trying to run pip install -U --upgrade-strategy only-if-needed kick the wheel creation failed , but the package gets downloaded using setup.py . I want to know what I am doing wrong here or any other thoughts

it gives below o/p

     running install_scripts
      3.11.5 (main, Oct 25 2023, 16:19:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)]
      error: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/kick/selenium/selenium_caasng_docker.py'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for kick
  Running setup.py clean for kick

My setup.py looks below

import shutil
import sys
import os
from distutils.core import setup
from setuptools import find_packages
from setuptools.command.install import install
class PostInstall(install):
    def run(self):
        print('caasng container')
        install.run(self)
        if  (os.environ.get('CAASNG_ENV')):
            if sys.version_info[1]<11:
                shutil.copyfile('/usr/local/lib/python3.6/site-packages/kick/selenium/selenium_caasng_docker.py','/usr/local/lib/python3.6/site-packages/kick/selenium/selenium_docker.py')
                shutil.copyfile('/usr/local/lib/python3.6/site-packages/kick/monitor/kick_caasng_monitor.py','/usr/local/lib/python3.6/site-packages/kick/monitor/kick_monitor.py')
            elif sys.version_info[1] == 11:
                print(sys.version)
                shutil.copyfile('/usr/local/lib/python3.11/site-packages/kick/selenium/selenium_caasng_docker.py','/usr/local/lib/python3.11/site-packages/kick/selenium/selenium_docker.py')
                shutil.copyfile('/usr/local/lib/python3.11/site-packages/kick/monitor/kick_caasng_monitor.py','/usr/local/lib/python3.11/site-packages/kick/monitor/kick_monitor.py')
            else:
                version=('python'+(str(sys.version_info.major)+"."+str(sys.version_info.minor)))
                sel_src='/usr/local/lib/{}/site-packages/kick/selenium/selenium_caasng_docker.py'.format(version)
                sel_desc='/usr/local/lib/{}/site-packages/kick/selenium/selenium_docker.py'.format(version)
                shutil.copyfile(sel_src,sel_desc)
                monitor_src='/usr/local/lib/{}/site-packages/kick/monitor/kick_caasng_monitor.py'.format(version)
                monitor_desc='/usr/local/lib/{}/site-packages/kick/monitor/kick_monitor.py'.format(version)
                shutil.copyfile(monitor_src,monitor_desc)


setup(name='kick',
      version='TAG',
      packages=find_packages(),
      install_requires = ['pexpect', 'docker-py', 'pyVim', 'graphyte==1.1',
                          'pyVmomi', 'paramiko', 'unicon', 'boto3',
                          'pymongo', 'munch', 'pika', 'beautifulsoup4',
                          'Fabric3', 'netaddr', 'ldap3', 'kick-external'],
      include_package_data=True,
      cmdclass = {
          'install' : PostInstall,
      },
      )

0

There are 0 answers