<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

import glob, os, re, setuptools, sys
from os.path import join

# List all data files
def data():
    r = {}
    for root, dirnames, filenames in os.walk('openerp'):
        for filename in filenames:
            if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
                r.setdefault(root, []).append(os.path.join(root, filename))

    if os.name == 'nt':
        r["Microsoft.VC90.CRT"] = glob.glob('C:\Microsoft.VC90.CRT\*.*')

        import babel
        r["localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*'))

        import pytz
        tzdir = os.path.dirname(pytz.__file__)
        for root, _, filenames in os.walk(os.path.join(tzdir, "zoneinfo")):
            base = os.path.join('pytz', root[len(tzdir) + 1:])
            r[base] = [os.path.join(root, f) for f in filenames]

    return r.items()

def gen_manifest():
    file_list="\n".join(data())
    open('MANIFEST','w').write(file_list)

if os.name == 'nt':
    sys.path.append("C:\Microsoft.VC90.CRT")

def py2exe_options():
    if os.name == 'nt':
        import py2exe
        return {
            "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
            'options' : {
                "py2exe": {
                    "skip_archive": 1,
                    "optimize": 2,
                    "dist_dir": 'dist',
                    "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "docutils", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "pytz", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
                    "excludes" : ["Tkconstants","Tkinter","tcl"],
                }
            }
        }
    else:
        return {}

execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))

# Notes for OpenERP developer on windows:
#
# To setup a windows developer evironement install python2.7 then pip and use
# "pip install <depencey>" for every dependency listed below.
#
# Dependecies that requires DLLs are not installable with pip install, for
# them we added comments with links where you can find the installers.
#
# OpenERP on windows also require the pywin32, the binary can be found at
# http://pywin32.sf.net
#
# Both python2.7 32bits and 64bits are known to work.

setuptools.setup(
      name             = 'openerp',
      version          = version,
      description      = description,
      long_description = long_desc,
      url              = url,
      author           = author,
      author_email     = author_email,
      classifiers      = filter(None, classifiers.split("\n")),
      license          = license,
      scripts          = ['openerp-server'],
      data_files       = data(),
      packages         = setuptools.find_packages(),
      dependency_links = ['http://download.gna.org/pychart/'],
      #include_package_data = True,
      install_requires = [
          'pychart', # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
          'babel',
          'docutils',
          'feedparser',
          'gdata',
          'lxml < 3', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
          'mako',
          'mock',
          'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
          'psutil', # windows binary code.google.com/p/psutil/downloads/list
          'psycopg2',
          'pydot',
          'python-dateutil < 2',
          'python-ldap', # optional
          'python-openid',
          'pytz',
          'pywebdav',
          'pyyaml',
          'reportlab', # windows binary pypi.python.org/pypi/reportlab
          'simplejson',
          'unittest2',
          'vatnumber',
          'vobject',
          'werkzeug',
          'xlwt',
      ],
      extras_require = {
          'SSL' : ['pyopenssl'],
      },
      tests_require = ['unittest2'],
      **py2exe_options()
)

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
<commit_msg>[FIX] unpin LXML as 3.0 official has been released<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

import glob, os, re, setuptools, sys
from os.path import join

# List all data files
def data():
    r = {}
    for root, dirnames, filenames in os.walk('openerp'):
        for filename in filenames:
            if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
                r.setdefault(root, []).append(os.path.join(root, filename))

    if os.name == 'nt':
        r["Microsoft.VC90.CRT"] = glob.glob('C:\Microsoft.VC90.CRT\*.*')

        import babel
        r["localedata"] = glob.glob(os.path.join(os.path.dirname(babel.__file__), "localedata", '*'))

        import pytz
        tzdir = os.path.dirname(pytz.__file__)
        for root, _, filenames in os.walk(os.path.join(tzdir, "zoneinfo")):
            base = os.path.join('pytz', root[len(tzdir) + 1:])
            r[base] = [os.path.join(root, f) for f in filenames]

    return r.items()

def gen_manifest():
    file_list="\n".join(data())
    open('MANIFEST','w').write(file_list)

if os.name == 'nt':
    sys.path.append("C:\Microsoft.VC90.CRT")

def py2exe_options():
    if os.name == 'nt':
        import py2exe
        return {
            "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
            'options' : {
                "py2exe": {
                    "skip_archive": 1,
                    "optimize": 2,
                    "dist_dir": 'dist',
                    "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "docutils", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "pytz", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
                    "excludes" : ["Tkconstants","Tkinter","tcl"],
                }
            }
        }
    else:
        return {}

execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))

# Notes for OpenERP developer on windows:
#
# To setup a windows developer evironement install python2.7 then pip and use
# "pip install <depencey>" for every dependency listed below.
#
# Dependecies that requires DLLs are not installable with pip install, for
# them we added comments with links where you can find the installers.
#
# OpenERP on windows also require the pywin32, the binary can be found at
# http://pywin32.sf.net
#
# Both python2.7 32bits and 64bits are known to work.

setuptools.setup(
      name             = 'openerp',
      version          = version,
      description      = description,
      long_description = long_desc,
      url              = url,
      author           = author,
      author_email     = author_email,
      classifiers      = filter(None, classifiers.split("\n")),
      license          = license,
      scripts          = ['openerp-server'],
      data_files       = data(),
      packages         = setuptools.find_packages(),
      dependency_links = ['http://download.gna.org/pychart/'],
      #include_package_data = True,
      install_requires = [
          'pychart', # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
          'babel',
          'docutils',
          'feedparser',
          'gdata',
          'lxml', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
          'mako',
          'mock',
          'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
          'psutil', # windows binary code.google.com/p/psutil/downloads/list
          'psycopg2',
          'pydot',
          'python-dateutil < 2',
          'python-ldap', # optional
          'python-openid',
          'pytz',
          'pywebdav',
          'pyyaml',
          'reportlab', # windows binary pypi.python.org/pypi/reportlab
          'simplejson',
          'unittest2',
          'vatnumber',
          'vobject',
          'werkzeug',
          'xlwt',
      ],
      extras_require = {
          'SSL' : ['pyopenssl'],
      },
      tests_require = ['unittest2'],
      **py2exe_options()
)

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
<|endoftext|>


<commit_before>
NAME = 'PyYAML'
VERSION = '3.04'
DESCRIPTION = "YAML parser and emitter for Python"
LONG_DESCRIPTION = """\
YAML is a data serialization format designed for human readability and
interaction with scripting languages.  PyYAML is a YAML parser and
emitter for Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
support, capable extension API, and sensible error messages.  PyYAML
supports standard YAML tags and provides Python-specific tags that allow
to represent an arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex
configuration files to object serialization and persistance."""
AUTHOR = "Kirill Simonov"
AUTHOR_EMAIL = 'xi@resolvent.net'
LICENSE = "MIT"
PLATFORMS = "Any"
URL = "http://pyyaml.org/wiki/PyYAML"
DOWNLOAD_URL = "http://pyyaml.org/download/pyyaml/%s-%s.tar.gz" % (NAME, VERSION)
CLASSIFIERS = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Text Processing :: Markup",
]

from distutils.core import setup

if __name__ == '__main__':

    setup(
        name=NAME,
        version=VERSION,
        description=DESCRIPTION,
        long_description=LONG_DESCRIPTION,
        author=AUTHOR,
        author_email=AUTHOR_EMAIL,
        license=LICENSE,
        platforms=PLATFORMS,
        url=URL,
        download_url=DOWNLOAD_URL,
        classifiers=CLASSIFIERS,

        package_dir={'': 'lib'},
        packages=['yaml'],
    )

<commit_msg>Update the package version.<commit_after>
NAME = 'PyYAML'
VERSION = '3.05'
DESCRIPTION = "YAML parser and emitter for Python"
LONG_DESCRIPTION = """\
YAML is a data serialization format designed for human readability and
interaction with scripting languages.  PyYAML is a YAML parser and
emitter for Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
support, capable extension API, and sensible error messages.  PyYAML
supports standard YAML tags and provides Python-specific tags that allow
to represent an arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex
configuration files to object serialization and persistance."""
AUTHOR = "Kirill Simonov"
AUTHOR_EMAIL = 'xi@resolvent.net'
LICENSE = "MIT"
PLATFORMS = "Any"
URL = "http://pyyaml.org/wiki/PyYAML"
DOWNLOAD_URL = "http://pyyaml.org/download/pyyaml/%s-%s.tar.gz" % (NAME, VERSION)
CLASSIFIERS = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Text Processing :: Markup",
]

from distutils.core import setup

if __name__ == '__main__':

    setup(
        name=NAME,
        version=VERSION,
        description=DESCRIPTION,
        long_description=LONG_DESCRIPTION,
        author=AUTHOR,
        author_email=AUTHOR_EMAIL,
        license=LICENSE,
        platforms=PLATFORMS,
        url=URL,
        download_url=DOWNLOAD_URL,
        classifiers=CLASSIFIERS,

        package_dir={'': 'lib'},
        packages=['yaml'],
    )

<|endoftext|>


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

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import re
import sys

from distutils.core import setup
from setuptools import find_packages

_package_root = "src/py"
_root_package = 'gopythongo'

with open("src/py/gopythongo/__init__.py", "rt", encoding="utf-8") as vf:
    lines = vf.readlines()

_version = "0.0.0+local"
for l in lines:
    m = re.match("version = \"(.*?)\"", l)
    if m:
        _version = m.group(1)

_packages = find_packages(_package_root, exclude=["*.tests", "*.tests.*", "tests.*", "tests"])

_requirements = [
    'Jinja2==2.9.6',
    'ConfigArgParse==0.12.0',
    'Sphinx==1.6.2',
    'sphinx-rtd-theme==0.2.4',
    'colorama==0.3.9',
    'semantic-version==2.6.0',
    'packaging==16.8',
    'typing==3.6.1',
    'hvac==0.2.17',
    'docker-py==1.10.6',
    'dockerpty==0.4.1',
    'pyopenssl==17.1.0',
    'bumpversion==0.5.3',
]

if sys.version_info.major < 3 or (sys.version_info.major == 3 and sys.version_info.minor < 3):
    _requirements.append('backports.shutil_get_terminal_size==1.0.0')

setup(
    name='gopythongo',
    version=_version,
    packages=_packages,
    package_dir={
        '': _package_root,
    },
    entry_points={
        "console_scripts": [
            "gopythongo = gopythongo.main:main",
            "vaultwrapper = gopythongo.vaultwrapper:main",
            "vaultgetcert = gopythongo.vaultgetcert:main",
        ]
    },
    install_requires=_requirements,
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "Environment :: Console",
        "Programming Language :: Python :: 3 :: Only",
        "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
        "Operating System :: POSIX",
    ],
    author="Jonas Maurus (@jdelic)",
    author_email="jonas@gopythongo.com",
    maintainer="GoPythonGo.com",
    maintainer_email="info@gopythongo.com",
    description="Build shippable virtualenvs",
)
<commit_msg>[requires.io] dependency update<commit_after>#!/usr/bin/python
# -* encoding: utf-8 *-

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import re
import sys

from distutils.core import setup
from setuptools import find_packages

_package_root = "src/py"
_root_package = 'gopythongo'

with open("src/py/gopythongo/__init__.py", "rt", encoding="utf-8") as vf:
    lines = vf.readlines()

_version = "0.0.0+local"
for l in lines:
    m = re.match("version = \"(.*?)\"", l)
    if m:
        _version = m.group(1)

_packages = find_packages(_package_root, exclude=["*.tests", "*.tests.*", "tests.*", "tests"])

_requirements = [
    'Jinja2==2.9.6',
    'ConfigArgParse==0.12.0',
    'Sphinx==1.6.3',
    'sphinx-rtd-theme==0.2.4',
    'colorama==0.3.9',
    'semantic-version==2.6.0',
    'packaging==16.8',
    'typing==3.6.1',
    'hvac==0.2.17',
    'docker-py==1.10.6',
    'dockerpty==0.4.1',
    'pyopenssl==17.1.0',
    'bumpversion==0.5.3',
]

if sys.version_info.major < 3 or (sys.version_info.major == 3 and sys.version_info.minor < 3):
    _requirements.append('backports.shutil_get_terminal_size==1.0.0')

setup(
    name='gopythongo',
    version=_version,
    packages=_packages,
    package_dir={
        '': _package_root,
    },
    entry_points={
        "console_scripts": [
            "gopythongo = gopythongo.main:main",
            "vaultwrapper = gopythongo.vaultwrapper:main",
            "vaultgetcert = gopythongo.vaultgetcert:main",
        ]
    },
    install_requires=_requirements,
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "Environment :: Console",
        "Programming Language :: Python :: 3 :: Only",
        "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
        "Operating System :: POSIX",
    ],
    author="Jonas Maurus (@jdelic)",
    author_email="jonas@gopythongo.com",
    maintainer="GoPythonGo.com",
    maintainer_email="info@gopythongo.com",
    description="Build shippable virtualenvs",
)
<|endoftext|>


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

from setuptools import setup

# Explicitly list bin scripts to be installed, seeing as I have a few local
# bin files that are not (yet) part of the distribution.
scripts = [
    'bin/aa-info.py',
    'bin/aa-to-properties.py',
    'bin/adaptor-distances.py',
    'bin/alignments-per-read.py',
    'bin/bit-score-to-e-value.py',
    'bin/cat-json-blast-records.py',
    'bin/check-fasta-json-blast-consistency.py',
    'bin/codon-distance.py',
    'bin/convert-blast-xml-to-json.py',
    'bin/convert-fasta-to-one-sequence-per-line.py',
    'bin/convert-fastq-to-fasta.py',
    'bin/convert-sam-to-fastq.sh',
    'bin/dna-to-aa.py',
    'bin/e-value-to-bit-score.py',
    'bin/extract-ORFs.py',
    'bin/fasta-subset.py',
    'bin/fasta-subtraction.py',
    'bin/filter-fasta-by-complexity.py',
    'bin/filter-fasta-by-taxonomy.py',
    'bin/filter-fasta.py',
    'bin/filter-hits-to-fasta.py',
    'bin/find-hits.py',
    'bin/get-features.py',
    'bin/get-reads.py',
    'bin/graph-evalues.py',
    'bin/local-align.py',
    'bin/noninteractive-alignment-panel.py',
    'bin/position-summary.py',
    'bin/pre-commit.sh',
    'bin/print-blast-xml-for-derek.py',
    'bin/print-blast-xml.py',
    'bin/print-read-lengths.py',
    'bin/randomize-fasta.py',
    'bin/read-blast-json.py',
    'bin/read-blast-xml.py',
    'bin/sff-to-fastq.py',
    'bin/split-fasta-by-adaptors.py',
    'bin/summarize-reads.py',
    'bin/trim-primers.py',
    'bin/trim-reads.py',
    'bin/write-htcondor-job-spec.py',
]

setup(name='dark-matter',
      version='1.0.40',
      packages=['dark', 'dark.blast'],
      include_package_data=True,
      url='https://github.com/acorg/dark-matter',
      download_url='https://github.com/acorg/dark-matter',
      author='Terry Jones, Barbara Muehlemann, Sophie Mathias',
      author_email='tcj25@cam.ac.uk',
      keywords=['virus discovery'],
      classifiers=[
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Operating System :: OS Independent',
          'Topic :: Software Development :: Libraries :: Python Modules',
      ],
      license='MIT',
      description='Python classes for working with genetic sequence data',
      scripts=scripts,
      install_requires=['cffi>=1.0.0'],
      setup_requires=['cffi>=1.0.0'],
      cffi_modules=[
          './src/gor4/build.py:ffi',
      ])
<commit_msg>Bumped version number.<commit_after>#!/usr/bin/env python

from setuptools import setup

# Explicitly list bin scripts to be installed, seeing as I have a few local
# bin files that are not (yet) part of the distribution.
scripts = [
    'bin/aa-info.py',
    'bin/aa-to-properties.py',
    'bin/adaptor-distances.py',
    'bin/alignments-per-read.py',
    'bin/bit-score-to-e-value.py',
    'bin/cat-json-blast-records.py',
    'bin/check-fasta-json-blast-consistency.py',
    'bin/codon-distance.py',
    'bin/convert-blast-xml-to-json.py',
    'bin/convert-fasta-to-one-sequence-per-line.py',
    'bin/convert-fastq-to-fasta.py',
    'bin/convert-sam-to-fastq.sh',
    'bin/dna-to-aa.py',
    'bin/e-value-to-bit-score.py',
    'bin/extract-ORFs.py',
    'bin/fasta-subset.py',
    'bin/fasta-subtraction.py',
    'bin/filter-fasta-by-complexity.py',
    'bin/filter-fasta-by-taxonomy.py',
    'bin/filter-fasta.py',
    'bin/filter-hits-to-fasta.py',
    'bin/find-hits.py',
    'bin/get-features.py',
    'bin/get-reads.py',
    'bin/graph-evalues.py',
    'bin/local-align.py',
    'bin/noninteractive-alignment-panel.py',
    'bin/position-summary.py',
    'bin/pre-commit.sh',
    'bin/print-blast-xml-for-derek.py',
    'bin/print-blast-xml.py',
    'bin/print-read-lengths.py',
    'bin/randomize-fasta.py',
    'bin/read-blast-json.py',
    'bin/read-blast-xml.py',
    'bin/sff-to-fastq.py',
    'bin/split-fasta-by-adaptors.py',
    'bin/summarize-reads.py',
    'bin/trim-primers.py',
    'bin/trim-reads.py',
    'bin/write-htcondor-job-spec.py',
]

setup(name='dark-matter',
      version='1.0.41',
      packages=['dark', 'dark.blast'],
      include_package_data=True,
      url='https://github.com/acorg/dark-matter',
      download_url='https://github.com/acorg/dark-matter',
      author='Terry Jones, Barbara Muehlemann, Sophie Mathias',
      author_email='tcj25@cam.ac.uk',
      keywords=['virus discovery'],
      classifiers=[
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Operating System :: OS Independent',
          'Topic :: Software Development :: Libraries :: Python Modules',
      ],
      license='MIT',
      description='Python classes for working with genetic sequence data',
      scripts=scripts,
      install_requires=['cffi>=1.0.0'],
      setup_requires=['cffi>=1.0.0'],
      cffi_modules=[
          './src/gor4/build.py:ffi',
      ])
<|endoftext|>


<commit_before>from distutils.core import setup
setup(
          name = 'cleverwrap',
          packages = ['cleverwrap'],
          license = 'MIT',
          install_requires = ['requests']
          version = '0.2.3',
          description = 'A wrapper for the official cleverbot.com API',
          author = 'Andrew Edwards',
          author_email = 'andrewthomasedwards@gmail.com',
          url = 'https://github.com/edwardslabs/cleverwrap.py',
          download_url = 'https://github.com/edwardslabs/cleverwrap.py/tarball/0.2.3',
          keywords = ['cleverbot', 'wrapper', 'clever'],
          classifiers =(
              'Programming Language :: Python :: 3 :: Only',
              'License :: OSI Approved :: MIT License',
              'Intended Audience :: Developers',
              'Natural Language :: English'
          ),
)
<commit_msg>missing comma<commit_after>from distutils.core import setup
setup(
          name = 'cleverwrap',
          packages = ['cleverwrap'],
          license = 'MIT',
          install_requires = ['requests'],
          version = '0.2.3.1',
          description = 'A wrapper for the official cleverbot.com API',
          author = 'Andrew Edwards',
          author_email = 'andrewthomasedwards@gmail.com',
          url = 'https://github.com/edwardslabs/cleverwrap.py',
          download_url = 'https://github.com/edwardslabs/cleverwrap.py/tarball/0.2.3.1',
          keywords = ['cleverbot', 'wrapper', 'clever'],
          classifiers =(
              'Programming Language :: Python :: 3 :: Only',
              'License :: OSI Approved :: MIT License',
              'Intended Audience :: Developers',
              'Natural Language :: English'
          ),
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from __future__ import print_function

try:
    from Cython.Build import cythonize
    import Cython
except ImportError:
    raise RuntimeError('No cython installed. Please run `pip install cython`')

if Cython.__version__ < '0.19.1':
    raise RuntimeError('Old cython installed (%s). Please run `pip install -U cython`' % Cython.__version__)

import pkg_resources
setuptools_version = pkg_resources.get_distribution("setuptools").version
if setuptools_version < '0.8':
    raise RuntimeError('Old setuptools installed (%s). Please run `pip install -U setuptools`. Running `pip install pycapnp` will not work alone, since setuptools needs to be upgraded before installing anything else.' % setuptools_version)

from distutils.core import setup
import os
from buildutils import test_build, fetch_libcapnp, build_libcapnp, info
from distutils.errors import CompileError
from distutils.extension import Extension
from Cython.Distutils import build_ext as build_ext_c
_this_dir = os.path.dirname(__file__)

MAJOR = 0
MINOR = 4
MICRO = 6
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

# Write version info
def write_version_py(filename=None):
    cnt = """\
version = '%s'
short_version = '%s'

from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR
from .lib.capnp import _CAPNP_VERSION_MINOR as LIBCAPNP_VERSION_MINOR
from .lib.capnp import _CAPNP_VERSION_MICRO as LIBCAPNP_VERSION_MICRO
from .lib.capnp import _CAPNP_VERSION as LIBCAPNP_VERSION
"""
    if not filename:
        filename = os.path.join(
            os.path.dirname(__file__), 'capnp', 'version.py')

    a = open(filename, 'w')
    try:
        a.write(cnt % (VERSION, VERSION))
    finally:
        a.close()

write_version_py()

# Try to convert README using pandoc
try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
    long_description = ''

# Clean command, invoked with `python setup.py clean`
from distutils.command.clean import clean as _clean
class clean(_clean):
    def run(self):
        _clean.run(self)
        for x in [ 'capnp/lib/capnp.cpp', 'capnp/lib/capnp.h', 'capnp/version.py' ]:
            print('removing %s' % x)
            try:
                os.remove(x)
            except OSError:
                pass

class build_libcapnp_ext(build_ext_c):

    def build_extension(self, ext):
        build_ext_c.build_extension(self, ext)

    def run(self):
        try:
            test_build()
        except CompileError:
            info("*WARNING* no libcapnp detected. Will download and build it from source now. If you have C++ Cap'n Proto installed, it may be out of date or is not being detected. Downloading and building libcapnp may take a while.")
            bundle_dir = os.path.join(_this_dir, "bundled")
            if not os.path.exists(bundle_dir):
                os.mkdir(bundle_dir)
            build_dir = os.path.join(_this_dir, "build")
            if not os.path.exists(build_dir):
                os.mkdir(build_dir)
            fetch_libcapnp(bundle_dir)

            build_libcapnp(bundle_dir, build_dir)

            self.include_dirs += [os.path.join(build_dir, 'include')]
            self.library_dirs += [os.path.join(build_dir, 'lib')]

        return build_ext_c.run(self)
setup(
    name="pycapnp",
    packages=["capnp"],
    version=VERSION,
    package_data={'capnp': ['*.pxd', '*.h', '*.capnp', 'helpers/*.pxd', 'helpers/*.h', 'includes/*.pxd', 'lib/*.pxd', 'lib/*.py', 'lib/*.pyx']},
    ext_modules=cythonize('capnp/lib/*.pyx'),
    cmdclass = {
        'clean': clean,
        'build_ext': build_libcapnp_ext
    },
    install_requires=[
        'cython >= 0.21',
        'setuptools >= 0.8'],
    # PyPi info
    description="A cython wrapping of the C++ Cap'n Proto library",
    long_description=long_description,
    license='BSD',
    author="Jason Paryani",
    author_email="pypi-contact@jparyani.com",
    url = 'https://github.com/jparyani/pycapnp',
    download_url = 'https://github.com/jparyani/pycapnp/archive/v%s.zip' % VERSION,
    keywords = ['capnp', 'capnproto', "Cap'n Proto"],
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX',
        'Programming Language :: C++',
        'Programming Language :: Cython',
        'Programming Language :: Python :: 2',
        '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 :: Implementation :: PyPy',
        'Topic :: Communications'],
)
<commit_msg>Add install flags --force-bundled-libcapnp and --force-system-libcapnp<commit_after>#!/usr/bin/env python
from __future__ import print_function

try:
    from Cython.Build import cythonize
    import Cython
except ImportError:
    raise RuntimeError('No cython installed. Please run `pip install cython`')

if Cython.__version__ < '0.19.1':
    raise RuntimeError('Old cython installed (%s). Please run `pip install -U cython`' % Cython.__version__)

import pkg_resources
setuptools_version = pkg_resources.get_distribution("setuptools").version
if setuptools_version < '0.8':
    raise RuntimeError('Old setuptools installed (%s). Please run `pip install -U setuptools`. Running `pip install pycapnp` will not work alone, since setuptools needs to be upgraded before installing anything else.' % setuptools_version)

from distutils.core import setup
import os
import sys
from buildutils import test_build, fetch_libcapnp, build_libcapnp, info
from distutils.errors import CompileError
from distutils.extension import Extension
from Cython.Distutils import build_ext as build_ext_c
_this_dir = os.path.dirname(__file__)

MAJOR = 0
MINOR = 4
MICRO = 6
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

# Write version info
def write_version_py(filename=None):
    cnt = """\
version = '%s'
short_version = '%s'

from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR
from .lib.capnp import _CAPNP_VERSION_MINOR as LIBCAPNP_VERSION_MINOR
from .lib.capnp import _CAPNP_VERSION_MICRO as LIBCAPNP_VERSION_MICRO
from .lib.capnp import _CAPNP_VERSION as LIBCAPNP_VERSION
"""
    if not filename:
        filename = os.path.join(
            os.path.dirname(__file__), 'capnp', 'version.py')

    a = open(filename, 'w')
    try:
        a.write(cnt % (VERSION, VERSION))
    finally:
        a.close()

write_version_py()

# Try to convert README using pandoc
try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
    long_description = ''

# Clean command, invoked with `python setup.py clean`
from distutils.command.clean import clean as _clean
class clean(_clean):
    def run(self):
        _clean.run(self)
        for x in [ 'capnp/lib/capnp.cpp', 'capnp/lib/capnp.h', 'capnp/version.py' ]:
            print('removing %s' % x)
            try:
                os.remove(x)
            except OSError:
                pass

# hack to parse commandline arguments
force_bundled_libcapnp = "--force-bundled-libcapnp" in sys.argv
if force_bundled_libcapnp:
    sys.argv.remove("--force-bundled-libcapnp")
force_system_libcapnp = "--force-system-libcapnp" in sys.argv
if force_system_libcapnp:
    sys.argv.remove("--force-system-libcapnp")

class build_libcapnp_ext(build_ext_c):

    def build_extension(self, ext):
        build_ext_c.build_extension(self, ext)

    def run(self):
        build_failed = False
        try:
            test_build()
        except CompileError:
            build_failed = True

        if build_failed and force_system_libcapnp:
            raise RuntimeError("libcapnp C++ library not detected and --force-system-libcapnp was used")
        if build_failed or force_bundled_libcapnp:
            if build_failed:
                info("*WARNING* no libcapnp detected. Will download and build it from source now. If you have C++ Cap'n Proto installed, it may be out of date or is not being detected. Downloading and building libcapnp may take a while.")
            bundle_dir = os.path.join(_this_dir, "bundled")
            if not os.path.exists(bundle_dir):
                os.mkdir(bundle_dir)
            build_dir = os.path.join(_this_dir, "build")
            if not os.path.exists(build_dir):
                os.mkdir(build_dir)
            fetch_libcapnp(bundle_dir)

            build_libcapnp(bundle_dir, build_dir)

            self.include_dirs += [os.path.join(build_dir, 'include')]
            self.library_dirs += [os.path.join(build_dir, 'lib')]

        return build_ext_c.run(self)
setup(
    name="pycapnp",
    packages=["capnp"],
    version=VERSION,
    package_data={'capnp': ['*.pxd', '*.h', '*.capnp', 'helpers/*.pxd', 'helpers/*.h', 'includes/*.pxd', 'lib/*.pxd', 'lib/*.py', 'lib/*.pyx']},
    ext_modules=cythonize('capnp/lib/*.pyx'),
    cmdclass = {
        'clean': clean,
        'build_ext': build_libcapnp_ext
    },
    install_requires=[
        'cython >= 0.21',
        'setuptools >= 0.8'],
    # PyPi info
    description="A cython wrapping of the C++ Cap'n Proto library",
    long_description=long_description,
    license='BSD',
    author="Jason Paryani",
    author_email="pypi-contact@jparyani.com",
    url = 'https://github.com/jparyani/pycapnp',
    download_url = 'https://github.com/jparyani/pycapnp/archive/v%s.zip' % VERSION,
    keywords = ['capnp', 'capnproto', "Cap'n Proto"],
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX',
        'Programming Language :: C++',
        'Programming Language :: Cython',
        'Programming Language :: Python :: 2',
        '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 :: Implementation :: PyPy',
        'Topic :: Communications'],
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(

    name='django-oscar-adyen',
    version='0.1',
    url='https://github.com/oscaro/django-oscar-adyen',
    author='Mathieu Richardoz',
    author_email='mr@babik.fr',
    description='Adyen payment module for django-oscar',
    long_description=open('README.rst').read(),
    keywords='payment, django, oscar, adyen',
    license='BSD',
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'bleach==1.4',
        'django-oscar>=0.4',
        'requests>=2.0,<3.0',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Office/Business :: Financial :: Point-Of-Sale',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]

)
<commit_msg>Fix setup script<commit_after>from setuptools import setup, find_packages

