<commit_before>#!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.

NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays.  NumPy is built on the Numeric code base and adds features
introduced by numarray as well as an extended C-API and the ability to
create arrays of arbitrary type which also makes NumPy suitable for
interfacing with general-purpose data-base applications.

There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.
"""

DOCLINES = __doc__.split("\n")

import __builtin__
import os
import sys
import re

CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved
Programming Language :: C
Programming Language :: Python
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

NAME                = 'numpy'
MAINTAINER          = "NumPy Developers"
MAINTAINER_EMAIL    = "numpy-discussion@scipy.org"
DESCRIPTION         = DOCLINES[0]
LONG_DESCRIPTION    = "\n".join(DOCLINES[2:])
URL                 = "http://numpy.scipy.org"
DOWNLOAD_URL        = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103"
LICENSE             = 'BSD'
CLASSIFIERS         = filter(None, CLASSIFIERS.split('\n'))
AUTHOR              = "Travis E. Oliphant, et.al."
AUTHOR_EMAIL        = "oliphant@enthought.com"
PLATFORMS           = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"]
MAJOR               = 1
MINOR               = 4
MICRO               = 0
ISRELEASED          = False
VERSION             = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

# Return the svn version as a string (copied from setuptools)
def svn_revision():
    from numpy.distutils import log
    revision = 0
    urlre = re.compile('url="([^"]+)"')
    revre = re.compile('committed-rev="(\d+)"')

    for base,dirs,files in os.walk(os.curdir):
        if '.svn' not in dirs:
            dirs[:] = []
            continue    # no sense walking uncontrolled subdirs
        dirs.remove('.svn')
        f = open(os.path.join(base,'.svn','entries'))
        data = f.read()
        f.close()

        if data.startswith('9') or data.startswith('8'):
            data = map(str.splitlines,data.split('\n\x0c\n'))
            del data[0][0]  # get rid of the '8' or '9'
            dirurl = data[0][3]
            localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
        elif data.startswith('<?xml'):
            dirurl = urlre.search(data).group(1)    # get repository URL
            localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0])
        else:
            log.warn("unrecognized .svn/entries format; skipping %s", base)
            dirs[:] = []
            continue
        if base==os.curdir:
            base_url = dirurl+'/'   # save the root url
        elif not dirurl.startswith(base_url):
            dirs[:] = []
            continue    # not part of the same svn tree, skip it
        revision = max(revision, localrev)

    return str(revision)

# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')

# This is a bit hackish: we are setting a global variable so that the main
# numpy __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet.  While ugly, it's
# a lot more robust than what was previously being used.
__builtin__.__NUMPY_SETUP__ = True

FULLVERSION = VERSION
if not ISRELEASED:
    FULLVERSION += '.dev'
    # If in git or something, bypass the svn rev
    if os.path.exists('.svn'):
        FULLVERSION += svn_revision()

def write_version_py(filename='numpy/version.py'):
    cnt = """
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
short_version='%(version)s'
version='%(version)s'
release=%(isrelease)s

if not release:
    version += '.dev'
    import os
    svn_version_file = os.path.join(os.path.dirname(__file__),
                                   'core','__svn_version__.py')
    if os.path.isfile(svn_version_file):
        import imp
        svn = imp.load_module('numpy.core.__svn_version__',
                              open(svn_version_file),
                              svn_version_file,
                              ('.py','U',1))
        version += svn.version
"""
    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
    finally:
        a.close()

def configuration(parent_package='',top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration(None, parent_package, top_path)
    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True)

    config.add_subpackage('numpy')

    config.add_data_files(('numpy','*.txt'),
                          ('numpy','COMPATIBILITY'),
                          ('numpy','site.cfg.example'))

    config.get_version('numpy/version.py') # sets config.version

    return config

def setup_package():

    from numpy.distutils.core import setup

    old_path = os.getcwd()
    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
    os.chdir(local_path)
    sys.path.insert(0,local_path)

    # Rewrite the version file everytime
    if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
    write_version_py()

    try:
        setup(
            name=NAME,
            maintainer=MAINTAINER,
            maintainer_email=MAINTAINER_EMAIL,
            description=DESCRIPTION,
            long_description=LONG_DESCRIPTION,
            url=URL,
            download_url=DOWNLOAD_URL,
            license=LICENSE,
            classifiers=CLASSIFIERS,
            author=AUTHOR,
            author_email=AUTHOR_EMAIL,
            platforms=PLATFORMS,
            configuration=configuration )
    finally:
        del sys.path[0]
        os.chdir(old_path)
    return

if __name__ == '__main__':
    setup_package()
<commit_msg>Revert using setuptools svn revision, it is broken.<commit_after>#!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.

NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays.  NumPy is built on the Numeric code base and adds features
introduced by numarray as well as an extended C-API and the ability to
create arrays of arbitrary type which also makes NumPy suitable for
interfacing with general-purpose data-base applications.

There are also basic facilities for discrete fourier transform,
basic linear algebra and random number generation.
"""

DOCLINES = __doc__.split("\n")

import __builtin__
import os
import sys
import re
import subprocess

CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved
Programming Language :: C
Programming Language :: Python
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

NAME                = 'numpy'
MAINTAINER          = "NumPy Developers"
MAINTAINER_EMAIL    = "numpy-discussion@scipy.org"
DESCRIPTION         = DOCLINES[0]
LONG_DESCRIPTION    = "\n".join(DOCLINES[2:])
URL                 = "http://numpy.scipy.org"
DOWNLOAD_URL        = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103"
LICENSE             = 'BSD'
CLASSIFIERS         = filter(None, CLASSIFIERS.split('\n'))
AUTHOR              = "Travis E. Oliphant, et.al."
AUTHOR_EMAIL        = "oliphant@enthought.com"
PLATFORMS           = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"]
MAJOR               = 1
MINOR               = 4
MICRO               = 0
ISRELEASED          = False
VERSION             = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

# Return the svn version as a string, raise a ValueError otherwise
def svn_version():
    try:
        out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
    except OSError:
        print " --- Could not run svn info --- "
        return ""

    r = re.compile('Revision: ([0-9]+)')
    svnver = None
    for line in out.split('\n'):
        m = r.match(line)
        if m:
            svnver = m.group(1)

    if not svnver:
        raise ValueError("Error while parsing svn version ?")
    return svnver

# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')

# This is a bit hackish: we are setting a global variable so that the main
# numpy __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet.  While ugly, it's
# a lot more robust than what was previously being used.
__builtin__.__NUMPY_SETUP__ = True

FULLVERSION = VERSION
if not ISRELEASED:
    FULLVERSION += '.dev'
    # If in git or something, bypass the svn rev
    if os.path.exists('.svn'):
        FULLVERSION += svn_version()

def write_version_py(filename='numpy/version.py'):
    cnt = """
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
short_version='%(version)s'
version='%(version)s'
release=%(isrelease)s

if not release:
    version += '.dev'
    import os
    svn_version_file = os.path.join(os.path.dirname(__file__),
                                   'core','__svn_version__.py')
    if os.path.isfile(svn_version_file):
        import imp
        svn = imp.load_module('numpy.core.__svn_version__',
                              open(svn_version_file),
                              svn_version_file,
                              ('.py','U',1))
        version += svn.version
"""
    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
    finally:
        a.close()

def configuration(parent_package='',top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration(None, parent_package, top_path)
    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True)

    config.add_subpackage('numpy')

    config.add_data_files(('numpy','*.txt'),
                          ('numpy','COMPATIBILITY'),
                          ('numpy','site.cfg.example'))

    config.get_version('numpy/version.py') # sets config.version

    return config

def setup_package():

    from numpy.distutils.core import setup

    old_path = os.getcwd()
    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
    os.chdir(local_path)
    sys.path.insert(0,local_path)

    # Rewrite the version file everytime
    if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
    write_version_py()

    try:
        setup(
            name=NAME,
            maintainer=MAINTAINER,
            maintainer_email=MAINTAINER_EMAIL,
            description=DESCRIPTION,
            long_description=LONG_DESCRIPTION,
            url=URL,
            download_url=DOWNLOAD_URL,
            license=LICENSE,
            classifiers=CLASSIFIERS,
            author=AUTHOR,
            author_email=AUTHOR_EMAIL,
            platforms=PLATFORMS,
            configuration=configuration )
    finally:
        del sys.path[0]
        os.chdir(old_path)
    return

if __name__ == '__main__':
    setup_package()
<|endoftext|>


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

import os
import glob
from copy import deepcopy

from distutils.core import setup, run_setup
from distutils import sysconfig
from distutils.extension import Extension
from distutils.util import get_platform
from distutils.file_util import copy_file, move_file
from distutils.dir_util import mkpath, remove_tree
from distutils.sysconfig import get_python_version, get_config_vars
from Cython.Distutils import build_ext

import numpy as np
import sys

INFO = {
    'version': '0.1',
    }

_local_subsititues = {'darwin': 'Library'}
PYNE_DIR = os.path.join(os.environ['HOME'],
                        _local_subsititues.get(sys.platform, '.local'),
                        'pyne')

# Thanks to http://patorjk.com/software/taag/
# and http://www.chris.com/ascii/index.php?art=creatures/dragons
# for ASCII art inspiriation

pyne_logo = """\

                                  /   \
 _                        )      ((   ))     (
(@)                      /|\      ))_((     /|\
|-|                     / | \    (/\|/\)   / | \                      (@)
| | -------------------/--|-voV---\`|'/--Vov-|--\---------------------|-|
|-|                         '^`   (o o)  '^`                          | |
| |                               `\Y/'                               |-|
|-|                                                                   | |
| |        /\             ___           __  __             /\         |-|
|-|       /^~\           / _ \_   _  /\ \ \/__\           /^~\        | |
| |       /^~\          / /_)/ | | |/  \/ /_\             /^~\        |-|
|-|       /^~\         / ___/| |_| / /\  //__             /^~\        | |
| |       ^||`         \/     \__, \_\ \/\__/             ^||`        |-|
|-|        ||                |____/                        ||         | |
| |       ====                                            ====        |-|
|-|                                                                   | |
| |                                                                   |-|
|-|___________________________________________________________________| |
(@)              l   /\ /         ( (       \ /\   l                `\|-|
                 l /   V           \ \       V   \ l                  (@)
                 l/                _) )_          \I
                                   `\ /'
                                     `
"""

