def main(): kwargs = dict( name='psutil', version=VERSION, description=__doc__.replace('\n', ' ').strip() if __doc__ else '', long_description=get_description(), keywords=[ 'ps', 'top', 'kill', 'free', 'lsof', 'netstat', 'nice', 'tty', 'ionice', 'uptime', 'taskmgr', 'process', 'df', 'iotop', 'iostat', 'ifconfig', 'taskset', 'who', 'pidof', 'pmap', 'smem', 'pstree', 'monitoring', 'ulimit', 'prlimit', 'smem', 'performance', 'metrics', 'agent', 'observability', ], author='Giampaolo Rodola', author_email='*****@*****.**', url='https://github.com/giampaolo/psutil', platforms='Platform Independent', license='BSD', packages=['psutil', 'psutil.tests'], ext_modules=extensions, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Environment :: Win32 (MS Windows)', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows :: Windows 10', 'Operating System :: Microsoft :: Windows :: Windows 7', 'Operating System :: Microsoft :: Windows :: Windows 8', 'Operating System :: Microsoft :: Windows :: Windows 8.1', 'Operating System :: Microsoft :: Windows :: Windows Server 2003', 'Operating System :: Microsoft :: Windows :: Windows Server 2008', 'Operating System :: Microsoft :: Windows :: Windows Vista', 'Operating System :: Microsoft', 'Operating System :: OS Independent', 'Operating System :: POSIX :: AIX', 'Operating System :: POSIX :: BSD :: FreeBSD', 'Operating System :: POSIX :: BSD :: NetBSD', 'Operating System :: POSIX :: BSD :: OpenBSD', 'Operating System :: POSIX :: BSD', 'Operating System :: POSIX :: Linux', 'Operating System :: POSIX :: SunOS/Solaris', 'Operating System :: POSIX', 'Programming Language :: C', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries', 'Topic :: System :: Benchmark', 'Topic :: System :: Hardware :: Hardware Drivers', 'Topic :: System :: Hardware', 'Topic :: System :: Monitoring', 'Topic :: System :: Networking :: Monitoring :: Hardware Watchdog', 'Topic :: System :: Networking :: Monitoring', 'Topic :: System :: Networking', 'Topic :: System :: Operating System', 'Topic :: System :: Systems Administration', 'Topic :: Utilities', ], ) if setuptools is not None: kwargs.update( python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", extras_require=extras_require, zip_safe=False, ) success = False try: setup(**kwargs) success = True finally: if not success and POSIX and not which('gcc'): py3 = "3" if PY3 else "" if LINUX: if which('dpkg'): missdeps("sudo apt-get install gcc python%s-dev" % py3) elif which('rpm'): missdeps("sudo yum install gcc python%s-devel" % py3) elif MACOS: print(hilite("XCode (https://developer.apple.com/xcode/) " "is not installed"), color="red", file=sys.stderr) elif FREEBSD: missdeps("pkg install gcc python%s" % py3) elif OPENBSD: missdeps("pkg_add -v gcc python%s" % py3) elif NETBSD: missdeps("pkgin install gcc python%s" % py3) elif SUNOS: missdeps("sudo ln -s /usr/bin/gcc /usr/local/bin/cc && " "pkg install gcc") elif not success and WINDOWS: if PY3: ur = "http://www.visualstudio.com/en-au/news/vs2015-preview-vs" else: ur = "http://www.microsoft.com/en-us/download/" ur += "details.aspx?id=44266" s = "VisualStudio is not installed; get it from %s" % ur print(hilite(s, color="red"), file=sys.stderr)
def missdeps(msg): s = hilite("C compiler or Python headers are not installed ", color="red") s += hilite("on this system. Try to run:\n", color="red") s += hilite(msg, color="red", bold=True) print(s, file=sys.stderr)