# dirty hack to allow running sdist in a vbox
# source: Leonardo.Z's answer on this StackOverflow thread:
# http://stackoverflow.com/questions/7719380/python-setup-py-sdist-error-operation-not-permitted

import os
if os.environ.get('USER', '') == 'vagrant':
    del os.link

# /dirty hack

setup(

    name='django-oscar-adyen',
    version='0.1',
    url='https://github.com/oscaro/django-oscar-adyen',
    author='Mathieu Richardoz',
    author_email='mr@babik.fr',
    description='Adyen payment module for django-oscar',
    long_description=open('README.rst').read(),
    keywords='payment, django, oscar, adyen',
    license='BSD',
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'bleach==1.4',
        'django-oscar>=0.7,<0.8',
        'requests>=2.0,<3.0',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Office/Business :: Financial :: Point-Of-Sale',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]

)
<|endoftext|>


<commit_before>#!/usr/bin/env python
import wtforms
import os
import ez_setup
from inspect import getdoc
ez_setup.use_setuptools()

from setuptools import setup, Feature

setup(
    name='WTForms',
    version='0.2dev',
    url='http://www.bitbucket.org/prencher/wtforms/',
    download_url='http://www.bitbucket.org/prencher/wtforms/', #FIXME
    license='MIT',
    author='James Crasta, Thomas Johansson',
    author_email='jcrasta@simplecodes.com, thomas@simplecodes.com',
    description='HTTP/HTML forms handling for python',
    long_description=getdoc(wtforms),
    zip_safe=True,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    packages=['wtforms'],
    features={
        'contrib': Feature('optional contribute addon modules',
            standard=True,
            packages=['wtforms.contrib']
        )
    },
    platforms=['any'],
    include_package_data=True,
)
<commit_msg>Forgot to rename contrib to ext in setup.py. Fixed, thanks RobotAdam. Updated some metadata while at it.<commit_after>#!/usr/bin/env python
import wtforms
import os
import ez_setup
from inspect import getdoc
ez_setup.use_setuptools()

from setuptools import setup, Feature

setup(
    name='WTForms',
    version='0.2dev',
    url='http://wtforms.simplecodes.com/',
    download_url='http://wtforms.simplecodes.com/',
    license='MIT',
    author='James Crasta, Thomas Johansson',
    author_email='jcrasta@gmail.com, prencher@gmail.com',
    description='HTTP/HTML forms handling for python',
    long_description=getdoc(wtforms),
    zip_safe=True,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    packages=['wtforms'],
    features={
        'ext': Feature('Extensions to WTForms providing extra functionality',
            standard=True,
            packages=['wtforms.ext']
        )
    },
    platforms=['any'],
    include_package_data=True,
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
"""scikit-nano: python toolkit for generating nano-structures.

A python toolkit for nano-science. Currently, its primary use is for
generating nano-structure data for the following nano-materials:

    * Graphene, both single layer graphene and N-layer graphene.
    * Single-walled nanotubes (SWNTs), both single SWNTs and SWNT bundles.
    * Multi-walled nanotubes (MWNTs), both single MWNTs and MWNT bundles.

It supports saving structure data in the following formats:

    * `xyz`
    * LAMMPS `data`

"""

DOCLINES = __doc__.split("\n")

from setuptools import setup, find_packages
import os
import sys
import subprocess

if sys.version_info[:2] < (2, 7):
    raise RuntimeError("Python version 2.7 required.")

CLASSIFIERS = """\
Development Status :: 4 - Beta
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Programming Language :: Python
Programming Language :: Python :: 2.7
Topic :: Software Development
Topic :: Scientific/Engineering

"""

MAJOR = 0
MINOR = 2
MICRO = 9
ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

def git_version():
    """Return the GIT version as a string."""
    def _minimal_ext_cmd(cmd):
        # construct minimal environment
        env = {}
        for k in ['SYSTEMROOT', 'PATH']:
            v = os.environ.get(k)
            if v is not None:
                env[k] = v
        # LANGUAGE is used on win32
        env['LANGUAGE'] = 'C'
        env['LANG'] = 'C'
        env['LC_ALL'] = 'C'
        out = \
            subprocess.Popen(cmd,
                             stdout=subprocess.PIPE, env=env).communicate()[0]
        return out

    try:
        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
        GIT_REVISION = out.strip().decode('ascii')
    except OSError:
        GIT_REVISION = "Unknown"

    return GIT_REVISION

def get_version_info():
    # Adding the git rev number needs to be done inside
    # write_version_py(), otherwise the import of sknano.version messes
    # up the build under Python 3.
    FULLVERSION = VERSION
    if os.path.exists('.git'):
        GIT_REVISION = git_version()
    elif os.path.exists('sknano/version.py'):
        # must be a source distribution, use existing version file
        # load it as a separate module to not load sknano/__init__.py
        import imp
        version = imp.load_source('sknano.version', 'sknano/version.py')
        GIT_REVISION = version.git_revision
    else:
        GIT_REVISION = "Unknown"

    if not ISRELEASED:
        FULLVERSION += '.dev-' + GIT_REVISION[:7]

    return FULLVERSION, GIT_REVISION

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

if not release:
    version = full_version
"""
    FULLVERSION, GIT_REVISION = get_version_info()

    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION,
                       'full_version': FULLVERSION,
                       'git_revision': GIT_REVISION,
                       'isrelease': str(ISRELEASED)})
    finally:
        a.close()

def setup_package():

    # Rewrite the version file everytime
    write_version_py()

    FULLVERSION, GIT_REVISION = get_version_info()

    setup_options = dict(
        name='sknano',
        version=FULLVERSION,
        author='Andrew Merrill',
        author_email='androomerrill@gmail.com',
        description=DOCLINES[0],
        long_description="\n".join(DOCLINES[2:]),
        url='https://github.com/androomerrill/scikit-nano',
        license='BSD 2-Clause',
        classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
        platforms=["Windows", "Linux", "OS-X", "Unix"],
        test_suite='nose.collector',
        packages=find_packages(exclude=['doc', 'ez_setup',
                                        'examples', 'tests']),
        #package_data={'sknano': []},
        #package_dir = {'': 'sknano'},
        include_package_data=True,
        exclude_package_data={'':
            ['README', 'README.rst', '*.gif', '*.html', '*.ui']},
        zip_safe=False,
        install_requires=['numpy>=1.8', 'scipy>=0.13',
                          'pkshared>=0.1.7', 'pksci>=0.1.4'],
        entry_points={
            'console_scripts': [
                'nanogen = sknano.scripts.nanogen:main',
            ]
        }
    )

    setup(**setup_options)

if __name__ == '__main__':
    setup_package()
<commit_msg>bumping micro version for dev<commit_after># -*- coding: utf-8 -*-
"""scikit-nano: python toolkit for generating nano-structures.

A python toolkit for nano-science. Currently, its primary use is for
generating nano-structure data for the following nano-materials:

    * Graphene, both single layer graphene and N-layer graphene.
    * Single-walled nanotubes (SWNTs), both single SWNTs and SWNT bundles.
    * Multi-walled nanotubes (MWNTs), both single MWNTs and MWNT bundles.

It supports saving structure data in the following formats:

    * `xyz`
    * LAMMPS `data`

"""

DOCLINES = __doc__.split("\n")

from setuptools import setup, find_packages
import os
import sys
import subprocess

if sys.version_info[:2] < (2, 7):
    raise RuntimeError("Python version 2.7 required.")

CLASSIFIERS = """\
Development Status :: 4 - Beta
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Programming Language :: Python
Programming Language :: Python :: 2.7
Topic :: Software Development
Topic :: Scientific/Engineering

"""

MAJOR = 0
MINOR = 2
MICRO = 10
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

def git_version():
    """Return the GIT version as a string."""
    def _minimal_ext_cmd(cmd):
        # construct minimal environment
        env = {}
        for k in ['SYSTEMROOT', 'PATH']:
            v = os.environ.get(k)
            if v is not None:
                env[k] = v
        # LANGUAGE is used on win32
        env['LANGUAGE'] = 'C'
        env['LANG'] = 'C'
        env['LC_ALL'] = 'C'
        out = \
            subprocess.Popen(cmd,
                             stdout=subprocess.PIPE, env=env).communicate()[0]
        return out

    try:
        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
        GIT_REVISION = out.strip().decode('ascii')
    except OSError:
        GIT_REVISION = "Unknown"

    return GIT_REVISION

def get_version_info():
    # Adding the git rev number needs to be done inside
    # write_version_py(), otherwise the import of sknano.version messes
    # up the build under Python 3.
    FULLVERSION = VERSION
    if os.path.exists('.git'):
        GIT_REVISION = git_version()
    elif os.path.exists('sknano/version.py'):
        # must be a source distribution, use existing version file
        # load it as a separate module to not load sknano/__init__.py
        import imp
        version = imp.load_source('sknano.version', 'sknano/version.py')
        GIT_REVISION = version.git_revision
    else:
        GIT_REVISION = "Unknown"

    if not ISRELEASED:
        FULLVERSION += '.dev-' + GIT_REVISION[:7]

    return FULLVERSION, GIT_REVISION

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

if not release:
    version = full_version
"""
    FULLVERSION, GIT_REVISION = get_version_info()

    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION,
                       'full_version': FULLVERSION,
                       'git_revision': GIT_REVISION,
                       'isrelease': str(ISRELEASED)})
    finally:
        a.close()

