Home » Java » java – What is wrong with my custom install script in Python setup.py?-Exceptionshub

java – What is wrong with my custom install script in Python setup.py?-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

Hi I am new to Python programming. I have written the following setup.py script to install the dependencies by customizing the install. But, the python packages are not installed in my virtual environment. Please help me.

from setuptools import setup, find_packages
from setuptools.command.install import install


class CustomInstallCommand(install):
    """Customized setuptools install command - prints a friendly greeting."""

    def run(self):
        print("I am trying to install ...")
        install.run(self)

# dependencies = ['configparser == 4.0.2', 'colorama == 0.4.3', 'xlsxwriter == 1.2.7']


setup(cmdclass={
        'install': CustomInstallCommand,
        },
    name='Testing',
      version='0.1',
      author='DD Mishra',
      description='PDE Integration testing',
      packages=find_packages(),
      install_requires=['configparser == 4.0.2', 'colorama == 0.4.3', 'xlsxwriter == 1.2.7']
      )

If I remove the following line from setup() function, it works fine.

cmdclass={
        'install': CustomInstallCommand,
        },

What may be the issue ? Please help me to resolve. I am trying to achieve maven or gradle type feature which we in Java, in Python.

How to&Answers: