<commit_before>#!/usr/bin/env python
#
# $Id$
#

import sys
import os
import shutil
from distutils.core import setup, Extension

# Hack for Python 3 to tell distutils to run 2to3 against the files
# copied in the build directory before installing.
# Reference: http://osdir.com/ml/python.python-3000.cvs/2008-03/msg00127.html
try:
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
    from distutils.command.build_py import build_py


# Windows
if sys.platform.lower().startswith("win"):

    def get_winver():
        maj,min = sys.getwindowsversion()[0:2]
        return '0x0%s' % ((maj * 100) + min)

    extensions = Extension('_psutil_mswindows',
                           sources=['psutil/_psutil_mswindows.c',
                                    'psutil/arch/mswindows/process_info.c',
                                    'psutil/arch/mswindows/security.c'],
                           define_macros=[('_WIN32_WINNT', get_winver()),
                                          ('_AVAIL_WINVER_', get_winver())],
                           libraries=["psapi", "kernel32", "advapi32", "shell32",
                                      "netapi32"]
                           )
# OS X
elif sys.platform.lower().startswith("darwin"):
    extensions = Extension('_psutil_osx',
                           sources = ['psutil/_psutil_osx.c',
                                      'psutil/arch/osx/process_info.c']
                           )
# FreeBSD
elif sys.platform.lower().startswith("freebsd"):
    extensions = Extension('_psutil_bsd',
                           sources = ['psutil/_psutil_bsd.c',
                                      'psutil/arch/bsd/process_info.c']
                           )
# Others
else:
    extensions = None


def main():
    setup_args = dict(
        name='psutil',
        version='0.1.3',
        description='A process utilities module for Python',
        long_description="""
psutil is a module providing convenience functions for managing processes in a
portable way by using Python.""",
        keywords=['psutil', 'ps', 'top', 'process', 'utility'],
        author='<NAME>, <NAME>, <NAME>',
        author_email='<EMAIL>',
        url='http://code.google.com/p/psutil/',
        platforms='Platform Independent',
        license='License :: OSI Approved :: BSD License',
        packages=['psutil'],
        cmdclass={'build_py':build_py},  # Python 3.X
        classifiers=[
              'Development Status :: 2 - Pre-Alpha',
              'Environment :: Console',
              'Operating System :: MacOS',
              'Operating System :: Microsoft :: Windows',
              'Operating System :: POSIX :: Linux',
              'Operating System :: OS Independent',
              'Programming Language :: Python',
              'Topic :: System :: Monitoring',
              'Topic :: System :: Systems Administration',
              'Topic :: Utilities',
              'Topic :: Software Development :: Libraries :: Python Modules',
              'Intended Audience :: Developers',
              'Intended Audience :: System Administrators',
              'License :: OSI Approved :: MIT License',
              ],
        )
    if extensions is not None:
        setup_args["ext_modules"] = [extensions]

    setup(**setup_args)

    # Manually copy wmi.py located deep down in the source tree and copy
    # it here to install it as a separate module.
    # This sucks, but apparently there's no way to tell distutils to
    # put wmi.py in Lib\site-packages directory unless we have it
    # in the same directory as setup.py.
    if sys.platform.lower().startswith("win"):
        shutil.copyfile('psutil/arch/mswindows/wmi.py', 'wmi.py')
        setup(name='wmi',
              version='1.4.6',
              description = "Windows Management Instrumentation",
              author = "<NAME>",
              author_email = "<EMAIL>",
              url = "http://timgolden.me.uk/python/wmi.html",
              license = "http://www.opensource.org/licenses/mit-license.php",
              cmdclass={'build_py':build_py},  # Python 3.X
              py_modules=['wmi'])
        os.remove('wmi.py')<commit_msg>Added more metadata classifiers including all versions of python supported by psutil including python 3. This should make some difference when searching python 3 modules through pypi.<commit_after>#!/usr/bin/env python
#
# $Id$
#

import sys
import os
import shutil
from distutils.core import setup, Extension