###########################################
### Set compiler options for extensions ###
###########################################
pyt_dir = os.path.join('pyne')
cpp_dir = os.path.join('cpp')
dat_dir = os.path.join('data')

# Get numpy include dir
numpy_include = np.get_include()

# HDF5 stuff
posix_hdf5_libs = ["z", "m", "hdf5", "hdf5_hl", "hdf5_cpp", "hdf5_hl_cpp",]
nt_hdf5_libs = ["/DEFAULTLIB:szip.lib", "/DEFAULTLIB:zlib1.lib", "/DEFAULTLIB:hdf5dll.lib",
                "/DEFAULTLIB:hdf5_hldll.lib", "/DEFAULTLIB:hdf5_cppdll.lib", "/DEFAULTLIB:hdf5_hl_cppdll.lib", ]
nt_hdf5_extra_compile_args = ["/EHsc"]
nt_hdf5_macros = [("_WIN32_MSVC", None), ("_HDF5USEDLL_", None), ("HDF5CPP_USEDLL", None), ]

###############################
### Platform specific setup ###
###############################
def darwin_linker_paths():
    paths = [os.path.join(PYNE_DIR, 'lib')]
    vars = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'LIBRARY_PATH']
    for v in vars:
        curvar = os.getenv(v, '')
        varpaths = paths + ([] if 0 == len(curvar) else [curvar])
        os.environ[v] = ":".join(varpaths)

def darwin_build_ext_decorator(f):
    def new_build_ext(self, ext):
        rtn = f(self, ext)
        if not ext.name.split('.')[-1].startswith('lib'):
            return rtn

        libpath = os.path.join(PYNE_DIR, 'lib')
        if not os.path.exists(libpath):
            mkpath(libpath)

        copy_file(self.get_ext_fullpath(ext.name), libpath)
        return rtn
    return new_build_ext

def darwin_setup():
    darwin_linker_paths()
    build_ext.build_extension = darwin_build_ext_decorator(build_ext.build_extension)

def win32_finalize_opts_decorator(f):
    def replace(lst, val, rep):
        if val not in lst:
            return lst
        ind = lst.index(val)
        del lst[ind]
        for r in rep[::-1]:
            lst.insert(ind, r)
        return lst

    def posix_like_ext(ext):
        replace(ext.extra_compile_args, "__COMPILER__", [])
        replace(ext.define_macros, "__COMPILER__", [])
        replace(ext.libraries, "__USE_HDF5__", posix_hdf5_libs)
        replace(ext.extra_compile_args, "__USE_HDF5__", [])
        replace(ext.define_macros, "__USE_HDF5__", [])

    def nt_like_ext(ext):
        replace(ext.extra_compile_args, "__COMPILER__", ["/EHsc"])
        replace(ext.define_macros, "__COMPILER__", [("_WIN32_MSVC", None)])
        replace(ext.libraries, "__USE_HDF5__", nt_hdf5_libs)
        replace(ext.extra_compile_args, "__USE_HDF5__", nt_hdf5_extra_compile_args)
        replace(ext.define_macros, "__USE_HDF5__", nt_hdf5_macros)

    update_ext = {'mingw32': posix_like_ext,
                  'cygwin': posix_like_ext,
                  'msvc': nt_like_ext,
                 }

    def new_finalize_opts(self):
        rtn = f(self)
        comp = self.compiler
        for ext in self.extensions:
            update_ext[comp](ext)
        if sysconfig.get_config_var('CC') is None:
            if comp in ['mingw32', 'cygwin']:
                # Hack to get compiler to be recognized
                sysconfig._config_vars['CC'] = 'gcc'
        return rtn
    return new_finalize_opts

def win32_build_ext_decorator(f):
    def new_build_ext(self, ext):
        dll_name = ext.name.split('.')[-1]
        if dll_name.startswith('lib'):
            def_file = os.path.join('build', 'temp.{0}-{1}'.format(get_platform(),
                                        get_python_version()), dll_name + '.def')
            print def_file
            import pdb; pdb.set_trace()
        rtn = f(self, ext)
        return rtn
    return new_build_ext

def win32_setup():
    build_ext.finalize_options = win32_finalize_opts_decorator(build_ext.finalize_options)
    build_ext.build_extension = win32_build_ext_decorator(build_ext.build_extension)

platform_setup = {'darwin': darwin_setup, 'win32': win32_setup}

##########################
### Exetension Creator ###
##########################

def cpp_ext(name, sources, libs=None, use_hdf5=False):
    """Helper function for setting up extension dictionary.

    Parameters
    ----------
    name : str
        Module name
    sources : list of str
        Files to compile
    libs : list of str
        Additional files to link against
    use_hdf5 : bool
        Link against hdf5?
    """
    ext = {'name': name}

    ext['sources'] = [os.path.join(cpp_dir, s) for s in sources if s.endswith('cpp')] + \
                     [os.path.join(pyt_dir, s) for s in sources if s.endswith('pyx')] + \
                     [s for s in sources if not any([s.endswith(suf) for suf in ['cpp', 'pyx']])]

    ext["libraries"] = []
    ext['include_dirs'] = [pyt_dir, cpp_dir, numpy_include]
    ext['language'] = "c++"

    # may need to be more general
    ext['library_dirs'] = ['build/lib/pyne/lib',
                           'build/lib.{0}-{1}/pyne/lib'.format(get_platform(), get_python_version()),
                           ]

    # perfectly general, thanks to dynamic runtime linking of $ORIGIN
    #ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}']
    ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}', '${ORIGIN}/.',
                                   '${ORIGIN}/../lib', '${ORIGIN}/..',]
    #ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}', '${ORIGIN}/.'] + \
    #                              [os.path.abspath(p) for p in ext['library_dirs']] + \
    #                              [os.path.abspath(p + '/pyne/lib') for p in sys.path] + \
    #                              [os.path.abspath(p + '/pyne') for p in sys.path] + \
    #                              [os.path.abspath(p) for p in sys.path]

    if sys.platform == 'linux2':
        #ext["extra_compile_args"] = ["-Wno-strict-prototypes"]
        ext["undef_macros"] = ["NDEBUG"]
        if use_hdf5:
            ext["libraries"] += posix_hdf5_libs
        if libs is not None:
            ext["libraries"] += libs
    elif sys.platform == 'darwin':
        ext["undef_macros"] = ["NDEBUG"]
        if use_hdf5:
            ext["libraries"] += posix_hdf5_libs
        if libs is not None:
            ext["libraries"] += libs
        config_vars = get_config_vars()
        #config_vars['SO'] = '.dylib'
        config_vars['LDSHARED'] = config_vars['LDSHARED'].replace('-bundle', '-Wl,-x')

        ext['library_dirs'] = []
        ext['runtime_library_dirs'] = []
        ext["extra_compile_args"] = ["-dynamiclib",
                                     "-undefined", "dynamic_lookup",
                                     '-shared',
                                     ]
        ext["extra_link_args"] = ["-dynamiclib",
                                  "-undefined", "dynamic_lookup",
                                  '-shared',
                                  "-install_name" , os.path.join(PYNE_DIR, 'lib', name.split('.')[-1] + config_vars['SO']),
                                  ]
    elif sys.platform == 'win32':
        ext["extra_compile_args"] = ["__COMPILER__"]
        ext["define_macros"] = ["__COMPILER__"]

        if use_hdf5:
            ext["libraries"].append("__USE_HDF5__")
            ext["extra_compile_args"].append("__USE_HDF5__")
            ext["define_macros"].append("__USE_HDF5__")

        if libs is not None:
            ext["libraries"] += libs
    elif sys.platform == 'cygwin':
        pass

    return ext

#
# For extensions
#
exts = []

# Pure C/C++ share libraries
# pyne lib
exts.append(cpp_ext("pyne.lib.libpyne", ['pyne.cpp']))

# nucname
exts.append(cpp_ext("pyne.lib.libpyne_nucname", ['nucname.cpp'], ['pyne']))

# data
exts.append(cpp_ext("pyne.lib.libpyne_data", ['data.cpp'], ['pyne', 'pyne_nucname'], True))

# material
exts.append(cpp_ext("pyne.lib.libpyne_material", ['material.cpp'], ['pyne', 'pyne_nucname', 'pyne_data'], True))

# Python extension modules
# STL converters
exts.append(cpp_ext("pyne.stlconverters", ['stlconverters.pyx']))

# pyne_config
exts.append(cpp_ext("pyne.pyne_config", ['pyne_config.pyx'], ['pyne']))

# _utils
exts.append(cpp_ext("pyne._utils", ['_utils.pyx']))

# nucname
exts.append(cpp_ext("pyne.nucname", ['nucname.pyx'], ['pyne', 'pyne_nucname']))

# data
exts.append(cpp_ext("pyne.data", ['data.pyx'], ['pyne', 'pyne_nucname', 'pyne_data'], True))

# material
exts.append(cpp_ext("pyne.material", ['material.pyx'], ['pyne', 'pyne_nucname', 'pyne_data', 'pyne_material'], True))

# ace
exts.append(cpp_ext("pyne.ace", ['ace.pyx'], ['pyne', 'pyne_nucname']))

# xs.models
exts.append(cpp_ext("pyne.xs.models", ['xs/models.pyx'], ['pyne', 'pyne_nucname']))

##########################
### Setup Package Data ###
##########################
packages = ['pyne', 'pyne.lib', 'pyne.dbgen', 'pyne.xs']

pack_dir = {'pyne': 'pyne', 'pyne.dbgen': 'pyne/dbgen', 'pyne.xs': 'pyne/xs'}

pack_data = {'pyne': ['includes/*.h', 'includes/pyne/*.pxd'],
             'pyne.dbgen': ['*.html'],
            }

ext_modules=[Extension(**ext) for ext in exts][:1]

# Compiler directives
compiler_directives = {'embedsignature': False}
for e in ext_modules:
    e.pyrex_directives = compiler_directives

# Utility scripts
scripts=['scripts/nuc_data_make']