def setup_package():

    # Rewrite the version file everytime
    write_version_py()

    FULLVERSION, GIT_REVISION = get_version_info()

    setup_options = dict(
        name='sknano',
        version=FULLVERSION,
        author='Andrew Merrill',
        author_email='androomerrill@gmail.com',
        description=DOCLINES[0],
        long_description="\n".join(DOCLINES[2:]),
        url='https://github.com/androomerrill/scikit-nano',
        license='BSD 2-Clause',
        classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
        platforms=["Windows", "Linux", "OS-X", "Unix"],
        test_suite='nose.collector',
        packages=find_packages(exclude=['doc', 'ez_setup',
                                        'examples', 'tests']),
        #package_data={'sknano': []},
        #package_dir = {'': 'sknano'},
        include_package_data=True,
        exclude_package_data={'':
            ['README', 'README.rst', '*.gif', '*.html', '*.ui']},
        zip_safe=False,
        install_requires=['numpy>=1.8', 'scipy>=0.13',
                          'pkshared>=0.1.7', 'pksci>=0.1.4'],
        entry_points={
            'console_scripts': [
                'nanogen = sknano.scripts.nanogen:main',
            ]
        }
    )

    setup(**setup_options)

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


<commit_before>from setuptools import setup

setup(
    name='pg',
    version='0.1',
    description='Python OpenGL Graphics Framework',
    author='Michael Fogleman',
    author_email='michael.fogleman@gmail.com',
    url='https://github.com/fogleman/pg',
    packages=['pg'],
    install_requires=[
        'Pillow',
        'PyOpenGL',
    ],
)
<commit_msg>updated setup.py<commit_after>from setuptools import setup

setup(
    name='pg',
    version='0.1',
    description='Python OpenGL Graphics Framework',
    license='MIT',
    author='Michael Fogleman',
    author_email='michael.fogleman@gmail.com',
    url='https://github.com/fogleman/pg',
    packages=['pg'],
    install_requires=[
        'Pillow',
        'PyOpenGL',
    ],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Multimedia :: Graphics :: 3D Rendering',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
)
<|endoftext|>


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

from setuptools import setup, find_packages

version = '0.14.5'

setup(
    name='dino',
    version=version,
    description="Distributed Notifications",
    long_description="""Distributed notification server using websockets""",
    classifiers=[],
    keywords='notifications,chat,socketio,distributed',
    author='Oscar Eriksson',
    author_email='oscar.eriks@gmail.com',
    url='https://github.com/thenetcircle/dino',
    license='LICENSE.txt',
    packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
    include_package_data=True,
    zip_safe=False,
    install_requires=[
        'zope.interface',   # interfaces
        'pyyaml',            # configuration files
        'redis',           # redis client
        'psycopg2',
        'sqlalchemy',
        'flask-restful',
        'flask-socketio',
        'Flask-OAuthlib',
        'flask_wtf',
        'wtforms',
        'kafka-python',
        'python-socketio',
        'mysqlclient',
        'gunicorn',
        'activitystreams',
        'codecov',
        'fakeredis',
        'nose',
        'codecov',
        'coverage',
        'cassandra-driver',
        'kombu',
        'typing',
        'nose-parameterized',
        'python-dateutil',
        'psycogreen',
        'statsd',
        'pymitter',
        'psutil',
        'gitpython',
        'raven'
    ])
<commit_msg>version 0.14.6<commit_after>#!/usr/bin/env python

from setuptools import setup, find_packages

version = '0.14.6'

setup(
    name='dino',
    version=version,
    description="Distributed Notifications",
    long_description="""Distributed notification server using websockets""",
    classifiers=[],
    keywords='notifications,chat,socketio,distributed',
    author='Oscar Eriksson',
    author_email='oscar.eriks@gmail.com',
    url='https://github.com/thenetcircle/dino',
    license='LICENSE.txt',
    packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
    include_package_data=True,
    zip_safe=False,
    install_requires=[
        'zope.interface',   # interfaces
        'pyyaml',            # configuration files
        'redis',           # redis client
        'psycopg2',
        'sqlalchemy',
        'flask-restful',
        'flask-socketio',
        'Flask-OAuthlib',
        'flask_wtf',
        'wtforms',
        'kafka-python',
        'python-socketio',
        'mysqlclient',
        'gunicorn',
        'activitystreams',
        'codecov',
        'fakeredis',
        'nose',
        'codecov',
        'coverage',
        'cassandra-driver',
        'kombu',
        'typing',
        'nose-parameterized',
        'python-dateutil',
        'psycogreen',
        'statsd',
        'pymitter',
        'psutil',
        'gitpython',
        'raven'
    ])
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages, Extension
have_cython = False
try:
    import Cython
    have_cython = True
except ImportError:
    pass

