'Bringing the output of shell and other std output to terminal

I am trying to install a python package using pip install . by entering into the directory.

setup.py

import subprocess
from setuptools import setup, Extension, find_packages

subprocess.call(['./script.sh'], shell=True)

print("Executed subprocess")
setup(
        name='Test Package',
        version='0.0.1',
        description='test',
        author='test user',
        author_email='[email protected]',
        url='https://test.com/test',
        packages=find_packages(),
        )

In the setup.py, a bash shell script 'script.sh' is executing

script.sh

echo "hello world"
echo "hi"

When I try to install the package, pip install . , installation is successful but I am not getting messages "hello world", "hi" and "Executed subprocess" in the terminal. How is it possible to bring the output to the terminal while I install the package.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source