# Hack for Python 3 to tell distutils to run 2to3 against the files
# copied in the build directory before installing.
# Reference: http://osdir.com/ml/python.python-3000.cvs/2008-03/msg00127.html
try:
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
    from distutils.command.build_py import build_py


# Windows
if sys.platform.lower().startswith("win"):

    def get_winver():
        maj,min = sys.getwindowsversion()[0:2]
        return '0x0%s' % ((maj * 100) + min)

    extensions = Extension('_psutil_mswindows',
                           sources=['psutil/_psutil_mswindows.c',
                                    'psutil/arch/mswindows/process_info.c',
                                    'psutil/arch/mswindows/security.c'],
                           define_macros=[('_WIN32_WINNT', get_winver()),
                                          ('_AVAIL_WINVER_', get_winver())],
                           libraries=["psapi", "kernel32", "advapi32", "shell32",
                                      "netapi32"]
                           )
# OS X
elif sys.platform.lower().startswith("darwin"):
    extensions = Extension('_psutil_osx',
                           sources = ['psutil/_psutil_osx.c',
                                      'psutil/arch/osx/process_info.c']
                           )
# FreeBSD
elif sys.platform.lower().startswith("freebsd"):
    extensions = Extension('_psutil_bsd',
                           sources = ['psutil/_psutil_bsd.c',
                                      'psutil/arch/bsd/process_info.c']
                           )
# Others
else:
    extensions = None


def main():
    setup_args = dict(
        name='psutil',
        version='0.1.3',
        description='A process utilities module for Python',
        long_description="""
psutil is a module providing convenience functions for managing processes in a
portable way by using Python.""",
        keywords=['psutil', 'ps', 'top', 'process', 'utility'],
        author='<NAME>, <NAME>, <NAME>',
        author_email='<EMAIL>',
        url='http://code.google.com/p/psutil/',
        platforms='Platform Independent',
        license='License :: OSI Approved :: BSD License',
        packages=['psutil'],
        cmdclass={'build_py':build_py},  # Python 3.X
        classifiers=[
              'Development Status :: 2 - Pre-Alpha',
              'Environment :: Console',
              'Operating System :: MacOS',
              'Operating System :: Microsoft :: Windows',
              'Operating System :: POSIX :: Linux',
              'Operating System :: OS Independent',
              'Programming Language :: C',
              'Programming Language :: Python',
              'Programming Language :: Python :: 2',
              'Programming Language :: Python :: 2.4',
              'Programming Language :: Python :: 2.5',
              'Programming Language :: Python :: 2.6',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.0',
              'Programming Language :: Python :: 3.1',
              'Topic :: System :: Monitoring',
              'Topic :: System :: Systems Administration',
              'Topic :: Utilities',
              'Topic :: Software Development :: Libraries :: Python Modules',
              'Intended Audience :: Developers',
              'Intended Audience :: System Administrators',
              'License :: OSI Approved :: MIT License',
              ],
        )
    if extensions is not None:
        setup_args["ext_modules"] = [extensions]

    setup(**setup_args)

    # Manually copy wmi.py located deep down in the source tree and copy
    # it here to install it as a separate module.
    # This sucks, but apparently there's no way to tell distutils to
    # put wmi.py in Lib\site-packages directory unless we have it
    # in the same directory as setup.py.
    if sys.platform.lower().startswith("win"):
        shutil.copyfile('psutil/arch/mswindows/wmi.py', 'wmi.py')
        setup(name='wmi',
              version='1.4.6',
              description = "Windows Management Instrumentation",
              author = "<NAME>",
              author_email = "<EMAIL>",
              url = "http://timgolden.me.uk/python/wmi.html",
              license = "http://www.opensource.org/licenses/mit-license.php",
              cmdclass={'build_py':build_py},  # Python 3.X
              py_modules=['wmi'])
        os.remove('wmi.py')
{'fraction_non_alphanumeric': 0.12147143809735497, 'fraction_numerical': 0.011780395643476329, 'mean_word_length': 1.923651721897336, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4948496', 'n_tokens_mistral': 2487, 'n_tokens_neox': 2393, 'n_words': 610}