###################
### Call setup! ###
###################
if __name__ == "__main__":
    print pyne_logo

    # clean includes dir and recopy files over
    if os.path.exists('pyne/includes'):
        remove_tree('pyne/includes')

    mkpath('pyne/includes')
    for header in glob.glob('cpp/*.h'):
        copy_file(header, 'pyne/includes')

    mkpath('pyne/includes/pyne')
    for header in glob.glob('pyne/*.pxd'):
        copy_file(header, 'pyne/includes/pyne')

    # Platform specific setup
    platform_setup.get(sys.platform, lambda: None)()

    # call setup
    setup(name="pyne",
        version = INFO['version'],
        description = 'Python for Nuclear Engineering',
        author = 'PyNE Development Team',
        author_email = 'scopatz@gmail.com',
        url = 'http://pyne.github.com/',
        packages = packages,
        package_dir = pack_dir,
        package_data = pack_data,
        cmdclass = {'build_ext': build_ext},
        ext_modules=ext_modules,
        scripts=scripts,
        )

    # Clean includes after setup has run
    if os.path.exists('pyne/includes'):
        remove_tree('pyne/includes')
<commit_msg>Added fix for symbol export<commit_after>#!/usr/bin/env python

import os
import glob
from copy import deepcopy

from distutils.core import setup, run_setup
from distutils import sysconfig
from distutils.extension import Extension
from distutils.util import get_platform
from distutils.file_util import copy_file, move_file
from distutils.dir_util import mkpath, remove_tree
from distutils.sysconfig import get_python_version, get_config_vars
from Cython.Distutils import build_ext

import numpy as np
import sys

INFO = {
    'version': '0.1',
    }

_local_subsititues = {'darwin': 'Library'}
PYNE_DIR = os.path.join(os.environ['HOME'],
                        _local_subsititues.get(sys.platform, '.local'),
                        'pyne')

# Thanks to http://patorjk.com/software/taag/
# and http://www.chris.com/ascii/index.php?art=creatures/dragons
# for ASCII art inspiriation

pyne_logo = """\

                                  /   \
 _                        )      ((   ))     (
(@)                      /|\      ))_((     /|\
|-|                     / | \    (/\|/\)   / | \                      (@)
| | -------------------/--|-voV---\`|'/--Vov-|--\---------------------|-|
|-|                         '^`   (o o)  '^`                          | |
| |                               `\Y/'                               |-|
|-|                                                                   | |
| |        /\             ___           __  __             /\         |-|
|-|       /^~\           / _ \_   _  /\ \ \/__\           /^~\        | |
| |       /^~\          / /_)/ | | |/  \/ /_\             /^~\        |-|
|-|       /^~\         / ___/| |_| / /\  //__             /^~\        | |
| |       ^||`         \/     \__, \_\ \/\__/             ^||`        |-|
|-|        ||                |____/                        ||         | |
| |       ====                                            ====        |-|
|-|                                                                   | |
| |                                                                   |-|
|-|___________________________________________________________________| |
(@)              l   /\ /         ( (       \ /\   l                `\|-|
                 l /   V           \ \       V   \ l                  (@)
                 l/                _) )_          \I
                                   `\ /'
                                     `
"""

###########################################
### Set compiler options for extensions ###
###########################################
pyt_dir = os.path.join('pyne')
cpp_dir = os.path.join('cpp')
dat_dir = os.path.join('data')

# Get numpy include dir
numpy_include = np.get_include()

# HDF5 stuff
posix_hdf5_libs = ["z", "m", "hdf5", "hdf5_hl", "hdf5_cpp", "hdf5_hl_cpp",]
nt_hdf5_libs = ["/DEFAULTLIB:szip.lib", "/DEFAULTLIB:zlib1.lib", "/DEFAULTLIB:hdf5dll.lib",
                "/DEFAULTLIB:hdf5_hldll.lib", "/DEFAULTLIB:hdf5_cppdll.lib", "/DEFAULTLIB:hdf5_hl_cppdll.lib", ]
nt_hdf5_extra_compile_args = ["/EHsc"]
nt_hdf5_macros = [("_WIN32_MSVC", None), ("_HDF5USEDLL_", None), ("HDF5CPP_USEDLL", None), ]

###############################
### Platform specific setup ###
###############################
def darwin_linker_paths():
    paths = [os.path.join(PYNE_DIR, 'lib')]
    vars = ['LD_LIBRARY_PATH', 'DYLD_FALLBACK_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'LIBRARY_PATH']
    for v in vars:
        curvar = os.getenv(v, '')
        varpaths = paths + ([] if 0 == len(curvar) else [curvar])
        os.environ[v] = ":".join(varpaths)

def darwin_build_ext_decorator(f):
    def new_build_ext(self, ext):
        rtn = f(self, ext)
        if not ext.name.split('.')[-1].startswith('lib'):
            return rtn

        libpath = os.path.join(PYNE_DIR, 'lib')
        if not os.path.exists(libpath):
            mkpath(libpath)

        copy_file(self.get_ext_fullpath(ext.name), libpath)
        return rtn
    return new_build_ext

def darwin_setup():
    darwin_linker_paths()
    build_ext.build_extension = darwin_build_ext_decorator(build_ext.build_extension)

def win32_finalize_opts_decorator(f):
    def replace(lst, val, rep):
        if val not in lst:
            return lst
        ind = lst.index(val)
        del lst[ind]
        for r in rep[::-1]:
            lst.insert(ind, r)
        return lst

    def posix_like_ext(ext):
        replace(ext.extra_compile_args, "__COMPILER__", [])
        replace(ext.define_macros, "__COMPILER__", [])
        replace(ext.libraries, "__USE_HDF5__", posix_hdf5_libs)
        replace(ext.extra_compile_args, "__USE_HDF5__", [])
        replace(ext.define_macros, "__USE_HDF5__", [])

    def nt_like_ext(ext):
        replace(ext.extra_compile_args, "__COMPILER__", ["/EHsc"])
        replace(ext.define_macros, "__COMPILER__", [("_WIN32_MSVC", None)])
        replace(ext.libraries, "__USE_HDF5__", nt_hdf5_libs)
        replace(ext.extra_compile_args, "__USE_HDF5__", nt_hdf5_extra_compile_args)
        replace(ext.define_macros, "__USE_HDF5__", nt_hdf5_macros)

    update_ext = {'mingw32': posix_like_ext,
                  'cygwin': posix_like_ext,
                  'msvc': nt_like_ext,
                 }

    def new_finalize_opts(self):
        rtn = f(self)
        comp = self.compiler
        for ext in self.extensions:
            update_ext[comp](ext)
        if sysconfig.get_config_var('CC') is None:
            if comp in ['mingw32', 'cygwin']:
                # Hack to get compiler to be recognized
                sysconfig._config_vars['CC'] = 'gcc'
        return rtn
    return new_finalize_opts

def win32_build_ext_decorator(f):
    def new_build_ext(self, ext):
        dll_name = ext.name.split('.')[-1]
        islib = dll_name.startswith('lib')
        config_vars = get_config_vars()
        if islib:
            config_vars['SO'] = '.dll'
        rtn = f(self, ext)
        if islib:
            config_vars['SO'] = '.pyd'
        return rtn
    return new_build_ext

def win32_get_exp_sym_decorator(f):
    def new_get_exp_sym(self, ext):
        rtn = f(self, ext)
        dll_name = ext.name.split('.')[-1]
        islib = dll_name.startswith('lib')
        initfunc_name = 'init' + dll_name
        if islib and initfunc_name in rtn:
            rtn.remove(initfunc_name)
        return rtn
    return new_get_exp_sym

def win32_setup():
    build_ext.finalize_options = win32_finalize_opts_decorator(build_ext.finalize_options)
    build_ext.build_extension = win32_build_ext_decorator(build_ext.build_extension)
    build_ext.get_export_symbols = win32_get_exp_sym_decorator(build_ext.get_export_symbols)

platform_setup = {'darwin': darwin_setup, 'win32': win32_setup}

##########################
### Exetension Creator ###
##########################

def cpp_ext(name, sources, libs=None, use_hdf5=False):
    """Helper function for setting up extension dictionary.

    Parameters
    ----------
    name : str
        Module name
    sources : list of str
        Files to compile
    libs : list of str
        Additional files to link against
    use_hdf5 : bool
        Link against hdf5?
    """
    ext = {'name': name}

    ext['sources'] = [os.path.join(cpp_dir, s) for s in sources if s.endswith('cpp')] + \
                     [os.path.join(pyt_dir, s) for s in sources if s.endswith('pyx')] + \
                     [s for s in sources if not any([s.endswith(suf) for suf in ['cpp', 'pyx']])]

    ext["libraries"] = []
    ext['include_dirs'] = [pyt_dir, cpp_dir, numpy_include]
    ext['language'] = "c++"

    # may need to be more general
    ext['library_dirs'] = ['build/lib/pyne/lib',
                           'build/lib.{0}-{1}/pyne/lib'.format(get_platform(), get_python_version()),
                           ]

    # perfectly general, thanks to dynamic runtime linking of $ORIGIN
    #ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}']
    ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}', '${ORIGIN}/.',
                                   '${ORIGIN}/../lib', '${ORIGIN}/..',]
    #ext['runtime_library_dirs'] = ['${ORIGIN}/lib', '${ORIGIN}', '${ORIGIN}/.'] + \
    #                              [os.path.abspath(p) for p in ext['library_dirs']] + \
    #                              [os.path.abspath(p + '/pyne/lib') for p in sys.path] + \
    #                              [os.path.abspath(p + '/pyne') for p in sys.path] + \
    #                              [os.path.abspath(p) for p in sys.path]

    if sys.platform == 'linux2':
        #ext["extra_compile_args"] = ["-Wno-strict-prototypes"]
        ext["undef_macros"] = ["NDEBUG"]
        if use_hdf5:
            ext["libraries"] += posix_hdf5_libs
        if libs is not None:
            ext["libraries"] += libs
    elif sys.platform == 'darwin':
        ext["undef_macros"] = ["NDEBUG"]
        if use_hdf5:
            ext["libraries"] += posix_hdf5_libs
        if libs is not None:
            ext["libraries"] += libs
        config_vars = get_config_vars()
        #config_vars['SO'] = '.dylib'
        config_vars['LDSHARED'] = config_vars['LDSHARED'].replace('-bundle', '-Wl,-x')

        ext['library_dirs'] = []
        ext['runtime_library_dirs'] = []
        ext["extra_compile_args"] = ["-dynamiclib",
                                     "-undefined", "dynamic_lookup",
                                     '-shared',
                                     ]
        ext["extra_link_args"] = ["-dynamiclib",
                                  "-undefined", "dynamic_lookup",
                                  '-shared',
                                  "-install_name" , os.path.join(PYNE_DIR, 'lib', name.split('.')[-1] + config_vars['SO']),
                                  ]
    elif sys.platform == 'win32':
        ext["extra_compile_args"] = ["__COMPILER__"]
        ext["define_macros"] = ["__COMPILER__"]

        if use_hdf5:
            ext["libraries"].append("__USE_HDF5__")
            ext["extra_compile_args"].append("__USE_HDF5__")
            ext["define_macros"].append("__USE_HDF5__")

        if libs is not None:
            ext["libraries"] += libs
    elif sys.platform == 'cygwin':
        pass

    return ext

