diff options
-rw-r--r-- | setup.py | 72 |
1 files changed, 32 insertions, 40 deletions
@@ -7,44 +7,36 @@ from distutils.core import setup, Extension # Windows if sys.platform.lower().startswith("win"): - module = Extension('_psutil_mswindows', - sources=['psutil/_psutil_mswindows.c'], - define_macros=[('_WIN32_WINNT', '0x0500')], - libraries=["psapi", "kernel32", "advapi32", "shell32"]) - - setup(name='PsutilMswindows', - version='0.1.0', - description='Windows implementation', - ext_modules=[module] - ) - - + extensions = Extension('_psutil_mswindows', + sources=['psutil/_psutil_mswindows.c'], + define_macros=[('_WIN32_WINNT', '0x0500')], + libraries=["psapi", "kernel32", "advapi32", "shell32"] + ) # OS X -if sys.platform.lower().startswith("darwin"): - module = Extension('_psutil_osx', - sources = ['psutil/_psutil_osx.c'],) - - setup(name='PsutilOSX', - version='1.0', - description='OS X implementation', - ext_modules=[module] - ) - -if sys.platform.lower().startswith("linux"): - # build Linux module, no compilation needed here - setup(name='psutil', - version='1.0', - description='Linux implementation', - packages=['psutil'] - ) - - -setup(name='psutil', - version='1.0', - description='Python Process Management Library', - author='Giampaolo Rodola, Dave Daeschler, Jay Loden', - author_email='psutil-dev@googlegroups.com', - url='http://code.google.com/p/psutil/', - license='License :: OSI Approved :: BSD License', - packages=['psutil'], - ) +elif sys.platform.lower().startswith("darwin"): + extensions = Extension('_psutil_osx', + sources = ['psutil/_psutil_osx.c'] + ) +# Others +else: + extensions = None + + +def main(): + setup_args = dict( + name='psutil', + version='0.1.0', + description='Python Process Management Library', + author='Giampaolo Rodola, Dave Daeschler, Jay Loden', + author_email='psutil-dev@googlegroups.com', + url='http://code.google.com/p/psutil/', + license='License :: OSI Approved :: BSD License', + packages=['psutil'], + ) + if extensions is not None: + setup_args["ext_modules"] = [extensions] + setup(**setup_args) + + +if __name__ == '__main__': + main() |