def main():
    parser = ArgumentParser(description='Utility to read setup.py values from cmake macros. Creates a file with CMake set commands setting variables.')
    parser.add_argument('package_name', help='Name of catkin package')
    parser.add_argument('setupfile_path', help='Full path to setup.py')
    parser.add_argument('outfile', help='Where to write result to')

    args = parser.parse_args()

    # print("%s" % sys.argv)
    # PACKAGE_NAME = sys.argv[1]
    # OUTFILE = sys.argv[3]
    # print("Interrogating setup.py for package %s into %s " % (PACKAGE_NAME, OUTFILE),
    #      file=sys.stderr)

    # print("executing %s" % args.setupfile_path)

    # be sure you're in the directory containing
    # setup.py so the sys.path manipulation works,
    # so the import of __version__ works
    os.chdir(os.path.dirname(os.path.abspath(args.setupfile_path)))

    # patch setup() function of distutils and setuptools for the
    # context of evaluating setup.py
    try:
        fake_setup = _create_mock_setup_function(package_name=args.package_name,
                                                outfile=args.outfile)

        distutils_backup = distutils.core.setup
        distutils.core.setup = fake_setup
        try:
            setuptools_backup = setuptools.setup
            setuptools.setup = fake_setup
        except NameError:
            pass

        with open(args.setupfile_path, 'r') as fh:
            local_vars = {
                '__doc__': None,
                '__file__': os.path.abspath(args.setupfile_path),
                '__name__': '__main__',
                '__package__': None,
            }
            exec(fh.read(), {}, local_vars)
    finally:
        distutils.core.setup = distutils_backup
        try:
            setuptools.setup = setuptools_backup
        except NameError:
            pass
Script main, parses arguments and invokes Dummy.setup indirectly.
dataset/ETHPy150Open ros/catkin/cmake/interrogate_setup_dot_py.py/main