#
# For extensions
#
exts = []

# Pure C/C++ share libraries
# pyne lib
exts.append(cpp_ext("pyne.lib.libpyne", ['pyne.cpp']))

# nucname
exts.append(cpp_ext("pyne.lib.libpyne_nucname", ['nucname.cpp'], ['pyne']))

# data
exts.append(cpp_ext("pyne.lib.libpyne_data", ['data.cpp'], ['pyne', 'pyne_nucname'], True))

# material
exts.append(cpp_ext("pyne.lib.libpyne_material", ['material.cpp'], ['pyne', 'pyne_nucname', 'pyne_data'], True))

# Python extension modules
# STL converters
exts.append(cpp_ext("pyne.stlconverters", ['stlconverters.pyx']))

# pyne_config
exts.append(cpp_ext("pyne.pyne_config", ['pyne_config.pyx'], ['pyne']))

# _utils
exts.append(cpp_ext("pyne._utils", ['_utils.pyx']))

# nucname
exts.append(cpp_ext("pyne.nucname", ['nucname.pyx'], ['pyne', 'pyne_nucname']))

# data
exts.append(cpp_ext("pyne.data", ['data.pyx'], ['pyne', 'pyne_nucname', 'pyne_data'], True))

# material
exts.append(cpp_ext("pyne.material", ['material.pyx'], ['pyne', 'pyne_nucname', 'pyne_data', 'pyne_material'], True))

# ace
exts.append(cpp_ext("pyne.ace", ['ace.pyx'], ['pyne', 'pyne_nucname']))

# xs.models
exts.append(cpp_ext("pyne.xs.models", ['xs/models.pyx'], ['pyne', 'pyne_nucname']))

##########################
### Setup Package Data ###
##########################
packages = ['pyne', 'pyne.lib', 'pyne.dbgen', 'pyne.xs']

pack_dir = {'pyne': 'pyne', 'pyne.dbgen': 'pyne/dbgen', 'pyne.xs': 'pyne/xs'}

pack_data = {'pyne': ['includes/*.h', 'includes/pyne/*.pxd'],
             'pyne.dbgen': ['*.html'],
            }

ext_modules=[Extension(**ext) for ext in exts][:1]

# Compiler directives
compiler_directives = {'embedsignature': False}
for e in ext_modules:
    e.pyrex_directives = compiler_directives

# Utility scripts
scripts=['scripts/nuc_data_make']

###################
### Call setup! ###
###################
if __name__ == "__main__":
    print pyne_logo

    # clean includes dir and recopy files over
    if os.path.exists('pyne/includes'):
        remove_tree('pyne/includes')

    mkpath('pyne/includes')
    for header in glob.glob('cpp/*.h'):
        copy_file(header, 'pyne/includes')

    mkpath('pyne/includes/pyne')
    for header in glob.glob('pyne/*.pxd'):
        copy_file(header, 'pyne/includes/pyne')

    # Platform specific setup
    platform_setup.get(sys.platform, lambda: None)()

    # call setup
    setup(name="pyne",
        version = INFO['version'],
        description = 'Python for Nuclear Engineering',
        author = 'PyNE Development Team',
        author_email = 'scopatz@gmail.com',
        url = 'http://pyne.github.com/',
        packages = packages,
        package_dir = pack_dir,
        package_data = pack_data,
        cmdclass = {'build_ext': build_ext},
        ext_modules=ext_modules,
        scripts=scripts,
        )

    # Clean includes after setup has run
    if os.path.exists('pyne/includes'):
        remove_tree('pyne/includes')
<|endoftext|>


<commit_before>import os
from setuptools import setup, find_packages

# work around to prevent http://bugs.python.org/issue15881 from showing up
try:
    import multiprocessing  # NOQA
except ImportError:
    pass

try:
    f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
    long_description = f.read().strip()
    f.close()
except IOError:
    long_description = None

setup(
    name='django-constance-trbs',
    version='0.7.3',
    url="http://github.com/trbs/django-constance-trbs",
    description='Django live settings with pluggable backends, including Redis.',
    long_description=long_description,
    author='Forked from Comoga Django Team',
    author_email='trbs@trbs.net',
    maintainer='Jannis Leidel',
    maintainer_email='jannis@leidel.info',
    license='BSD',
    keywords='django libraries settings redis'.split(),
    platforms='any',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Utilities',
    ],
    packages=find_packages(exclude=['tests']),
    include_package_data=True,
    test_suite='tests.runtests.main',
    tests_require=['django>=1.6', 'django-picklefield', 'redis'],
    install_requires=['six'],
    zip_safe=False,
    extras_require={
        'database': ['django-picklefield'],
        'redis': ['redis'],
    }
)
<commit_msg>version bump<commit_after>import os
from setuptools import setup, find_packages

# work around to prevent http://bugs.python.org/issue15881 from showing up
try:
    import multiprocessing  # NOQA
except ImportError:
    pass

try:
    f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
    long_description = f.read().strip()
    f.close()
except IOError:
    long_description = None

setup(
    name='django-constance-trbs',
    version='0.7.4',
    url="http://github.com/trbs/django-constance-trbs",
    description='Django live settings with pluggable backends, including Redis.',
    long_description=long_description,
    author='Forked from Comoga Django Team',
    author_email='trbs@trbs.net',
    maintainer='Jannis Leidel',
    maintainer_email='jannis@leidel.info',
    license='BSD',
    keywords='django libraries settings redis'.split(),
    platforms='any',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Utilities',
    ],
    packages=find_packages(exclude=['tests']),
    include_package_data=True,
    test_suite='tests.runtests.main',
    tests_require=['django>=1.6', 'django-picklefield', 'redis'],
    install_requires=['six'],
    zip_safe=False,
    extras_require={
        'database': ['django-picklefield'],
        'redis': ['redis'],
    }
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function

import sys
import os.path
import warnings
from setuptools import setup

try:
    import py2exe
except ImportError:
    if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
        print("Cannot import py2exe", file=sys.stderr)
        exit(1)

py2exe_options = {
    "bundle_files": 1,
    "compressed": 1,
    "optimize": 2,
    "dist_dir": '.',
    "dll_excludes": ['w9xpopen.exe'],
}

py2exe_console = [{
    "script": "./litcm/__main__.py",
    "dest_base": "litcm",
}]

py2exe_params = {
    'console': py2exe_console,
    'options': {"py2exe": py2exe_options},
    'zipfile': None
}

if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
    params = py2exe_params
else:
    files_spec = [
        ('share/doc/litcm', ['README.rst'])
    ]
    root = os.path.dirname(os.path.abspath(__file__))
    data_files = []
    for dirname, files in files_spec:
        resfiles = []
        for fn in files:
            if not os.path.exists(fn):
                warnings.warn('Skipping file %s since it is not present. Type  make  to build all automatically generated files.' % fn)
            else:
                resfiles.append(fn)
        data_files.append((dirname, resfiles))

    params = {
        'data_files': data_files,
    }
    params['entry_points'] = {'console_scripts': ['litcm = litcm:main']}

# Get the version from youtube_dl/version.py without importing the package
exec(compile(open('litcm/version.py').read(),
             'litcm/version.py', 'exec'))

setup(
    name = "litcm",
    version = __version__,
    description="Language Identification and Transliteration system for Indian Languages in Roman script code mixed with English",
    long_description = open('README.rst', 'rb').read().decode('utf8'),
    keywords = ['Language Identification', 'Language Transliteration', 'WX',
                'Computational Linguistics', 'Indic', 'Code-Mixing'],
    author='Irshad Ahmad',
    author_email='irshad.bhat@research.iiit.ac.in',
    maintainer='Irshad Ahmad',
    maintainer_email='irshad.bhat@research.iiit.ac.in',
    license = "MIT",
    url="https://github.com/irshadbhat/litcm",
    package_dir={'litcm':'litcm'},
    packages=['litcm'],
    package_data={'litcm': ['blm_models/*.blm', 'decision_trees/*.json', 'extras/*.txt']},

    classifiers=[
        "Topic :: Indian Languages :: Language Identification",
        "Environment :: Console",
        "License :: Public Domain",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
    ],

    **params
)
<commit_msg>update<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function

import sys
import os.path
import warnings
from setuptools import setup

try:
    import py2exe
except ImportError:
    if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
        print("Cannot import py2exe", file=sys.stderr)
        exit(1)

py2exe_options = {
    "bundle_files": 1,
    "compressed": 1,
    "optimize": 2,
    "dist_dir": '.',
    "dll_excludes": ['w9xpopen.exe'],
}

py2exe_console = [{
    "script": "./litcm/__main__.py",
    "dest_base": "litcm",
}]

py2exe_params = {
    'console': py2exe_console,
    'options': {"py2exe": py2exe_options},
    'zipfile': None
}

if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
    params = py2exe_params
else:
    files_spec = [
        ('share/doc/litcm', ['README.rst'])
    ]
    root = os.path.dirname(os.path.abspath(__file__))
    data_files = []
    for dirname, files in files_spec:
        resfiles = []
        for fn in files:
            if not os.path.exists(fn):
                warnings.warn('Skipping file %s since it is not present. Type  make  to build all automatically generated files.' % fn)
            else:
                resfiles.append(fn)
        data_files.append((dirname, resfiles))

    params = {
        'data_files': data_files,
    }
    params['entry_points'] = {'console_scripts': ['litcm = litcm:main']}

# Get the version from youtube_dl/version.py without importing the package
exec(compile(open('litcm/version.py').read(),
             'litcm/version.py', 'exec'))