ext_modules = []
if have_cython:
    ext_modules.append(
        Extension("pysnappy.core", sources=["pysnappy/core.pyx"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.framing", sources=["pysnappy/framing.pyx"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.crc32c", sources=["pysnappy/crc32c.pyx"])
    )
else:
    ext_modules.append(
        Extension("pysnappy", sources=["pysnappy/core.c"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.framing", sources=["pysnappy/framing.c"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.crc32c", sources=["pysnappy/crc32c.c"])
    )

setup(
    name="pysnappy",
    version="0.5.0",
    description="Cython bindings to libsnappy",
    author="Evan McClain",
    author_email="aeroevan@gmail.com",
    url="https://github.com/aeroevan/pysnappy",
    download_url="https://github.com/aeroevan/pysnappy/tarball/v0.5",
    license='MIT',
    test_suite="tests",
    packages=find_packages(exclude="test"),
    ext_modules=ext_modules,
    entry_points={
        'console_scripts': [
            'pysnappy = pysnappy.cli:main'
        ]
    },
    classifiers=[
        "Development Status :: 3 - Alpha",
        "License :: OSI Approved :: MIT License",
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Cython"
    ]
)
<commit_msg>Bump version.<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages, Extension
have_cython = False
try:
    import Cython
    have_cython = True
except ImportError:
    pass

ext_modules = []
if have_cython:
    ext_modules.append(
        Extension("pysnappy.core", sources=["pysnappy/core.pyx"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.framing", sources=["pysnappy/framing.pyx"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.crc32c", sources=["pysnappy/crc32c.pyx"])
    )
else:
    ext_modules.append(
        Extension("pysnappy", sources=["pysnappy/core.c"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.framing", sources=["pysnappy/framing.c"],
                  libraries=["snappy"])
    )
    ext_modules.append(
        Extension("pysnappy.crc32c", sources=["pysnappy/crc32c.c"])
    )

setup(
    name="pysnappy",
    version="0.5.1",
    description="Cython bindings to libsnappy",
    author="Evan McClain",
    author_email="aeroevan@gmail.com",
    url="https://github.com/aeroevan/pysnappy",
    download_url="https://github.com/aeroevan/pysnappy/tarball/v0.5.1",
    license='MIT',
    test_suite="tests",
    packages=find_packages(exclude="test"),
    ext_modules=ext_modules,
    entry_points={
        'console_scripts': [
            'pysnappy = pysnappy.cli:main'
        ]
    },
    classifiers=[
        "Development Status :: 3 - Alpha",
        "License :: OSI Approved :: MIT License",
        "Intended Audience :: Developers",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Cython"
    ]
)
<|endoftext|>


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

import setuptools
import os
import re
import kicost
import subprocess

try:
    from setuptools import setup
    from setuptools.command.develop import develop
    from setuptools.command.install import install
except ImportError:
    from distutils.core import setup
    from distutils.core.command.develop import develop
    from distutils.core.command.install import install

try:
    FileNotFoundError
except NameError:
    FileNotFoundError = IOError

def post_install_setup():
    # Run the KiCost integration script.
    try:
        import sys
        if sys.platform.startswith("win32"):
            # For Windows it is necessary one additional library (used to create the shortcut).
            print('Installing additional library need for Windows setup...')
            try:
                if sys.version_info < (3, 0):
                    from pip._internal import main as pipmain
                else:
                    from pip import main as pipmain
                pipmain(['install', 'pywin32'])
            except Exception:
                print('Error to install Windows additional Python library. KiCost configuration related to Windows registry may not work.')
        # Run setup: shortcut, BOM module to Eeschema and OS context menu.
        try:
            from .kicost.kicost_config import kicost_setup
            kicost_setup()
        except Exception:
            print('Running the external configuration command...')
            from subprocess import call
            call(['kicost', '--setup'])
    except Exception:
        print('Error to run KiCost integration script.')

class PostDevelopCommand(develop):
    """Post-installation for development mode."""
    def run(self):
        post_install_setup
        develop.run(self)

class PostInstallCommand(install):
    """Post-installation for installation mode."""
    def run(self):
        post_install_setup
        install.run(self)

# Update the information files that stay in the computer.
with open('README.rst') as readme_file:
    readme = readme_file.read()
with open(os.path.join('kicost', 'HISTORY.rst')) as history_file:
    history_full = history_file.read()
    try:
        SHOW_LAST_HISTORY = 3
        RE_TITLE_SEPARATOR = r'(.|\n|\r|\_)'
        update_format = (r'(?P<last_history>'
                         r'History\s\-+\s' + RE_TITLE_SEPARATOR +
                         r'*?(' + RE_TITLE_SEPARATOR +
                         r'*?\s{2,}){'+str(SHOW_LAST_HISTORY)+'}'
                         r')')
        history_lastest = re.search(update_format, history_full).group('last_history').strip()
        if history_lastest:
            if SHOW_LAST_HISTORY == 1:
                history_lastest = history_lastest.replace('History\n-------', 'Latest update\n-------------')
            else:
                history_lastest = history_lastest.replace('History\n-------', 'Latest updates\n--------------')
            history = history_lastest + '\n\nAccess https://github.com/xesscorp/KiCost/blob/master/HISTORY.rst for full development history.'
        else:
            history = history_full
    except Exception:
        history = history_full
        pass

# KiCost Python packages requirements to run-time.
with open('requirements.txt') as f:
    requirements = f.read().splitlines()
# Remove the comments of the line.
for idx, r in enumerate(requirements):
    requirements[idx] = re.findall('^(.*)(!?#.*)*', r)[0][0].strip()
if '' in requirements:
    requirements.remove('')

# KiCost Python packages requirements to debug and tests.
test_requirements = [
    # Put package test requirements here.
]

# Extra files needed by KiCost.
data_files = [
    # ('kicost', ['kicost/kicost.ico']), # Icon to the user guide. Added via `MANIFEST.in`.
]

with open('kicost/version.py', 'rt') as f:
    version_py = f.read()
with open('kicost/version.py', 'wt') as f:
    if 'KICOST_RELEASE' in os.environ:
        res = 'release'
    else:
        try:
            res = subprocess.check_output(['git', 'log', '-1', '--pretty=format:%h-%as']).decode('ascii')
        except (subprocess.CalledProcessError, FileNotFoundError):
            res = 'unknown'
    f.write(re.sub("__build__ = '(.*)'", "__build__ = '{}'".format(res), version_py))

setup(
    name='kicost',
    version=kicost.__version__,
    description="Build cost spreadsheet for a KiCad project.",
    long_description=readme + '\n\n' + history,
    # long_description_content_type="text/reStructuredText",
    author=kicost.__author__,
    author_email=kicost.__email__,
    url='https://xesscorp.github.io/KiCost',
    project_urls={
        'Doc': 'https://xesscorp.github.io/KiCost',
        'Git': 'https://github.com/xesscorp/KiCost',
    },
    packages=setuptools.find_packages(),
    entry_points={'console_scripts': ['kicost = kicost.__main__:main']},
    package_dir={'kicost': 'kicost'},
    include_package_data=True,
    package_data={'kicost': ['*.gif', '*.png']},
    # data_files=data_files,
    scripts=[],
    install_requires=requirements,
    license="MIT",
    zip_safe=False,
    keywords='KiCAD, BOM, electronics',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    test_suite='tests',
    tests_require=test_requirements,
    cmdclass={
        'develop': PostDevelopCommand,
        'install': PostInstallCommand,
    }
)
<commit_msg>Added patch for image paths in the readme to the setup.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import setuptools
import os
import re
import kicost
import subprocess

try:
    from setuptools import setup
    from setuptools.command.develop import develop
    from setuptools.command.install import install
except ImportError:
    from distutils.core import setup
    from distutils.core.command.develop import develop
    from distutils.core.command.install import install

try:
    FileNotFoundError
except NameError:
    FileNotFoundError = IOError

def post_install_setup():
    # Run the KiCost integration script.
    try:
        import sys
        if sys.platform.startswith("win32"):
            # For Windows it is necessary one additional library (used to create the shortcut).
            print('Installing additional library need for Windows setup...')
            try:
                if sys.version_info < (3, 0):
                    from pip._internal import main as pipmain
                else:
                    from pip import main as pipmain
                pipmain(['install', 'pywin32'])
            except Exception:
                print('Error to install Windows additional Python library. KiCost configuration related to Windows registry may not work.')
        # Run setup: shortcut, BOM module to Eeschema and OS context menu.
        try:
            from .kicost.kicost_config import kicost_setup
            kicost_setup()
        except Exception:
            print('Running the external configuration command...')
            from subprocess import call
            call(['kicost', '--setup'])
    except Exception:
        print('Error to run KiCost integration script.')

class PostDevelopCommand(develop):
    """Post-installation for development mode."""
    def run(self):
        post_install_setup
        develop.run(self)

class PostInstallCommand(install):
    """Post-installation for installation mode."""
    def run(self):
        post_install_setup
        install.run(self)

# Update the information files that stay in the computer.
with open('README.rst') as readme_file:
    readme = readme_file.read()
readme = readme.replace('block_diag.png', 'docs/block_diag.png')
readme = readme.replace('gui.png', 'docs/gui.png')
readme = readme.replace('kitspace.png', 'kicost/kitspace.png')
with open(os.path.join('kicost', 'HISTORY.rst')) as history_file:
    history_full = history_file.read()
    try:
        SHOW_LAST_HISTORY = 3
        RE_TITLE_SEPARATOR = r'(.|\n|\r|\_)'
        update_format = (r'(?P<last_history>'
                         r'History\s\-+\s' + RE_TITLE_SEPARATOR +
                         r'*?(' + RE_TITLE_SEPARATOR +
                         r'*?\s{2,}){'+str(SHOW_LAST_HISTORY)+'}'
                         r')')
        history_lastest = re.search(update_format, history_full).group('last_history').strip()
        if history_lastest:
            if SHOW_LAST_HISTORY == 1:
                history_lastest = history_lastest.replace('History\n-------', 'Latest update\n-------------')
            else:
                history_lastest = history_lastest.replace('History\n-------', 'Latest updates\n--------------')
            history = history_lastest + '\n\nAccess https://github.com/xesscorp/KiCost/blob/master/HISTORY.rst for full development history.'
        else:
            history = history_full
    except Exception:
        history = history_full
        pass

# KiCost Python packages requirements to run-time.
with open('requirements.txt') as f:
    requirements = f.read().splitlines()
# Remove the comments of the line.
for idx, r in enumerate(requirements):
    requirements[idx] = re.findall('^(.*)(!?#.*)*', r)[0][0].strip()
if '' in requirements:
    requirements.remove('')

# KiCost Python packages requirements to debug and tests.
test_requirements = [
    # Put package test requirements here.
]

# Extra files needed by KiCost.
data_files = [
    # ('kicost', ['kicost/kicost.ico']), # Icon to the user guide. Added via `MANIFEST.in`.
]

with open('kicost/version.py', 'rt') as f:
    version_py = f.read()
with open('kicost/version.py', 'wt') as f:
    if 'KICOST_RELEASE' in os.environ:
        res = 'release'
    else:
        try:
            res = subprocess.check_output(['git', 'log', '-1', '--pretty=format:%h-%as']).decode('ascii')
        except (subprocess.CalledProcessError, FileNotFoundError):
            res = 'unknown'
    f.write(re.sub("__build__ = '(.*)'", "__build__ = '{}'".format(res), version_py))

setup(
    name='kicost',
    version=kicost.__version__,
    description="Build cost spreadsheet for a KiCad project.",
    long_description=readme + '\n\n' + history,
    # long_description_content_type="text/reStructuredText",
    author=kicost.__author__,
    author_email=kicost.__email__,
    url='https://xesscorp.github.io/KiCost',
    project_urls={
        'Doc': 'https://xesscorp.github.io/KiCost',
        'Git': 'https://github.com/xesscorp/KiCost',
    },
    packages=setuptools.find_packages(),
    entry_points={'console_scripts': ['kicost = kicost.__main__:main']},
    package_dir={'kicost': 'kicost'},
    include_package_data=True,
    package_data={'kicost': ['*.gif', '*.png']},
    # data_files=data_files,
    scripts=[],
    install_requires=requirements,
    license="MIT",
    zip_safe=False,
    keywords='KiCAD, BOM, electronics',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    test_suite='tests',
    tests_require=test_requirements,
    cmdclass={
        'develop': PostDevelopCommand,
        'install': PostInstallCommand,
    }
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='heospy',
    version='0.1.1',
    author='Stephan Heuel',
    author_email='mail@ping13.net',
    packages=find_packages(),
    entry_points = {
        'console_scripts': ['heos_player=heospy.heos_player:main'],
    },
    url='http://pypi.python.org/pypi/heospy/',
    license='LICENSE.txt',
    description='Control Denon\'s HEOS speakers with Python.',
    install_requires=[
        'six',
        'future'
    ],
    long_description=open('Readme.md').read()
)
<commit_msg>push to new version to test travis<commit_after>from setuptools import setup, find_packages

setup(
    name='heospy',
    version='0.1.2',
    author='Stephan Heuel',
    author_email='mail@ping13.net',
    packages=find_packages(),
    entry_points = {
        'console_scripts': ['heos_player=heospy.heos_player:main'],
    },
    url='http://pypi.python.org/pypi/heospy/',
    license='LICENSE.txt',
    description='Control Denon\'s HEOS speakers with Python.',
    install_requires=[
        'six',
        'future'
    ],
    long_description=open('Readme.md').read()
)
<|endoftext|>


<commit_before>__author__ = 'lobocv'

from distutils.core import setup
from crashreporter import __version__

setup(
    name='crashreporter',
    packages=['crashreporter'],  # this must be the same as the name above
    data_files=[('crashreporter', ['crashreporter/crashreporter.html'])],
    version=__version__,
    description='Track and send crash reports by email or FTP',
    author='Calvin Lobo',
    author_email='calvinvlobo@gmail.com',
    url='https://github.com/lobocv/crashreporter',
    download_url='https://github.com/lobocv/crashreporter/tarball/%s' % __version__,
    keywords=['crash', 'reporting', 'testing', 'debugging', 'bugs'],
    classifiers=[],
    install_requires=['jinja2'],
)<commit_msg>changed data_files to package_dir/data<commit_after>__author__ = 'lobocv'

from distutils.core import setup
from crashreporter import __version__

setup(
    name='crashreporter',
    packages=['crashreporter'],  # this must be the same as the name above
    package_dir={'crashreporter': 'crashreporter'},
    package_data={'crashreporter': ['*.html']},
    version=__version__,
    description='Track and send crash reports by email or FTP',
    author='Calvin Lobo',
    author_email='calvinvlobo@gmail.com',
    url='https://github.com/lobocv/crashreporter',
    download_url='https://github.com/lobocv/crashreporter/tarball/%s' % __version__,
    keywords=['crash', 'reporting', 'testing', 'debugging', 'bugs'],
    classifiers=[],
    install_requires=['jinja2'],
)<|endoftext|>


<commit_before>from setuptools import setup, find_packages
import os

with open(os.path.join('version.txt')) as version_file:
    version_from_file = version_file.read().strip()

with open('requirements.txt') as f_required:
    required = f_required.read().splitlines()

with open('test_requirements.txt') as f_tests:
    required_for_tests = f_tests.read().splitlines()

setup(
    name='vCenterShell',
    url='http://www.qualisystems.com/',
    author='QualiSystems',
    author_email='info@qualisystems.com',
    packages=find_packages(),
    install_requires=required,
    test_suite='tests',
    tests_require=required_for_tests,
    version=version_from_file,
    description='QualiSystems vCenter Shell',
    include_package_data = True
)

<commit_msg>setup.py modified<commit_after>from setuptools import setup, find_packages
import os

with open(os.path.join('version.txt')) as version_file:
    version_from_file = version_file.read().strip()

with open('requirements.txt') as f_required:
    required = f_required.read().splitlines()

with open('test_requirements.txt') as f_tests:
    required_for_tests = f_tests.read().splitlines()

setup(
    name='vCenterShell',
    url='http://www.qualisystems.com/',
    author='QualiSystems',
    author_email='info@qualisystems.com',
    packages=find_packages(),
    install_requires=required,
    tests_require=required_for_tests,
    version=version_from_file,
    description='QualiSystems vCenter Shell',
    include_package_data = True
)

<|endoftext|>


<commit_before>"""Setup script.

Run "python3 setup --help-commands" to list all available commands and their
descriptions.
"""
import os
import re
import sys
from abc import abstractmethod
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
from distutils.command.clean import clean  # pylint: disable=E0401,E0611
from pathlib import Path
from subprocess import call

from setuptools import Command, find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install

BASE_ENV = os.environ.get('VIRTUAL_ENV', None) or '/'
ETC_FILES = ['etc/kytos/logging.ini']
TEMPLATE_FILES = ['etc/kytos/kytos.conf.template']

class SimpleCommand(Command):
    """Make Command implementation simpler."""

    user_options = []

    @abstractmethod
    def run(self):
        """Run when command is invoked.

        Use *call* instead of *check_call* to ignore failures.
        """
        pass

    def initialize_options(self):
        """Set defa ult values for options."""
        pass

    def finalize_options(self):
        """Post-process options."""
        pass

class Cleaner(clean):
    """Custom clean command to tidy up the project root."""

    description = 'clean build, dist, pyc and egg from package and docs'

    def run(self):
        """Clean build, dist, pyc and egg from package and docs."""
        super().run()
        call('rm -vrf ./build ./dist ./*.egg-info', shell=True)
        call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
        call('test -d docs && make -C docs/ clean', shell=True)

class TestCoverage(SimpleCommand):
    """Display test coverage."""

    description = 'run unit tests and display code coverage'

    def run(self):
        """Run unittest quietly and display coverage report."""
        cmd = 'coverage3 run -m unittest discover -qs tests' \
              ' && coverage3 report'
        call(cmd, shell=True)

class DocTest(SimpleCommand):
    """Run documentation tests."""

    description = 'run documentation tests'

    def run(self):
        """Run doctests using Sphinx Makefile."""
        cmd = 'make -C docs/ doctest'
        call(cmd, shell=True)

class Linter(SimpleCommand):
    """Code linters."""

    description = 'lint Python source code'

    def run(self):
        """Run pylama."""
        print('Pylama is running. It may take several seconds...')
        call('pylama setup.py tests kytos', shell=True)

class CommonInstall:
    """Class with common method used by children classes."""

    @staticmethod
    def build_sass():
        """Method to build the web-ui sass into a css file."""
        import sass
        flask_dir = Path(__file__).parent / 'kytos/web-ui/source'
        infile = flask_dir / 'sass/main.scss'
        cssdir = flask_dir / 'static/css'
        outfile = cssdir / 'style.css'
        outmap = cssdir / 'style.css.map'
        compiled = sass.compile(filename=str(infile),
                                source_map_filename=str(outmap))

        with open(outfile, 'w', encoding='utf-8') as output:
            output.write(compiled[0])

        with open(outmap, 'w', encoding='utf-8') as output:
            output.write(compiled[1])

    @classmethod
    def generate_file_from_template(cls, templates,
                                    destination=Path(__file__).parent,
                                    **kwargs):
        """Create a config file based on a template file.

        If no destination is passed, the new conf file will be created on the
        directory of the template file.

        Args:
            template (string):    Path of the template file
            destination (string): Directory in which the config file will
                                  be placed.
        """
        from jinja2 import Template

        cls.create_paths()
        for path in templates:
            with open(path, 'r', encoding='utf-8') as src_file:
                content = Template(src_file.read()).render(**kwargs)
                dst_path = Path(destination) / path.replace('.template', '')
                with open(dst_path, 'w') as dst_file:
                    dst_file.write(content)

    @staticmethod
    def create_pid_folder():
        """Create the folder in /var/run to hold the pidfile."""
        pid_folder = os.path.join(BASE_ENV, 'var/run/kytos')
        os.makedirs(pid_folder, exist_ok=True)
        if BASE_ENV == '/':  # system install
            os.chmod(pid_folder, 0o1777)  # permissions like /tmp

    @staticmethod
    def create_paths():
        """Method used to create the paths used by Kytos in develop mode."""
        directories = [os.path.join(BASE_ENV, 'etc/kytos')]
        for directory in directories:
            if not os.path.exists(directory):
                os.makedirs(directory)

class InstallMode(install, CommonInstall):
    """Class used to overwrite the default installation using setuptools.

    Besides doing the default install, the config files used by
    Kytos SDN Platform will also be created, based on templates.
    """

    def run(self):
        """Install the package in install mode.

        super().run() does not install dependencies when running
        ``python setup.py install`` (pypa/setuptools#456).
        """
        self.build_sass()

        if 'bdist_wheel' in sys.argv:
            # do not use eggs, but wheels
            super().run()
        else:
            # force install of deps' eggs during setup.py install
            self.do_egg_install()
        self.generate_file_from_template(TEMPLATE_FILES, BASE_ENV,
                                         prefix=BASE_ENV)
        self.create_pid_folder()

class DevelopMode(develop, CommonInstall):
    """Recommended setup for developers.

    Instead of copying the files to the expected directories, a symlink is
    created on the system aiming the current source code.
    """

    def run(self):
        """Install the package in a developer mode."""
        self.build_sass()
        super().run()

        self.generate_file_from_template(TEMPLATE_FILES, prefix=BASE_ENV)

        for file_name in ETC_FILES:
            self.generate_file_link(file_name)

        for file_name in TEMPLATE_FILES:
            self.generate_file_link(file_name.replace('.template', ''))
        self.create_pid_folder()

    @staticmethod
    def generate_file_link(file_name):
        """Method used to create a symbolic link from a file name."""
        current_directory = os.path.dirname(__file__)
        src = os.path.join(os.path.abspath(current_directory), file_name)
        dst = os.path.join(BASE_ENV, file_name)

        if not os.path.exists(dst):
            os.symlink(src, dst)

try:
    # Install dependencies' wheels (faster, don't compile libsass, etc)
    import pip
    pip_reqs = pip.req.parse_requirements('requirements.txt', session=False)
    pip.main(['install', *[str(r.req) for r in pip_reqs]])
except ImportError:
    # No pip, slow install compiling stuff
    print('Without Python pip, the installation will be very slow due to'
          'some third-party packages.\n'
          'We recommend to answer "n" (no), install pip and run this install '
          'again.\n')
    answer = input('Do you want to proceed (y/[n])? ').lower()
    if answer not in ['y', 'yes']:
        sys.exit()

setup_requires = ['jinja2', 'libsass']
install_requires = [i.strip() for i in open("requirements.txt").readlines()]

# We are parsing the metadata file as if it was a text file because if we
# import it as a python module, necessarily the kytos.core module would be
# initialized, which means that kyots/core/__init__.py would be run and, then,
# kytos.core.controller.Controller would be called and it will try to import
# some modules that are dependencies from this project and that were not yet
# installed, since the requirements installation from this project hasn't yet
# happened.
meta_file = open("kytos/core/metadata.py").read()
metadata = dict(re.findall(r"(__[a-z]+__)\s*=\s*'([^']+)'", meta_file))

setup(name='kytos',
      version=metadata.get('__version__'),
      description=metadata.get('__description__'),
      url=metadata.get('__url__'),
      author=metadata.get('__author__'),
      author_email=metadata.get('__author_email__'),
      license=metadata.get('__license__'),
      test_suite='tests',
      setup_requires=setup_requires,
      install_requires=install_requires,
      dependency_links=[
          'https://github.com/cemsbr/python-daemon/tarball/latest_release'
          '#egg=python-daemon-2.1.2'
      ],
      scripts=['bin/kytosd'],
      include_package_data=True,
      data_files=[(os.path.join(BASE_ENV, 'etc/kytos'), ETC_FILES)],
      packages=find_packages(exclude=['tests']),
      cmdclass={
          'clean': Cleaner,
          'coverage': TestCoverage,
          'develop': DevelopMode,
          'install': InstallMode,
          'doctest': DocTest,
          'lint': Linter
      },
      zip_safe=False,
      classifiers=[
          'License :: OSI Approved :: MIT License',
          'Operating System :: POSIX :: Linux',
          'Programming Language :: Python :: 3.6',
          'Topic :: System :: Networking',
          'Development Status :: 4 - Beta',
          'Environment :: Console',
          'Environment :: No Input/Output (Daemon)',
      ])
<commit_msg>Fix logging.ini when installing from .tar.gz<commit_after>"""Setup script.

Run "python3 setup --help-commands" to list all available commands and their
descriptions.
"""
import os
import re
import shutil
import sys
from abc import abstractmethod
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
from distutils.command.clean import clean  # pylint: disable=E0401,E0611
from pathlib import Path
from subprocess import call

from setuptools import Command, find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install

BASE_ENV = os.environ.get('VIRTUAL_ENV', None) or '/'
ETC_FILES = ['etc/kytos/logging.ini']
TEMPLATE_FILES = ['etc/kytos/kytos.conf.template']

class SimpleCommand(Command):
    """Make Command implementation simpler."""

    user_options = []

    @abstractmethod
    def run(self):
        """Run when command is invoked.

        Use *call* instead of *check_call* to ignore failures.
        """
        pass

    def initialize_options(self):
        """Set defa ult values for options."""
        pass

    def finalize_options(self):
        """Post-process options."""
        pass

class Cleaner(clean):
    """Custom clean command to tidy up the project root."""

    description = 'clean build, dist, pyc and egg from package and docs'

    def run(self):
        """Clean build, dist, pyc and egg from package and docs."""
        super().run()
        call('rm -vrf ./build ./dist ./*.egg-info', shell=True)
        call('find . -name __pycache__ -type d | xargs rm -rf', shell=True)
        call('test -d docs && make -C docs/ clean', shell=True)

class TestCoverage(SimpleCommand):
    """Display test coverage."""

    description = 'run unit tests and display code coverage'

    def run(self):
        """Run unittest quietly and display coverage report."""
        cmd = 'coverage3 run -m unittest discover -qs tests' \
              ' && coverage3 report'
        call(cmd, shell=True)

class DocTest(SimpleCommand):
    """Run documentation tests."""

    description = 'run documentation tests'

    def run(self):
        """Run doctests using Sphinx Makefile."""
        cmd = 'make -C docs/ doctest'
        call(cmd, shell=True)

class Linter(SimpleCommand):
    """Code linters."""

    description = 'lint Python source code'

    def run(self):
        """Run pylama."""
        print('Pylama is running. It may take several seconds...')
        call('pylama setup.py tests kytos', shell=True)

class CommonInstall:
    """Class with common method used by children classes."""

    @staticmethod
    def build_sass():
        """Method to build the web-ui sass into a css file."""
        import sass
        flask_dir = Path(__file__).parent / 'kytos/web-ui/source'
        infile = flask_dir / 'sass/main.scss'
        cssdir = flask_dir / 'static/css'
        outfile = cssdir / 'style.css'
        outmap = cssdir / 'style.css.map'
        compiled = sass.compile(filename=str(infile),
                                source_map_filename=str(outmap))

        with open(outfile, 'w', encoding='utf-8') as output:
            output.write(compiled[0])

        with open(outmap, 'w', encoding='utf-8') as output:
            output.write(compiled[1])

    @classmethod
    def generate_file_from_template(cls, templates,
                                    destination=Path(__file__).parent,
                                    **kwargs):
        """Create a config file based on a template file.

        If no destination is passed, the new conf file will be created on the
        directory of the template file.

        Args:
            template (string):    Path of the template file
            destination (string): Directory in which the config file will
                                  be placed.
        """
        from jinja2 import Template

        cls.create_paths()
        for path in templates:
            with open(path, 'r', encoding='utf-8') as src_file:
                content = Template(src_file.read()).render(**kwargs)
                dst_path = Path(destination) / path.replace('.template', '')
                with open(dst_path, 'w') as dst_file:
                    dst_file.write(content)

    @staticmethod
    def create_pid_folder():
        """Create the folder in /var/run to hold the pidfile."""
        pid_folder = os.path.join(BASE_ENV, 'var/run/kytos')
        os.makedirs(pid_folder, exist_ok=True)
        if BASE_ENV == '/':  # system install
            os.chmod(pid_folder, 0o1777)  # permissions like /tmp

    @staticmethod
    def create_paths():
        """Method used to create the paths used by Kytos in develop mode."""
        directories = [os.path.join(BASE_ENV, 'etc/kytos')]
        for directory in directories:
            if not os.path.exists(directory):
                os.makedirs(directory)

class InstallMode(install, CommonInstall):
    """Class used to overwrite the default installation using setuptools.

    Besides doing the default install, the config files used by
    Kytos SDN Platform will also be created, based on templates.
    """

    def run(self):
        """Install the package in install mode.

        super().run() does not install dependencies when running
        ``python setup.py install`` (pypa/setuptools#456).
        """
        self.build_sass()

        if 'bdist_wheel' in sys.argv:
            # do not use eggs, but wheels
            super().run()
        else:
            # force install of deps' eggs during setup.py install
            self.do_egg_install()
        self.generate_file_from_template(TEMPLATE_FILES, BASE_ENV,
                                         prefix=BASE_ENV)
        # data_files is not enough when installing from PyPI
        for file in ETC_FILES:
            shutil.copy2(file, Path(BASE_ENV) / file)

        self.create_pid_folder()

class DevelopMode(develop, CommonInstall):
    """Recommended setup for developers.

    Instead of copying the files to the expected directories, a symlink is
    created on the system aiming the current source code.
    """

    def run(self):
        """Install the package in a developer mode."""
        self.build_sass()
        super().run()

        self.generate_file_from_template(TEMPLATE_FILES, prefix=BASE_ENV)

        for file_name in ETC_FILES:
            self.generate_file_link(file_name)

        for file_name in TEMPLATE_FILES:
            self.generate_file_link(file_name.replace('.template', ''))
        self.create_pid_folder()

    @staticmethod
    def generate_file_link(file_name):
        """Method used to create a symbolic link from a file name."""
        current_directory = os.path.dirname(__file__)
        src = os.path.join(os.path.abspath(current_directory), file_name)
        dst = os.path.join(BASE_ENV, file_name)

        if not os.path.exists(dst):
            os.symlink(src, dst)

try:
    # Install dependencies' wheels (faster, don't compile libsass, etc)
    import pip
    pip_reqs = pip.req.parse_requirements('requirements.txt', session=False)
    pip.main(['install', *[str(r.req) for r in pip_reqs]])
except ImportError:
    # No pip, slow install compiling stuff
    print('Without Python pip, the installation will be very slow due to'
          'some third-party packages.\n'
          'We recommend to answer "n" (no), install pip and run this install '
          'again.\n')
    answer = input('Do you want to proceed (y/[n])? ').lower()
    if answer not in ['y', 'yes']:
        sys.exit()

setup_requires = ['jinja2', 'libsass']
install_requires = [i.strip() for i in open("requirements.txt").readlines()]

# We are parsing the metadata file as if it was a text file because if we
# import it as a python module, necessarily the kytos.core module would be
# initialized, which means that kyots/core/__init__.py would be run and, then,
# kytos.core.controller.Controller would be called and it will try to import
# some modules that are dependencies from this project and that were not yet
# installed, since the requirements installation from this project hasn't yet
# happened.
meta_file = open("kytos/core/metadata.py").read()
metadata = dict(re.findall(r"(__[a-z]+__)\s*=\s*'([^']+)'", meta_file))

setup(name='kytos',
      version=metadata.get('__version__'),
      description=metadata.get('__description__'),
      url=metadata.get('__url__'),
      author=metadata.get('__author__'),
      author_email=metadata.get('__author_email__'),
      license=metadata.get('__license__'),
      test_suite='tests',
      setup_requires=setup_requires,
      install_requires=install_requires,
      dependency_links=[
          'https://github.com/cemsbr/python-daemon/tarball/latest_release'
          '#egg=python-daemon-2.1.2'
      ],
      scripts=['bin/kytosd'],
      include_package_data=True,
      data_files=[(os.path.join(BASE_ENV, 'etc/kytos'), ETC_FILES)],
      packages=find_packages(exclude=['tests']),
      cmdclass={
          'clean': Cleaner,
          'coverage': TestCoverage,
          'develop': DevelopMode,
          'install': InstallMode,
          'doctest': DocTest,
          'lint': Linter
      },
      zip_safe=False,
      classifiers=[
          'License :: OSI Approved :: MIT License',
          'Operating System :: POSIX :: Linux',
          'Programming Language :: Python :: 3.6',
          'Topic :: System :: Networking',
          'Development Status :: 4 - Beta',
          'Environment :: Console',
          'Environment :: No Input/Output (Daemon)',
      ])
<|endoftext|>


<commit_before>import re

from setuptools import setup

# get version without importing
with open("extra_views/__init__.py", "rb") as f:
    VERSION = str(re.search('__version__ = "(.+?)"', f.read().decode("utf-8")).group(1))

setup(
    name="django-extra-views",
    version=VERSION,
    url="https://github.com/AndrewIngram/django-extra-views",
    install_requires=["Django >=1.11", "six>=1.5.2"],
    description="Extra class-based views for Django",
    long_description=open("README.rst", "r").read(),
    license="MIT",
    author="Andrew Ingram",
    author_email="andy@andrewingram.net",
    packages=["extra_views", "extra_views.contrib"],
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Environment :: Web Environment",
        "Framework :: Django",
        "Intended Audience :: Developers",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 3",
    ],
)
<commit_msg>Add license to trove classifiers.<commit_after>import re

from setuptools import setup

# get version without importing
with open("extra_views/__init__.py", "rb") as f:
    VERSION = str(re.search('__version__ = "(.+?)"', f.read().decode("utf-8")).group(1))

setup(
    name="django-extra-views",
    version=VERSION,
    url="https://github.com/AndrewIngram/django-extra-views",
    install_requires=["Django >=1.11", "six>=1.5.2"],
    description="Extra class-based views for Django",
    long_description=open("README.rst", "r").read(),
    license="MIT",
    author="Andrew Ingram",
    author_email="andy@andrewingram.net",
    packages=["extra_views", "extra_views.contrib"],
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Environment :: Web Environment",
        "Framework :: Django",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 3",
    ],
)
<|endoftext|>