setup(
    name = "litcm",
    version = __version__,
    description="Language Identification and Transliteration system for Indian Languages in Roman script code mixed with English",
    long_description = open('README.rst', 'rb').read().decode('utf8'),
    keywords = ['Language Identification', 'Language Transliteration', 'WX',
                'Computational Linguistics', 'Indic', 'Code-Mixing'],
    author='Irshad Ahmad',
    author_email='irshad.bhat@research.iiit.ac.in',
    maintainer='Irshad Ahmad',
    maintainer_email='irshad.bhat@research.iiit.ac.in',
    license = "MIT",
    url="https://github.com/irshadbhat/litcm",
    package_dir={'litcm':'litcm'},
    packages=['litcm'],
    package_data={'litcm': ['blm_models/*.blm', 'decision_trees/*.json', 'extras/*.txt']},

    classifiers=[
        "Topic :: Indian Languages :: Language Identification",
        "Environment :: Console",
        "License :: Public Domain",
        "Programming Language :: Python :: 2.7"
    ],

    **params
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(
    name='iframe-playlist-generator',
    version='0.1.1',
    author='Peter Norton',
    author_email='peter@nortoncrew.com',
    packages=['iframeplaylistgenerator'],
    url='https://github.com/pbs/iframe-playlist-generator',
    description='HLS I-frame playlist generator',
    long_description=open('README.rst').read(),
    install_requires=['m3u8==0.1.7b'],
    dependency_links=['https://github.com/pbs/m3u8/tarball/master#egg=m3u8-0.1.7b'],
)
<commit_msg>Fixed erroneous dependency to PBS m3u8-lib<commit_after>from setuptools import setup

setup(
    name='iframe-playlist-generator',
    version='0.1.1',
    author='Peter Norton',
    author_email='peter@nortoncrew.com',
    packages=['iframeplaylistgenerator'],
    url='https://github.com/pbs/iframe-playlist-generator',
    description='HLS I-frame playlist generator',
    long_description=open('README.rst').read(),
    install_requires=['m3u8==0.2.5b-pbs'],
    dependency_links=['https://github.com/pbs/m3u8/tarball/master#egg=m3u8-0.2.5b-pbs'],
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-

"""
    setup.py for oval
    ~~~~~~~~~~~~~~~~

    :copyright: Copyright 2011 Mathias Loesch.
"""

import os
import sys
from setuptools import setup, find_packages
from distutils import log

long_desc = """
BASE OAI-PMH Validity Checker (OVAL) checks XML validity as well as conformance
of OAI-PMH interface to the protocol specification
(http://www.openarchives.org/OAI/openarchivesprotocol.html). The criteria are
optimized for the BASE search engine (http://base-search.net).
"""

setup(
    name='oval',
    version='0.3.1',
    url='http://www.ub.uni-bielefeld.de/',
    license='BSD',
    author='Mathias Loesch',
    author_email='Mathias.Loesch@uni-bielefeld.de',
    description='Validator for OAI-PMH interfaces',
    long_description=long_desc,
    zip_safe=False,
    classifiers=[
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Intended Audience :: Science/Research',
        'Intended Audience :: Developers'
    ],
    platforms='any',
    packages=find_packages(),
    include_package_data=True,
    package_data={'oval': ['data/*.xsd',
                           'data/*.html',
                           'data/*.tab',
                           'data/*.pickle']},
	install_requires = ['ordereddict',
						'lxml']
)<commit_msg>Rechanged version to 0.2.0<commit_after># -*- coding: utf-8 -*-

"""
    setup.py for oval
    ~~~~~~~~~~~~~~~~

    :copyright: Copyright 2011 Mathias Loesch.
"""

import os
import sys
from setuptools import setup, find_packages
from distutils import log

import oval

long_desc = """
BASE OAI-PMH Validity Checker (OVAL) checks XML validity as well as conformance
of OAI-PMH interface to the protocol specification
(http://www.openarchives.org/OAI/openarchivesprotocol.html). The criteria are
optimized for the BASE search engine (http://base-search.net).
"""

setup(
    name='oval',
    version=oval.__version__,
    url='http://www.ub.uni-bielefeld.de/',
    license='BSD',
    author='Mathias Loesch',
    author_email='Mathias.Loesch@uni-bielefeld.de',
    description='Validator for OAI-PMH interfaces',
    long_description=long_desc,
    zip_safe=False,
    classifiers=[
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Intended Audience :: Science/Research',
        'Intended Audience :: Developers'
    ],
    platforms='any',
    packages=find_packages(),
    include_package_data=True,
    package_data={'oval': ['data/*.xsd',
                           'data/*.html',
                           'data/*.tab',
                           'data/*.pickle']},
	install_requires = ['ordereddict',
						'lxml']
)<|endoftext|>


<commit_before># -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name='Djam',
    version='0.9.1',
    author='AmvTek developers',
    author_email='devel@amvtek.com',
    licence='MIT',
    packages=find_packages(),
    url='https://github.com/amvtek/Djam/',
    description='Extends Django to work with sqlalchemy and make it behave like Flask',
    long_description=open('README.rst').read(),
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP',
    ],
)
<commit_msg>Fixing other PyPI hurdle : licence --> license<commit_after># -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name='Djam',
    version='0.9.1',
    author='AmvTek developers',
    author_email='devel@amvtek.com',
    license='MIT',
    packages=find_packages(),
    url='https://github.com/amvtek/Djam/',
    description='Extends Django to work with sqlalchemy and make it behave like Flask',
    long_description=open('README.rst').read(),
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP',
    ],
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
import setuptools
from distutils.core import setup

__version__ = "1.1.4"

def setup_package():
    long_description = ''.join(open('README.md').readlines()[4:])

    arguments = dict(
        name='particletools',
        version=__version__,
        author='Anatoli Fedynitch',
        author_email='afedynitch@gmail.com',
        description='Translating particle codes from CR models from/to PDG codes',
        long_description=long_description,
        license="MIT",
        url='https://github.com/afedynitch/particletools',
        package_dir={'particletools': 'particletools'},
        packages=['particletools'],
        install_requires=['setuptools'],
        tests_require=['pytest'],
        py_modules=["six"],
        package_data={'particletools': ['ParticleData.xml']},
        classifiers=[
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Topic :: Scientific/Engineering :: Physics',
            'Intended Audience :: Science/Research',
            'Development Status :: 4 - Beta',
            'License :: OSI Approved :: MIT License'
        ],
    )

    setup(**arguments)

if __name__ == '__main__':
    setup_package()
<commit_msg>Declared stable<commit_after># -*- coding: utf-8 -*-
import setuptools
from distutils.core import setup

__version__ = "1.1.4"

def setup_package():
    long_description = ''.join(open('README.md').readlines()[4:])

    arguments = dict(
        name='particletools',
        version=__version__,
        author='Anatoli Fedynitch',
        author_email='afedynitch@gmail.com',
        description='Translating particle codes from CR models from/to PDG codes',
        long_description=long_description,
        license="MIT",
        url='https://github.com/afedynitch/particletools',
        package_dir={'particletools': 'particletools'},
        packages=['particletools'],
        install_requires=['setuptools'],
        tests_require=['pytest'],
        py_modules=["six"],
        package_data={'particletools': ['ParticleData.xml']},
        classifiers=[
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
            'Topic :: Scientific/Engineering :: Physics',
            'Intended Audience :: Science/Research',
            'Development Status :: 5 - Production/Stable',
            'License :: OSI Approved :: MIT License'
        ],
    )

    setup(**arguments)

if __name__ == '__main__':
    setup_package()
<|endoftext|>


<commit_before>try:
    from setuptools import setup
except ImportError :
    raise ImportError("setuptools module required, please go to https://pypi.python.org/pypi/setuptools and follow the instructions for installing setuptools")

setup(
    version='0.1',
    url='https://github.com/datamade/us-address-parser',
    description='Parse US addresses using conditional random fields',
    name='usaddress',
    packages=['usaddress'],
    package_data={'usaddress' : ['usaddr.crfsuite']},
    license='The MIT License: http://www.opensource.org/licenses/mit-license.php',
    install_requires=['python-crfsuite>=0.7'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 2 :: Only',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Scientific/Engineering',
        'Topic :: Scientific/Engineering :: Information Analysis'],
    long_description="""
    usaddress is a python library for parsing unstructured address
    strings into address components, using advanced NLP methods.

    From the python interpereter, you can

    >>> import usaddress
    >>> usaddress.parse('123 Main St. Suite 100 Chicago, IL')
    [('123', 'AddressNumber'),
     ('Main', 'StreetName'),
     ('St.', 'StreetNamePostType'),
     ('Suite', 'OccupancyType'),
     ('100', 'OccupancyIdentifier'),
     ('Chicago,', 'PlaceName'),
     ('IL', 'StateName')]
    """
)
<commit_msg>version<commit_after>try:
    from setuptools import setup
except ImportError :
    raise ImportError("setuptools module required, please go to https://pypi.python.org/pypi/setuptools and follow the instructions for installing setuptools")

setup(
    version='0.1.1',
    url='https://github.com/datamade/us-address-parser',
    description='Parse US addresses using conditional random fields',
    name='usaddress',
    packages=['usaddress'],
    package_data={'usaddress' : ['usaddr.crfsuite']},
    license='The MIT License: http://www.opensource.org/licenses/mit-license.php',
    install_requires=['python-crfsuite>=0.7'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 2 :: Only',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Scientific/Engineering',
        'Topic :: Scientific/Engineering :: Information Analysis'],
    long_description="""
    usaddress is a python library for parsing unstructured address
    strings into address components, using advanced NLP methods.

    From the python interpereter, you can

    >>> import usaddress
    >>> usaddress.parse('123 Main St. Suite 100 Chicago, IL')
    [('123', 'AddressNumber'),
     ('Main', 'StreetName'),
     ('St.', 'StreetNamePostType'),
     ('Suite', 'OccupancyType'),
     ('100', 'OccupancyIdentifier'),
     ('Chicago,', 'PlaceName'),
     ('IL', 'StateName')]
    """
)
<|endoftext|>


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

"""
    This is the main setup script for h5py (http://www.h5py.org).

    Most of the functionality is provided in two separate modules:
    setup_configure, which manages compile-time/Cython-time build options
    for h5py, and setup_build, which handles the actual compilation process.
"""

try:
    from setuptools import Extension, setup
except ImportError:
    from distutils.core import setup
    from distutils.extension import Extension
from distutils.cmd import Command
from distutils.dist import Distribution
import sys
import os
import os.path as op

import setup_build, setup_configure

VERSION = '2.6.0'

NUMPY_DEP = 'numpy>=1.7'

# these are required to use h5py
RUN_REQUIRES = [NUMPY_DEP, 'six']

# these are required to build h5py
# RUN_REQUIRES is included as setup.py test needs RUN_REQUIRES for testing
# RUN_REQUIRES can be removed when setup.py test is removed
SETUP_REQUIRES = RUN_REQUIRES + [NUMPY_DEP, 'Cython>=0.19', 'pkgconfig']

# Needed to avoid trying to install numpy/cython on pythons which the latest
# versions don't support
if "sdist" in sys.argv and "bdist_wheel" not in sys.argv and "install" not in sys.argv:
    use_setup_requires = False
else:
    use_setup_requires = True

# --- Custom Distutils commands -----------------------------------------------

class test(Command):

    """
        Custom Distutils command to run the h5py test suite.

        This command will invoke build/build_ext if the project has not
        already been built.  It then patches in the build directory to
        sys.path and runs the test suite directly.
    """

    description = "Run the test suite"

    user_options = [('detail', 'd', 'Display additional test information')]

    def initialize_options(self):
        self.detail = False

    def finalize_options(self):
        self.detail = bool(self.detail)

    def run(self):
        """ Called by Distutils when this command is run """
        import sys
        py_version = sys.version_info[:2]
        if py_version != (2, 6):
            import unittest
        else:
            try:
                import unittest2 as unittest
            except ImportError:
                raise ImportError( "unittest2 is required to run tests with Python 2.6")

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            result = h5py.run_tests(verbose=self.detail)
            if not result.wasSuccessful():
                sys.exit(1)
        finally:
            sys.path = oldpath

CMDCLASS = {'build_ext': setup_build.h5py_build_ext,
            'configure': setup_configure.configure,
            'test': test, }

# --- Distutils setup and metadata --------------------------------------------

cls_txt = \
"""
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Python
Topic :: Scientific/Engineering
Topic :: Database
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: Unix
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
"""

short_desc = "Read and write HDF5 files from Python"

long_desc = \
"""
The h5py package provides both a high- and low-level interface to the HDF5
library from Python. The low-level interface is intended to be a complete
wrapping of the HDF5 API, while the high-level component supports  access to
HDF5 files, datasets and groups using established Python and NumPy concepts.

A strong emphasis on automatic conversion between Python (Numpy) datatypes and
data structures and their HDF5 equivalents vastly simplifies the process of
reading and writing data from Python.

Supports HDF5 versions 1.8.4 and higher.  On Windows, HDF5 is included with
the installer.
"""

if os.name == 'nt':
    package_data = {'h5py': ['*.dll']}
else:
    package_data = {'h5py': []}

setup(
  name = 'h5py',
  version = VERSION,
  description = short_desc,
  long_description = long_desc,
  classifiers = [x for x in cls_txt.split("\n") if x],
  author = 'Andrew Collette',
  author_email = 'andrew.collette@gmail.com',
  maintainer = 'Andrew Collette',
  maintainer_email = 'andrew.collette@gmail.com',
  url = 'http://www.h5py.org',
  download_url = 'https://pypi.python.org/pypi/h5py',
  packages = ['h5py', 'h5py._hl', 'h5py.tests', 'h5py.tests.old', 'h5py.tests.hl'],
  package_data = package_data,
  ext_modules = [Extension('h5py.x',['x.c'])],  # To trick build into running build_ext
  install_requires = RUN_REQUIRES,
  setup_requires = SETUP_REQUIRES if use_setup_requires else [],
  cmdclass = CMDCLASS,
)
<commit_msg>Update classifiers to include supported python version and interpreters<commit_after>#!/usr/bin/env python

"""
    This is the main setup script for h5py (http://www.h5py.org).

    Most of the functionality is provided in two separate modules:
    setup_configure, which manages compile-time/Cython-time build options
    for h5py, and setup_build, which handles the actual compilation process.
"""

try:
    from setuptools import Extension, setup
except ImportError:
    from distutils.core import setup
    from distutils.extension import Extension
from distutils.cmd import Command
from distutils.dist import Distribution
import sys
import os
import os.path as op

import setup_build, setup_configure

VERSION = '2.6.0'

NUMPY_DEP = 'numpy>=1.7'

# these are required to use h5py
RUN_REQUIRES = [NUMPY_DEP, 'six']

# these are required to build h5py
# RUN_REQUIRES is included as setup.py test needs RUN_REQUIRES for testing
# RUN_REQUIRES can be removed when setup.py test is removed
SETUP_REQUIRES = RUN_REQUIRES + [NUMPY_DEP, 'Cython>=0.19', 'pkgconfig']

# Needed to avoid trying to install numpy/cython on pythons which the latest
# versions don't support
if "sdist" in sys.argv and "bdist_wheel" not in sys.argv and "install" not in sys.argv:
    use_setup_requires = False
else:
    use_setup_requires = True

# --- Custom Distutils commands -----------------------------------------------

class test(Command):

    """
        Custom Distutils command to run the h5py test suite.

        This command will invoke build/build_ext if the project has not
        already been built.  It then patches in the build directory to
        sys.path and runs the test suite directly.
    """

    description = "Run the test suite"

    user_options = [('detail', 'd', 'Display additional test information')]

    def initialize_options(self):
        self.detail = False

    def finalize_options(self):
        self.detail = bool(self.detail)

    def run(self):
        """ Called by Distutils when this command is run """
        import sys
        py_version = sys.version_info[:2]
        if py_version != (2, 6):
            import unittest
        else:
            try:
                import unittest2 as unittest
            except ImportError:
                raise ImportError( "unittest2 is required to run tests with Python 2.6")

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            result = h5py.run_tests(verbose=self.detail)
            if not result.wasSuccessful():
                sys.exit(1)
        finally:
            sys.path = oldpath

CMDCLASS = {'build_ext': setup_build.h5py_build_ext,
            'configure': setup_configure.configure,
            'test': test, }

# --- Distutils setup and metadata --------------------------------------------

cls_txt = \
"""
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Cython
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Database
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: Unix
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
"""

short_desc = "Read and write HDF5 files from Python"

long_desc = \
"""
The h5py package provides both a high- and low-level interface to the HDF5
library from Python. The low-level interface is intended to be a complete
wrapping of the HDF5 API, while the high-level component supports  access to
HDF5 files, datasets and groups using established Python and NumPy concepts.

A strong emphasis on automatic conversion between Python (Numpy) datatypes and
data structures and their HDF5 equivalents vastly simplifies the process of
reading and writing data from Python.

Supports HDF5 versions 1.8.4 and higher.  On Windows, HDF5 is included with
the installer.
"""

if os.name == 'nt':
    package_data = {'h5py': ['*.dll']}
else:
    package_data = {'h5py': []}

setup(
  name = 'h5py',
  version = VERSION,
  description = short_desc,
  long_description = long_desc,
  classifiers = [x for x in cls_txt.split("\n") if x],
  author = 'Andrew Collette',
  author_email = 'andrew.collette@gmail.com',
  maintainer = 'Andrew Collette',
  maintainer_email = 'andrew.collette@gmail.com',
  url = 'http://www.h5py.org',
  download_url = 'https://pypi.python.org/pypi/h5py',
  packages = ['h5py', 'h5py._hl', 'h5py.tests', 'h5py.tests.old', 'h5py.tests.hl'],
  package_data = package_data,
  ext_modules = [Extension('h5py.x',['x.c'])],  # To trick build into running build_ext
  install_requires = RUN_REQUIRES,
  setup_requires = SETUP_REQUIRES if use_setup_requires else [],
  cmdclass = CMDCLASS,
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name = "django-user-accounts",
    version = "1.0b5",
    author = "Brian Rosner",
    author_email = "brosner@gmail.com",
    description = "a Django user account app",
    long_description = open("README.rst").read(),
    license = "MIT",
    url = "http://github.com/pinax/django-user-accounts",
    packages = find_packages(),
    install_requires = [
        "django-appconf==0.5",
        "pytz==2012d"
    ],
    classifiers = [
        "Development Status :: 4 - Beta",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Framework :: Django",
    ]
)
<commit_msg>Bumped version to reflect the current state<commit_after>from setuptools import setup, find_packages

setup(
    name = "django-user-accounts",
    version = "1.0b6",
    author = "Brian Rosner",
    author_email = "brosner@gmail.com",
    description = "a Django user account app",
    long_description = open("README.rst").read(),
    license = "MIT",
    url = "http://github.com/pinax/django-user-accounts",
    packages = find_packages(),
    install_requires = [
        "django-appconf==0.5",
        "pytz==2012d"
    ],
    classifiers = [
        "Development Status :: 4 - Beta",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Framework :: Django",
    ]
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(name='SyslogProcessor',
    version='0.1.1',
    description='Syslog processing framework',
    author='Gregory Haynes',
    author_email='greg@greghaynes.net',
    url='http://github.com/greghaynes/SyslogProcessor',
    license='MIT',
    py_modules=['syslogprocessor', 'handler', 'rsyslog_fix'],
    install_requires=['argparse>=1.2.1',
              'loggerglue>=1.0',
              'pyparsing>=1.5.6',
              'sspps>=0.1.4',
              'python-daemon>=1.5.5'],
    scripts=['scripts/syslogprocessor']
    )
<commit_msg>Add missing file to setup.py py_modules<commit_after>from setuptools import setup

setup(name='SyslogProcessor',
    version='0.1.1',
    description='Syslog processing framework',
    author='Gregory Haynes',
    author_email='greg@greghaynes.net',
    url='http://github.com/greghaynes/SyslogProcessor',
    license='MIT',
    py_modules=['syslogprocessor', 'handler', 'rsyslog_fix', 'logwriter'],
    install_requires=['argparse>=1.2.1',
              'loggerglue>=1.0',
              'pyparsing>=1.5.6',
              'sspps>=0.1.4',
              'python-daemon>=1.5.5'],
    scripts=['scripts/syslogprocessor']
    )
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup

LONG_DESCRIPTION = """
Django confirmaction is a battery for confirm actions via email, sms etc.
"""

def long_description():
    try:
        return open(
            os.path.join(os.path.dirname(__file__), "README.md")
        ).read()
    except IOError:
        return LONG_DESCRIPTION

setup(
    name = "django-confirmaction",
    version = "0.0.2",
    author = "Aleksandr Aibulatov",
    author_email = "zap.aibulatov@gmail.com",
    description = "Django battery for confirm some action via email, sms, etc",
    license = "BSD",
    keywords = "django, battery, confirm action",
    url = "https://github.com/Zapix/django-confirmaction",
    packages=[
        'confirmaction',
        'confirmaction.tests',
        'confirmaction.migrations'
    ],
    long_description=long_description(),
    classifiers=[
        "Development Status :: 2 - Pre-Alpha",
        "Framework :: Django",
        "Programming Language :: Python :: 2.7",
        "Topic :: Utilities",
        "License :: OSI Approved :: BSD License",
    ],
)<commit_msg>Set setup py<commit_after># -*- coding: utf-8 -*-
import os
from setuptools import setup

LONG_DESCRIPTION = """
Django confirmaction is a battery for confirm actions via email, sms etc.
"""

def long_description():
    try:
        return open(
            os.path.join(os.path.dirname(__file__), "README.md")
        ).read()
    except IOError:
        return LONG_DESCRIPTION

setup(
    name = "django-confirmaction",
    version = "0.0.2",
    author = "Aleksandr Aibulatov",
    author_email = "zap.aibulatov@gmail.com",
    description = "Django battery for confirm some action via email, sms, etc",
    license = "BSD",
    keywords = "django, battery, confirm action",
    url = "https://github.com/Zapix/django-confirmaction",
    packages=[
        'confirmaction',
        'confirmaction.tests',
        'confirmaction.migrations'
    ],
    long_description=long_description(),
    install_requires=[
        'django>=1.6',
        'south>=0.8.4',
        'mock',
        'pycrypto'
    ],
    classifiers=[
        "Development Status :: 2 - Pre-Alpha",
        "Framework :: Django",
        "Programming Language :: Python :: 2.7",
        "Topic :: Utilities",
        "License :: OSI Approved :: BSD License",
    ],
)<|endoftext|>


<commit_before>import os
import sys
from setuptools import setup, find_packages
from shutil import rmtree
from mezzanine import __version__ as version

exclude = ["mezzanine/project_template/dev.db",
           "mezzanine/project_template/local_settings.py"]
if sys.argv == ["setup.py", "test"]:
    exclude = []
exclude = dict([(e, None) for e in exclude])

for e in exclude:
    if e.endswith(".py"):
        try:
            os.remove("%sc" % e)
        except:
            pass
    try:
        with open(e, "r") as f:
            exclude[e] = (f.read(), os.stat(e))
        os.remove(e)
    except:
        pass

if sys.argv[:2] == ["setup.py", "bdist_wheel"]:
    # Remove previous build dir when creating a wheel build,
    # since if files have been removed from the project,
    # they'll still be cached in the build dir and end up
    # as part of the build, which is really neat!
    try:
        rmtree("build")
    except:
        pass

try:
    setup(
        name="Mezzanine",
        version=version,
        author="Stephen McDonald",
        author_email="stephen.mc@gmail.com",
        description="An open source content management platform built using "
                    "the Django framework.",
        long_description=open("README.rst", 'rb').read().decode('utf-8'),
        license="BSD",
        url="http://mezzanine.jupo.org/",
        zip_safe=False,
        include_package_data=True,
        packages=find_packages(),
        install_requires=[
            "beautifulsoup4==4.3.2",
            "bleach==1.4.1",
            "chardet==2.3.0",
            "Django >= 1.8.1, < 1.9",
            "django-backbone==0.3.2",
            "django-compressor==1.5",
            "django-contrib-comments==1.6.0",
            "django-modeltranslation==0.9.1",
            "django-solo==1.1.0",
            "filebrowser-safe==0.3.8",
            "future==0.14.3",
            "grappelli-safe==0.3.13",
            "gunicorn==19.3.0",
            "html5lib==1.0b6",
            "oauthlib==0.7.2",
            "pep8==1.6.2",
            "pillow==2.8.1",
            "pyflakes==0.8.1",
            "psycopg2==2.6",
            "pytz==2015.2",
            "requests==2.7.0",
            "requests-oauthlib==0.5.0",
            "six==1.9.0",
            "supervisor==3.1.3",
            "tzlocal==1.1.3"
        ],
        entry_points="""
            [console_scripts]
            mezzanine-project=mezzanine.bin.mezzanine_project:create_project
        """,
        test_suite="mezzanine.bin.runtests.main",
        tests_require=["pyflakes>=0.6.1", "pep8>=1.4.1"],
        classifiers=[
            "Development Status :: 5 - Production/Stable",
            "Environment :: Web Environment",
            "Framework :: Django",
            "Intended Audience :: Developers",
            "License :: OSI Approved :: BSD License",
            "Operating System :: OS Independent",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2.7",
            "Topic :: Internet :: WWW/HTTP",
            "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
            "Topic :: Internet :: WWW/HTTP :: WSGI",
            "Topic :: Software Development :: Libraries :: "
                                                "Application Frameworks",
            "Topic :: Software Development :: Libraries :: Python Modules",
        ])
finally:
    for e in exclude:
        if exclude[e] is not None:
            data, stat = exclude[e]
            try:
                with open(e, "w") as f:
                    f.write(data)
                os.chown(e, stat.st_uid, stat.st_gid)
                os.chmod(e, stat.st_mode)
            except:
                pass
<commit_msg>added requirement for solid-i18n<commit_after>import os
import sys
from setuptools import setup, find_packages
from shutil import rmtree
from mezzanine import __version__ as version

exclude = ["mezzanine/project_template/dev.db",
           "mezzanine/project_template/local_settings.py"]
if sys.argv == ["setup.py", "test"]:
    exclude = []
exclude = dict([(e, None) for e in exclude])

for e in exclude:
    if e.endswith(".py"):
        try:
            os.remove("%sc" % e)
        except:
            pass
    try:
        with open(e, "r") as f:
            exclude[e] = (f.read(), os.stat(e))
        os.remove(e)
    except:
        pass

if sys.argv[:2] == ["setup.py", "bdist_wheel"]:
    # Remove previous build dir when creating a wheel build,
    # since if files have been removed from the project,
    # they'll still be cached in the build dir and end up
    # as part of the build, which is really neat!
    try:
        rmtree("build")
    except:
        pass

try:
    setup(
        name="Mezzanine",
        version=version,
        author="Stephen McDonald",
        author_email="stephen.mc@gmail.com",
        description="An open source content management platform built using "
                    "the Django framework.",
        long_description=open("README.rst", 'rb').read().decode('utf-8'),
        license="BSD",
        url="http://mezzanine.jupo.org/",
        zip_safe=False,
        include_package_data=True,
        packages=find_packages(),
        install_requires=[
            "beautifulsoup4==4.3.2",
            "bleach==1.4.1",
            "chardet==2.3.0",
            "Django >= 1.8.1, < 1.9",
            "django-backbone==0.3.2",
            "django-compressor==1.5",
            "django-contrib-comments==1.6.0",
            "django-modeltranslation==0.9.1",
            "django-solo==1.1.0",
            "filebrowser-safe==0.3.8",
            "future==0.14.3",
            "grappelli-safe==0.3.13",
            "gunicorn==19.3.0",
            "html5lib==1.0b6",
            "oauthlib==0.7.2",
            "pep8==1.6.2",
            "pillow==2.8.1",
            "pyflakes==0.8.1",
            "psycopg2==2.6",
            "pytz==2015.2",
            "requests==2.7.0",
            "requests-oauthlib==0.5.0",
            "six==1.9.0",
            "solid-i18n==1.1.0",
            "supervisor==3.1.3",
            "tzlocal==1.1.3"
        ],
        entry_points="""
            [console_scripts]
            mezzanine-project=mezzanine.bin.mezzanine_project:create_project
        """,
        test_suite="mezzanine.bin.runtests.main",
        tests_require=["pyflakes>=0.6.1", "pep8>=1.4.1"],
        classifiers=[
            "Development Status :: 5 - Production/Stable",
            "Environment :: Web Environment",
            "Framework :: Django",
            "Intended Audience :: Developers",
            "License :: OSI Approved :: BSD License",
            "Operating System :: OS Independent",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2.7",
            "Topic :: Internet :: WWW/HTTP",
            "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
            "Topic :: Internet :: WWW/HTTP :: WSGI",
            "Topic :: Software Development :: Libraries :: "
                                                "Application Frameworks",
            "Topic :: Software Development :: Libraries :: Python Modules",
        ])
finally:
    for e in exclude:
        if exclude[e] is not None:
            data, stat = exclude[e]
            try:
                with open(e, "w") as f:
                    f.write(data)
                os.chown(e, stat.st_uid, stat.st_gid)
                os.chmod(e, stat.st_mode)
            except:
                pass
<|endoftext|>


<commit_before>r"""

comtypes
--------

**comtypes** is a lightweight Python COM package, based on the ctypes_
FFI library, in less than 10000 lines of code (not counting the
tests).

**comtypes** allows to define, call, and implement custom and
dispatch-based COM interfaces in pure Python.  It works on Windows,
64-bit Windows, and Windows CE.

Documentation:

    http://starship.python.net/crew/theller/comtypes/

SVN repository:

    checkout: `https://comtypes.svn.sourceforge.net/svnroot/comtypes/`_

    ViewVC: https://comtypes.svn.sourceforge.net/comtypes/

Mailing list:

    http://gmane.org/info.php?group=gmane.comp.python.comtypes.user

    https://lists.sourceforge.net/lists/listinfo/comtypes-users/

Releases can be downloaded in the sourceforge files_ section.

.. _files: http://sourceforge.net/project/showfiles.php?group_id=115265

.. _`https://comtypes.svn.sourceforge.net/svnroot/comtypes/`: https://comtypes.svn.sourceforge.net/svnroot/comtypes/#egg=comtypes-dev

.. _ctypes: http://docs.python.org/lib/module-ctypes.html
"""
import sys, os
from distutils.core import setup, Command, DistutilsOptionError

try:
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
    from distutils.command.build_py import build_py

class test(Command):
    # Original version of this class posted
    # by Berthold Hoellmann to distutils-sig@python.org
    description = "run tests"

    user_options = [
        ('tests=', 't',
         "comma-separated list of packages that contain test modules"),
        ('use-resources=', 'u',
         "resources to use - resource names are defined by tests"),
        ('refcounts', 'r',
         "repeat tests to search for refcount leaks (requires 'sys.gettotalrefcount')"),
        ]

    boolean_options = ["refcounts"]

    def initialize_options(self):
        self.use_resources = ""
        self.refcounts = False
        self.tests = "comtypes.test"

    # initialize_options()

    def finalize_options(self):
        if self.refcounts and not hasattr(sys, "gettotalrefcount"):
            raise DistutilsOptionError("refcount option requires Python debug build")
        self.tests = self.tests.split(",")
        self.use_resources = self.use_resources.split(",")

    # finalize_options()

    def run(self):
        build = self.reinitialize_command('build')
        build.run()
        if build.build_lib is not None:
            sys.path.insert(0, build.build_lib)

        import comtypes.test
        comtypes.test.use_resources.extend(self.use_resources)

        for name in self.tests:
            package = __import__(name, globals(), locals(), ['*'])
            sys.stdout.write("Testing package %s %s\n"
                             % (name, (sys.version, sys.platform, os.name)))
            comtypes.test.run_tests(package,
                                    "test_*.py",
                                    self.verbose,
                                    self.refcounts)

    # run()

# class test

classifiers = [
##    'Development Status :: 3 - Alpha',
    'Development Status :: 4 - Beta',
##    'Development Status :: 5 - Production/Stable',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Operating System :: Microsoft :: Windows',
##    'Operating System :: Microsoft :: Windows CE', # pypi doesn't have this classifier
    'Programming Language :: Python',
    'Topic :: Software Development :: Libraries :: Python Modules',
    ]

def read_version():
    # Determine the version number by reading it from the file
    # 'comtypes\__init__.py'.  We cannot import this file (with py3,
    # at least) because it is in py2.x syntax.
    ns = {}
    for line in open("comtypes\__init__.py"):
        if line.startswith("__version__ = "):
            exec(line, ns)
            break
    return ns["__version__"]

if sys.version_info >= (3, 0):
    # install_script does not work in Python 3 (python bug)
    # Another python bug(?): it doesn't accept an empty options dict ???
    options = {"foo": {}}
else:
    options={"bdist_wininst": {"install_script": "clear_comtypes_cache.py"}},

setup(name="comtypes",
      description="Pure Python COM package",
      long_description = __doc__,
      author="Thomas Heller",
      author_email="theller@python.net",
      url="http://starship.python.net/crew/theller/comtypes",
      download_url = "http://sourceforge.net/project/showfiles.php?group_id=115265",

      license="MIT License",
      package_data = {"comtypes.test": ["TestComServer.idl",
                                        "TestComServer.tlb"]},
      classifiers=classifiers,

      scripts=["clear_comtypes_cache.py"],
      options=options,

      cmdclass = {'test': test,
                  'build_py': build_py},

      version=read_version(),
      packages=["comtypes",
                "comtypes.client",
                "comtypes.server",
                "comtypes.tools",
                "comtypes.test"])
<commit_msg>Fix a silly bug, and add workaround work a distutils problem.<commit_after>r"""

comtypes
--------

**comtypes** is a lightweight Python COM package, based on the ctypes_
FFI library, in less than 10000 lines of code (not counting the
tests).

**comtypes** allows to define, call, and implement custom and
dispatch-based COM interfaces in pure Python.  It works on Windows,
64-bit Windows, and Windows CE.

Documentation:

    http://starship.python.net/crew/theller/comtypes/

SVN repository:

    checkout: `https://comtypes.svn.sourceforge.net/svnroot/comtypes/`_

    ViewVC: https://comtypes.svn.sourceforge.net/comtypes/

Mailing list:

    http://gmane.org/info.php?group=gmane.comp.python.comtypes.user

    https://lists.sourceforge.net/lists/listinfo/comtypes-users/

Releases can be downloaded in the sourceforge files_ section.

.. _files: http://sourceforge.net/project/showfiles.php?group_id=115265

.. _`https://comtypes.svn.sourceforge.net/svnroot/comtypes/`: https://comtypes.svn.sourceforge.net/svnroot/comtypes/#egg=comtypes-dev

.. _ctypes: http://docs.python.org/lib/module-ctypes.html
"""
import sys, os
from distutils.core import setup, Command, DistutilsOptionError

try:
    from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
    from distutils.command.build_py import build_py

class test(Command):
    # Original version of this class posted
    # by Berthold Hoellmann to distutils-sig@python.org
    description = "run tests"

    user_options = [
        ('tests=', 't',
         "comma-separated list of packages that contain test modules"),
        ('use-resources=', 'u',
         "resources to use - resource names are defined by tests"),
        ('refcounts', 'r',
         "repeat tests to search for refcount leaks (requires 'sys.gettotalrefcount')"),
        ]

    boolean_options = ["refcounts"]

    def initialize_options(self):
        self.use_resources = ""
        self.refcounts = False
        self.tests = "comtypes.test"

    # initialize_options()

    def finalize_options(self):
        if self.refcounts and not hasattr(sys, "gettotalrefcount"):
            raise DistutilsOptionError("refcount option requires Python debug build")
        self.tests = self.tests.split(",")
        self.use_resources = self.use_resources.split(",")

    # finalize_options()

    def run(self):
        build = self.reinitialize_command('build')
        build.run()
        if build.build_lib is not None:
            sys.path.insert(0, build.build_lib)

        import comtypes.test
        comtypes.test.use_resources.extend(self.use_resources)

        for name in self.tests:
            package = __import__(name, globals(), locals(), ['*'])
            sys.stdout.write("Testing package %s %s\n"
                             % (name, (sys.version, sys.platform, os.name)))
            comtypes.test.run_tests(package,
                                    "test_*.py",
                                    self.verbose,
                                    self.refcounts)

    # run()

# class test

classifiers = [
##    'Development Status :: 3 - Alpha',
    'Development Status :: 4 - Beta',
##    'Development Status :: 5 - Production/Stable',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Operating System :: Microsoft :: Windows',
##    'Operating System :: Microsoft :: Windows CE', # pypi doesn't have this classifier
    'Programming Language :: Python',
    'Topic :: Software Development :: Libraries :: Python Modules',
    ]

def read_version():
    # Determine the version number by reading it from the file
    # 'comtypes\__init__.py'.  We cannot import this file (with py3,
    # at least) because it is in py2.x syntax.
    ns = {}
    for line in open("comtypes\__init__.py"):
        if line.startswith("__version__ = "):
            exec(line, ns)
            break
    return ns["__version__"]

if sys.version_info >= (3, 0):
    # install_script does not work in Python 3 (python bug)
    # Another distutils bug: it doesn't accept an empty options dict
    options = {"foo": {}}
##    options = {}
else:
    options={"bdist_wininst": {"install_script": "clear_comtypes_cache.py"}}

setup(name="comtypes",
      description="Pure Python COM package",
      long_description = __doc__,
      author="Thomas Heller",
      author_email="theller@python.net",
      url="http://starship.python.net/crew/theller/comtypes",
      download_url = "http://sourceforge.net/project/showfiles.php?group_id=115265",

      license="MIT License",
      package_data = {"comtypes.test": ["TestComServer.idl",
                                        "TestComServer.tlb"]},
      classifiers=classifiers,

      scripts=["clear_comtypes_cache.py"],
      options=options,

      cmdclass = {'test': test,
                  'build_py': build_py},

      version=read_version(),
      packages=["comtypes",
                "comtypes.client",
                "comtypes.server",
                "comtypes.tools",
                "comtypes.test"])
<|endoftext|>


<commit_before>import os
from distutils.core import setup

import sys
import _version

if sys.version_info[0] == 2:
    base_dir = 'python2.7'
elif sys.version_info[0] == 3:
    base_dir = 'python3.5'

__version__ = _version.__version__

def basedir(name):
    return os.path.join(base_dir, name)

with open(os.path.join(os.path.dirname(__file__), base_dir, 'requirements.txt'), 'r') as f:
    requirements = [l.strip() for l in f.readlines() if l.strip()]

setup(
    name='dnutils',
    packages=['dnutils', 'dnutils._version'],
    package_dir={
        'dnutils': basedir('dnutils'),
        'dnutils._version': '_version',
    },
    version=__version__,
    description='A collection of convenience tools for everyday Python programming',
    author='Daniel Nyga',
    author_email='daniel.nyga@t-online.de',
    url='https://spritinio.de/dnutils',
    download_url='https://github.com/danielnyga/dnutils/archive/%s.tar.gz' % __version__,
    keywords=['testing', 'logging', 'threading', 'multithreading', 'debugging', 'tools', 'utilities'],
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: System :: Logging',
        'Topic :: Utilities'

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
    ],
    install_requires=requirements,
)<commit_msg>fix comma<commit_after>import os
from distutils.core import setup

import sys
import _version

if sys.version_info[0] == 2:
    base_dir = 'python2.7'
elif sys.version_info[0] == 3:
    base_dir = 'python3.5'

__version__ = _version.__version__

def basedir(name):
    return os.path.join(base_dir, name)

with open(os.path.join(os.path.dirname(__file__), base_dir, 'requirements.txt'), 'r') as f:
    requirements = [l.strip() for l in f.readlines() if l.strip()]

setup(
    name='dnutils',
    packages=['dnutils', 'dnutils._version'],
    package_dir={
        'dnutils': basedir('dnutils'),
        'dnutils._version': '_version',
    },
    version=__version__,
    description='A collection of convenience tools for everyday Python programming',
    author='Daniel Nyga',
    author_email='daniel.nyga@t-online.de',
    url='https://spritinio.de/dnutils',
    download_url='https://github.com/danielnyga/dnutils/archive/%s.tar.gz' % __version__,
    keywords=['testing', 'logging', 'threading', 'multithreading', 'debugging', 'tools', 'utilities'],
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: System :: Logging',
        'Topic :: Utilities',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
    ],
    install_requires=requirements,
)<|endoftext|>