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

"""
pycurl2
~~~~~~~

PycURL2 is a revised version of PycURL, that not maintained more than 3 years (from 7.19.0 (Sep 9 2008)).

`PycURL`_ is a Python interface to `libcurl`_.
`PycURL`_ can be used to fetch objects identified by a URL
from a Python program, similar to the `urllib`_ Python module.
`PycURL`_ is mature, very fast, and supports a lot of features.

:copyright: (c) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
:copyright: (c) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
:copyright: (c) 2012 by Alexandr Lispython <alex at obout.ru, alex at dzone.me>
:license: LGPL/MIT, see COPIYNG and COPYING2 for more details.

.. _PycURL: http://pycurl.sourceforge.net/
.. _libcurl: http://curl.haxx.se/libcurl/
.. _urllib: http://docs.python.org/library/urllib.html
"""

import os
import sys

try:
    from setuptools import setup
    from setuptools import Extension
    from setuptools import Command
except ImportError:
    from distutils.core import setup
    from distutils.extension import Extension
    from distutils.cmd import Command

# Import setup help functions
from src import get_version
from setup_helpers import extension_params, ParamsPrinter

# Setup constants
PACKAGE = "pycurl2"
extensions = []

# Make C extension than we can import as PACKAGE name
# that can imported with pycurl2 name
pycurl2_ext = Extension(
    name=PACKAGE,
    sources=[
        os.path.join("src", "pycurl.c"),
    ],
    **extension_params
)

extensions.append(pycurl2_ext)

# Added test requirement
tests_require = [
    'nose',
    'unittest2',
    'simplejson==2.6.2']

try:
    readme_content = open(os.path.join(os.path.abspath(
        os.path.dirname(__file__)), "README.rst")).read()
except Exception, e:
    sys.stderr.write(e)
    readme_content = __doc__

setup_args = dict(
    name=PACKAGE,
    version=get_version(),
    url='http://pycurl2.github.com',
    license='LGPL/MIT',
    description='PycURL2 - cURL library module for python',
    author='Alexandr Lispython (2012), Kjetil Jacobsen (2001 - 2008), Markus F.X.J. Oberhumer (2001 - 2008)',
    author_email='alex@obout.ru [kjetilja at gmail.com, markus at oberhumer.com]',
    maintainer='Alexandr Lispython (2012), Kjetil Jacobsen (2001 - 2008), Markus F.X.J. Oberhumer (2001 - 2008)',
    maintainer_email='alex@obout.ru [kjetilja at gmail.com, markus at oberhumer.com]',
    long_description=readme_content,
    zip_safe=False,
    ext_modules=extensions,
    tests_require=tests_require,
    package_data={'': ['COPYING', 'COPYING2', 'INSTALL']},
    ## download_url="http://cloud.github.com/downloads/Lispython/pycurl/pycurl2-%s.tar.gz' % get_version()",
    platforms=['Linux', 'Mac', 'Windows'],
    keywords=['curl','pycurl', 'http library'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7'],
    test_suite='tests.suite',
    include_package_data=True,
    cmdclass={'params': ParamsPrinter})

if __name__ == '__main__':
    apply(setup, (), setup_args)
<commit_msg>Updated setup.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
pycurl2
~~~~~~~

PycURL2 is a revised version of PycURL, that not maintained more than 3 years (from 7.19.0 (Sep 9 2008)).

`PycURL`_ is a Python interface to `libcurl`_.
`PycURL`_ can be used to fetch objects identified by a URL
from a Python program, similar to the `urllib`_ Python module.
`PycURL`_ is mature, very fast, and supports a lot of features.

:copyright: (c) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
:copyright: (c) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
:copyright: (c) 2012 by Alexandr Lispython <alex at obout.ru, alex at dzone.me>
:license: LGPL/MIT, see COPIYNG and COPYING2 for more details.

.. _PycURL: http://pycurl.sourceforge.net/
.. _libcurl: http://curl.haxx.se/libcurl/
.. _urllib: http://docs.python.org/library/urllib.html
"""

import os
import sys

try:
    from setuptools import setup
    from setuptools import Extension
    from setuptools import Command
except ImportError:
    from distutils.core import setup
    from distutils.extension import Extension
    from distutils.cmd import Command

# Import setup help functions
from src import get_version
from setup_helpers import extension_params, ParamsPrinter

# Setup constants
PACKAGE = "pycurl2"
extensions = []

# Make C extension than we can import as PACKAGE name
# that can imported with pycurl2 name
pycurl2_ext = Extension(
    name=PACKAGE,
    sources=[
        os.path.join("src", "pycurl.c"),
    ],
    **extension_params
)

extensions.append(pycurl2_ext)

# Added test requirement
tests_require = [
    'nose',
    'unittest2',
    'simplejson']

try:
    readme_content = open(os.path.join(os.path.abspath(
        os.path.dirname(__file__)), "README.rst")).read()
except Exception, e:
    sys.stderr.write(e)
    readme_content = __doc__

setup_args = dict(
    name=PACKAGE,
    version=get_version(),
    url='http://pycurl2.github.com',
    license='LGPL/MIT',
    description='PycURL2 - cURL library module for python',
    author='Alexandr Lispython (2012), Kjetil Jacobsen (2001 - 2008), Markus F.X.J. Oberhumer (2001 - 2008)',
    author_email='alex@obout.ru [kjetilja at gmail.com, markus at oberhumer.com]',
    maintainer='Alexandr Lispython (2012), Kjetil Jacobsen (2001 - 2008), Markus F.X.J. Oberhumer (2001 - 2008)',
    maintainer_email='alex@obout.ru [kjetilja at gmail.com, markus at oberhumer.com]',
    long_description=readme_content,
    zip_safe=False,
    ext_modules=extensions,
    tests_require=tests_require,
    package_data={'': ['COPYING', 'COPYING2', 'INSTALL']},
    ## download_url="http://cloud.github.com/downloads/Lispython/pycurl/pycurl2-%s.tar.gz' % get_version()",
    platforms=['Linux', 'Mac', 'Windows'],
    keywords=['curl','pycurl', 'http library'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7'],
    test_suite='tests.suite',
    include_package_data=True,
    cmdclass={'params': ParamsPrinter})

if __name__ == '__main__':
    apply(setup, (), setup_args)
<|endoftext|>


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

"""Setup module for the OCSPdash package."""

import codecs  # To use a consistent encoding
import os
import re

import setuptools

#################################################################
PACKAGES = setuptools.find_packages(where='src')
META_PATH = os.path.join('src', 'ocspdash', '__init__.py')
KEYWORDS = ['OCSP', 'X509', 'PKI', 'certificates', 'certificate revocation']
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
    'Development Status :: 1 - Planning',
    'Intended Audience :: Developers',
    'License ::  OSI Approved :: MIT License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 3.7',
]
INSTALL_REQUIRES = [
    'argon2-cffi',
    'asn1crypto',
    'censys',
    'click',
    'cryptography',
    # 'flasgger',  # flasgger is temporarily disabled due to a security vulnerability
    'flask',
    'flask-admin',
    'flask-bootstrap',
    'flask-sqlalchemy',
    'jsonlines',
    'ocspbuilder',
    'oscrypto',
    'passlib',
    'python-jose',
    'requests',
    'sqlalchemy',
    'tqdm',
]
EXTRAS_REQUIRE = {}
TESTS_REQUIRE = ['tox']
ENTRY_POINTS = {
    'console_scripts': [
        'ocspdash = ocspdash.cli:main',
        'ocspscrape = ocspdash.ocspscrape:main',
    ]
}
#################################################################

HERE = os.path.abspath(os.path.dirname(__file__))

def read(*parts):
    """Build an absolute path from *parts* and return the contents of the resulting file. Assume UTF-8 encoding."""
    with codecs.open(os.path.join(HERE, *parts), 'rb', 'utf-8') as f:
        return f.read()

def find_meta(meta):
    """Extract __*meta*__ from META_FILE."""
    meta_match = re.search(
        r'^__{meta}__ = ["\']([^"\']*)["\']'.format(meta=meta), META_FILE, re.M
    )
    if meta_match:
        return meta_match.group(1)
    raise RuntimeError(f'Unable to find __{meta}__ string')

def get_long_description():
    """Get the long_description from the README.rst file. Assume UTF-8 encoding."""
    with codecs.open(os.path.join(HERE, 'README.rst'), encoding='utf-8') as f:
        long_description = f.read()
    return long_description

META_FILE = read(META_PATH)

if __name__ == '__main__':
    setuptools.setup(
        name=find_meta('title'),
        version=find_meta('version'),
        description=find_meta('description'),
        long_description=get_long_description(),
        url=find_meta('url'),
        author=find_meta('author'),
        author_email=find_meta('email'),
        maintainer=find_meta('author'),
        license=find_meta('license'),
        classifiers=CLASSIFIERS,
        keywords=KEYWORDS,
        packages=PACKAGES,
        package_dir={'': 'src'},
        install_requires=INSTALL_REQUIRES,
        extras_require=EXTRAS_REQUIRE,
        tests_require=TESTS_REQUIRE,
        entry_points=ENTRY_POINTS,
        include_package_data=True,
        zip_safe=False,
    )
<commit_msg>Remove extra space in trove classifier for license.<commit_after># -*- coding: utf-8 -*-

"""Setup module for the OCSPdash package."""

import codecs  # To use a consistent encoding
import os
import re

import setuptools

#################################################################
PACKAGES = setuptools.find_packages(where='src')
META_PATH = os.path.join('src', 'ocspdash', '__init__.py')
KEYWORDS = ['OCSP', 'X509', 'PKI', 'certificates', 'certificate revocation']
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
    'Development Status :: 1 - Planning',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 3.7',
]
INSTALL_REQUIRES = [
    'argon2-cffi',
    'asn1crypto',
    'censys',
    'click',
    'cryptography',
    # 'flasgger',  # flasgger is temporarily disabled due to a security vulnerability
    'flask',
    'flask-admin',
    'flask-bootstrap',
    'flask-sqlalchemy',
    'jsonlines',
    'ocspbuilder',
    'oscrypto',
    'passlib',
    'python-jose',
    'requests',
    'sqlalchemy',
    'tqdm',
]
EXTRAS_REQUIRE = {}
TESTS_REQUIRE = ['tox']
ENTRY_POINTS = {
    'console_scripts': [
        'ocspdash = ocspdash.cli:main',
        'ocspscrape = ocspdash.ocspscrape:main',
    ]
}
#################################################################

HERE = os.path.abspath(os.path.dirname(__file__))

def read(*parts):
    """Build an absolute path from *parts* and return the contents of the resulting file. Assume UTF-8 encoding."""
    with codecs.open(os.path.join(HERE, *parts), 'rb', 'utf-8') as f:
        return f.read()

def find_meta(meta):
    """Extract __*meta*__ from META_FILE."""
    meta_match = re.search(
        r'^__{meta}__ = ["\']([^"\']*)["\']'.format(meta=meta), META_FILE, re.M
    )
    if meta_match:
        return meta_match.group(1)
    raise RuntimeError(f'Unable to find __{meta}__ string')

def get_long_description():
    """Get the long_description from the README.rst file. Assume UTF-8 encoding."""
    with codecs.open(os.path.join(HERE, 'README.rst'), encoding='utf-8') as f:
        long_description = f.read()
    return long_description

META_FILE = read(META_PATH)

if __name__ == '__main__':
    setuptools.setup(
        name=find_meta('title'),
        version=find_meta('version'),
        description=find_meta('description'),
        long_description=get_long_description(),
        url=find_meta('url'),
        author=find_meta('author'),
        author_email=find_meta('email'),
        maintainer=find_meta('author'),
        license=find_meta('license'),
        classifiers=CLASSIFIERS,
        keywords=KEYWORDS,
        packages=PACKAGES,
        package_dir={'': 'src'},
        install_requires=INSTALL_REQUIRES,
        extras_require=EXTRAS_REQUIRE,
        tests_require=TESTS_REQUIRE,
        entry_points=ENTRY_POINTS,
        include_package_data=True,
        zip_safe=False,
    )
<|endoftext|>


<commit_before>from setuptools import setup, find_packages
import politicalplaces

setup(
    name='django-political-map',
    version=politicalplaces.__version__,
    description='Django application to store geolocalized places and organize them according to political hierarchy.',
    author='Gabriel Giaccari, 20tab S.r.l.',
    author_email='info@20tab.com',
    url='https://github.com/20tab/django-political-map.git',
    license='MIT License',
    install_requires=[
        'googlemaps==2.5.1',
    ],
    packages=find_packages(),
    include_package_data=True,
    package_data={
        '': ['*.html', '*.css', '*.js', '*.gif', '*.png', ],
    }
)
<commit_msg>setup updates<commit_after>from setuptools import setup, find_packages
import politicalplaces

setup(
    name='django-political-map',
    version=politicalplaces.__version__,
    description='Django application to store geolocalized places and organize them according to political hierarchy.',
    author='Gabriel Giaccari, 20tab S.r.l.',
    author_email='info@20tab.com',
    url='https://github.com/20tab/django-political-map.git',
    license='MIT License',
    install_requires=[
        'googlemaps==3.0.2',
    ],
    packages=find_packages(),
    include_package_data=True,
    package_data={
        '': ['*.html', '*.css', '*.js', '*.gif', '*.png', ],
    }
)
<|endoftext|>


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

from distutils.core import setup
import os
from setuptools import find_packages

name = 'Mikko Korpela'
# I might be just a little bit too much afraid of those bots..
address = name.lower().replace(' ', '.')+chr(64)+'gmail.com'

setup(name='robotframework-pabot',
      version='0.30',
      description='Parallel test runner for Robot Framework',
      author=name,
      author_email=address,
      url='https://github.com/mkorpela/pabot',
      packages=find_packages(),
      classifiers=[
            'Intended Audience :: Developers',
            'Natural Language :: English',
            'Programming Language :: Python :: 2.7',
            'Topic :: Software Development :: Testing'
      ],
      scripts=[os.path.join('scripts', 'pabot'),
               os.path.join('scripts', 'pabot.bat')],
      license='Apache License, Version 2.0',
      install_requires=['robotframework', 'robotremoteserver'])
<commit_msg>more metadata<commit_after>#!/usr/bin/env python

from distutils.core import setup
import os
from setuptools import find_packages

name = 'Mikko Korpela'
# I might be just a little bit too much afraid of those bots..
address = name.lower().replace(' ', '.')+chr(64)+'gmail.com'

setup(name='robotframework-pabot',
      version='0.30',
      description='Parallel test runner for Robot Framework',
      author=name,
      author_email=address,
      url='https://github.com/mkorpela/pabot',
      packages=find_packages(),
      classifiers=[
            'Intended Audience :: Developers',
            'Natural Language :: English',
            'Programming Language :: Python :: 2.7',
            'Topic :: Software Development :: Testing',
            'License :: OSI Approved :: Apache Software License',
            'Development Status :: 5 - Production/Stable',
            'Framework :: Robot Framework'
      ],
      scripts=[os.path.join('scripts', 'pabot'),
               os.path.join('scripts', 'pabot.bat')],
      license='Apache License, Version 2.0',
      install_requires=['robotframework', 'robotremoteserver'])
<|endoftext|>


<commit_before>from distutils.core import setup
from setuptools import find_packages

long_description = """
With this package you can convert dicom images to nifti files.
There is support for most anatomical CT and MR data.
For MR specifically there is support for most 4D data (like DTI and fMRI)
"""
setup(
    name='dicom2nifti',
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
    version='1.1.1',
    description='package for converting dicom files to nifti',
    long_description=long_description,
    license='MIT',
    author='icometrix NV',
    author_email='dicom2nifti@icometrix.com',
    maintainer = "icometrix NV",
    maintainer_email = "dicom2nifti@icometrix.com",
    url='https://github.com/icometrix/dicom2nifti',
    download_url='https://github.com/icometrix/dicom2nifti/tarball/1.1.1',
    keywords=['dicom', 'nifti', 'medical imaging'],
    scripts=['scripts/dicom2nifti'],
    # https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Healthcare Industry',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Medical Science Apps.',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX :: Linux'],
    install_requires=['nibabel', 'pydicom', 'numpy', 'six', 'future'],
    setup_requires=['nose', 'coverage']

)
<commit_msg>DCMTONII-31: Minor release - Allow gantry tilting from command line. - Added api docs on readthedocs.org<commit_after>from distutils.core import setup
from setuptools import find_packages

long_description = """
With this package you can convert dicom images to nifti files.
There is support for most anatomical CT and MR data.
For MR specifically there is support for most 4D data (like DTI and fMRI)
"""
setup(
    name='dicom2nifti',
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
    version='1.1.2',
    description='package for converting dicom files to nifti',
    long_description=long_description,
    license='MIT',
    author='icometrix NV',
    author_email='dicom2nifti@icometrix.com',
    maintainer = "icometrix NV",
    maintainer_email = "dicom2nifti@icometrix.com",
    url='https://github.com/icometrix/dicom2nifti',
    download_url='https://github.com/icometrix/dicom2nifti/tarball/1.1.2',
    keywords=['dicom', 'nifti', 'medical imaging'],
    scripts=['scripts/dicom2nifti'],
    # https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Healthcare Industry',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Medical Science Apps.',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX :: Linux'],
    install_requires=['nibabel', 'pydicom', 'numpy', 'six', 'future'],
    setup_requires=['nose', 'coverage']

)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages  # Always prefer setuptools over distutils
from codecs import open  # To use a consistent encoding
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='hiveplot',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='0.1.3.3',

    description='Hive Plots in Matplotlib.',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/ericmjl/hiveplot',

    # Author details
    author='Eric J. Ma',
    author_email='ericmajinglong@gmail.com',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Visualization',

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

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
    ],

    # What does your project relate to?
    keywords='network analysis, hive plots, data visualization',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),

    # List run-time dependencies here.  These will be installed by pip when your
    # project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['numpy', 'matplotlib'],

    # List additional groups of dependencies here (e.g. development dependencies).
    # You can install these using the following syntax, for example:
    # $ pip install -e .[dev,test]
    extras_require = {
        'dev': ['check-manifest'],
        'test': ['coverage'],
    },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    # package_data={
    #     'sample': ['package_data.dat'],
    # },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages.
    # see http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    # entry_points={
    #     'console_scripts': [
    #         'sample=sample:main',
    #     ],
    # },
)<commit_msg>Update setup<commit_after>from setuptools import setup, find_packages  # Always prefer setuptools over distutils
from codecs import open  # To use a consistent encoding
from os import path

setup(
    name='hiveplot',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='0.1.3.5',

    description='Hive Plots in Matplotlib.',
    longdescription='Simple utility for making hive plots in Python.'

    # The project's main homepage.
    url='https://github.com/ericmjl/hiveplot',

    # Author details
    author='Eric J. Ma',
    author_email='ericmajinglong@gmail.com',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Visualization',

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

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
    ],

    # What does your project relate to?
    keywords='network analysis, hive plots, data visualization',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),

    # List run-time dependencies here.  These will be installed by pip when your
    # project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['numpy', 'matplotlib'],

    # List additional groups of dependencies here (e.g. development dependencies).
    # You can install these using the following syntax, for example:
    # $ pip install -e .[dev,test]
    extras_require = {
        'dev': ['check-manifest'],
        'test': ['coverage'],
    },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    # package_data={
    #     'sample': ['package_data.dat'],
    # },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages.
    # see http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    # entry_points={
    #     'console_scripts': [
    #         'sample=sample:main',
    #     ],
    # },
)<|endoftext|>


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

import re
import os
import sys
from io import open

from setuptools import setup

def read_file(fpath):
    with open(fpath, encoding='utf-8') as r:
        return r.read()

def find_version(*file_paths):
    fpath = os.path.join(os.path.dirname(__file__), *file_paths)
    version_file = read_file(fpath)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)

    err_msg = 'Unable to find version string in {}'.format(fpath)
    raise RuntimeError(err_msg)

README = read_file('README.rst')
CONTRIB = read_file('CONTRIBUTING.rst')
CHANGES = read_file('CHANGES.rst')
version = find_version('luma', 'oled', '__init__.py')

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
test_deps = [
    'mock;python_version<"3.3"',
    'pytest>=3.1',
    'pytest-cov'
]

setup(
    name="luma.oled",
    version=version,
    author="Richard Hull",
    author_email="richard.hull@destructuring-bind.org",
    description=("A small library to drive an OLED device with either "
                 "SSD1306, SSD1322, SSD1325, SSD1331, SSD1351 or SH1106 chipset"),
    long_description="\n\n".join([README, CONTRIB, CHANGES]),
    license="MIT",
    keywords=("raspberry pi rpi oled display screen "
              "rgb monochrome greyscale color "
              "ssd1306 ssd1322 ssd1325 ssd1327 ssd1331 ssd1351 sh1106 "
              "spi i2c 256x64 128x64 128x32 96x16"),
    url="https://github.com/rm-hull/luma.oled",
    download_url="https://github.com/rm-hull/luma.oled/tarball/" + version,
    namespace_packages=["luma"],
    packages=["luma.oled"],
    zip_safe=False,
    install_requires=["luma.core>=1.6.0"],
    setup_requires=pytest_runner,
    tests_require=test_deps,
    extras_require={
        'docs': [
            'sphinx >= 1.5.1'
        ],
        'qa': [
            'rstcheck',
            'flake8'
        ],
        'test': test_deps
    },
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Education",
        "Intended Audience :: Developers",
        "Topic :: Education",
        "Topic :: System :: Hardware",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6"
    ]
)
<commit_msg>Correct implementation of pkgutil style namespace (#215)<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import re
import os
import sys
from io import open

from setuptools import setup

def read_file(fpath):
    with open(fpath, encoding='utf-8') as r:
        return r.read()

def find_version(*file_paths):
    fpath = os.path.join(os.path.dirname(__file__), *file_paths)
    version_file = read_file(fpath)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)

    err_msg = 'Unable to find version string in {}'.format(fpath)
    raise RuntimeError(err_msg)

README = read_file('README.rst')
CONTRIB = read_file('CONTRIBUTING.rst')
CHANGES = read_file('CHANGES.rst')
version = find_version('luma', 'oled', '__init__.py')

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
test_deps = [
    'mock;python_version<"3.3"',
    'pytest>=3.1',
    'pytest-cov'
]

setup(
    name="luma.oled",
    version=version,
    author="Richard Hull",
    author_email="richard.hull@destructuring-bind.org",
    description=("A small library to drive an OLED device with either "
                 "SSD1306, SSD1322, SSD1325, SSD1331, SSD1351 or SH1106 chipset"),
    long_description="\n\n".join([README, CONTRIB, CHANGES]),
    license="MIT",
    keywords=("raspberry pi rpi oled display screen "
              "rgb monochrome greyscale color "
              "ssd1306 ssd1322 ssd1325 ssd1327 ssd1331 ssd1351 sh1106 "
              "spi i2c 256x64 128x64 128x32 96x16"),
    url="https://github.com/rm-hull/luma.oled",
    download_url="https://github.com/rm-hull/luma.oled/tarball/" + version,
    packages=["luma", "luma.oled"],
    zip_safe=False,
    install_requires=["luma.core>=1.8.0"],
    setup_requires=pytest_runner,
    tests_require=test_deps,
    extras_require={
        'docs': [
            'sphinx >= 1.5.1'
        ],
        'qa': [
            'rstcheck',
            'flake8'
        ],
        'test': test_deps
    },
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Education",
        "Intended Audience :: Developers",
        "Topic :: Education",
        "Topic :: System :: Hardware",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6"
    ]
)
<|endoftext|>


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

from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt')
reqs = [str(ir.req) for ir in install_reqs]

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

requirements = [
    # TODO: put package requirements here
]

test_requirements = [
    # TODO: put package test requirements here
]

setup(
    name='threes',
    version='0.1.0',
    description='Implementing the tile merge game',
    long_description=readme + '\n\n' + history,
    author='Ben Warren',
    author_email='bwarren2@gmail.com',
    url='https://github.com/bwarren2/threes',
    packages=[
        'threes',
    ],
    package_dir={'threes':
                 'threes'},
    include_package_data=True,
    install_requires=reqs,
    license="BSD",
    zip_safe=False,
    keywords='threes',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
    ],
    test_suite='tests',
    tests_require=reqs
)
<commit_msg>Bump version<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt')
reqs = [str(ir.req) for ir in install_reqs]

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

requirements = [
    # TODO: put package requirements here
]

test_requirements = [
    # TODO: put package test requirements here
]

setup(
    name='threes',
    version='0.1.2',
    description='Implementing the tile merge game',
    long_description=readme + '\n\n' + history,
    author='Ben Warren',
    author_email='bwarren2@gmail.com',
    url='https://github.com/bwarren2/threes',
    packages=[
        'threes',
    ],
    package_dir={'threes':
                 'threes'},
    include_package_data=True,
    install_requires=reqs,
    license="BSD",
    zip_safe=False,
    keywords='threes',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
    ],
    test_suite='tests',
    tests_require=reqs
)
<|endoftext|>


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

from os import path
from setuptools import setup, find_packages

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='ogn-python',
    version='0.5.0',
    description='A database backend for the Open Glider Network',
    long_description=long_description,
    url='https://github.com/glidernet/ogn-python',
    author='Konstantin Gründger aka Meisterschueler, Fabian P. Schmidt aka kerel, Dominic Spreitz',
    author_email='kerel-fs@gmx.de',
    license='AGPLv3',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: GIS',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9-dev'
    ],
    keywords='gliding ogn',
    packages=find_packages(exclude=['tests', 'tests.*']),
    install_requires=[
        'Flask==2.0.1',
        'Flask-SQLAlchemy==2.5.1',
        'Flask-Migrate==3.0.1',
        'Flask-Bootstrap==3.3.7.1',
        'Flask-WTF==0.15.1',
        'Flask-Caching==1.10.1',
        'Flask-Profiler==1.8.1',
        'geopy==2.1.0',
        'celery==4.4.7',
        'Flask-Redis==0.4.0',
        'redis==3.5.3',
        'aerofiles==1.0.0',
        'geoalchemy2==0.9.0',
        'shapely==1.7.1',
        'ogn-client==1.2.1',
        'mgrs==1.4.0',
        'psycopg2-binary==2.8.6',
        'xmlunittest==0.5.0',
        'flower==0.9.7',
        'tqdm==4.61.0',
        'requests==2.25.1',
        'matplotlib==3.3.4',
        'bokeh==2.3.2',
        'pandas==1.1.5',
        'flydenity==0.1.6',
        'gunicorn==20.1.0'
    ],
    test_require=[
        'pytest==5.0.1',
        'flake8==1.1.1',
        'xmlunittest==0.4.0',
    ],
    zip_safe=False
)
<commit_msg>Bump geopy from 2.1.0 to 2.2.0 (#93)<commit_after>#!/usr/bin/env python3

from os import path
from setuptools import setup, find_packages

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='ogn-python',
    version='0.5.0',
    description='A database backend for the Open Glider Network',
    long_description=long_description,
    url='https://github.com/glidernet/ogn-python',
    author='Konstantin Gründger aka Meisterschueler, Fabian P. Schmidt aka kerel, Dominic Spreitz',
    author_email='kerel-fs@gmx.de',
    license='AGPLv3',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: GIS',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9-dev'
    ],
    keywords='gliding ogn',
    packages=find_packages(exclude=['tests', 'tests.*']),
    install_requires=[
        'Flask==2.0.1',
        'Flask-SQLAlchemy==2.5.1',
        'Flask-Migrate==3.0.1',
        'Flask-Bootstrap==3.3.7.1',
        'Flask-WTF==0.15.1',
        'Flask-Caching==1.10.1',
        'Flask-Profiler==1.8.1',
        'geopy==2.2.0',
        'celery==4.4.7',
        'Flask-Redis==0.4.0',
        'redis==3.5.3',
        'aerofiles==1.0.0',
        'geoalchemy2==0.9.0',
        'shapely==1.7.1',
        'ogn-client==1.2.1',
        'mgrs==1.4.0',
        'psycopg2-binary==2.8.6',
        'xmlunittest==0.5.0',
        'flower==0.9.7',
        'tqdm==4.61.0',
        'requests==2.25.1',
        'matplotlib==3.3.4',
        'bokeh==2.3.2',
        'pandas==1.1.5',
        'flydenity==0.1.6',
        'gunicorn==20.1.0'
    ],
    test_require=[
        'pytest==5.0.1',
        'flake8==1.1.1',
        'xmlunittest==0.4.0',
    ],
    zip_safe=False
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
#
# Resource to Android Page Compiler
# Handles JS, CSS and HTML files only
#
import os, sys, re, shutil, tempfile, run, codecs, traceback, types
import jspacker, simplejson
from xml.sax.saxutils import escape
from sgmllib import SGMLParser
from csspacker import CSSPacker
from deltafy import Deltafy
import bindings

ignoreFiles = ['.gitignore', '.cvsignore', '.DS_Store']
ignoreDirs = ['.git','.svn','_svn', 'CVS']
ignoreSymbols = ['version','userAgent','name','_JSON','include','fireEvent','addEventListener','removeEventListener','buildhash','builddate']
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))

# class for extracting javascripts
class ScriptProcessor(SGMLParser):
	def __init__(self):
		SGMLParser.__init__(self)
		self.scripts = []

	def unknown_starttag(self, tag, attrs):
		if tag == 'script':
			for attr in attrs:
				if attr[0]=='src':
					self.scripts.append(attr[1])

class Compiler(object):
	def __init__(self,tiapp,project_dir,java,classes_dir,root_dir, include_all_modules=False):
		self.tiapp = tiapp
		self.java = java
		self.appname = tiapp.properties['name']
		self.classes_dir = classes_dir
		self.template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
		self.appid = tiapp.properties['id']
		self.root_dir = root_dir
		self.project_dir = os.path.abspath(os.path.expanduser(project_dir))
		self.modules = set()
		self.jar_libraries = set()

		json_contents = open(os.path.join(self.template_dir,'dependency.json')).read()
		self.depends_map = simplejson.loads(json_contents)

		# go ahead and slurp in any required modules
		for required in self.depends_map['required']:
			self.add_required_module(required)

		if (tiapp.has_app_property('ti.android.include_all_modules')):
			if tiapp.to_bool(tiapp.get_app_property('ti.android.include_all_modules')):
				include_all_modules = True
		if include_all_modules:
			print '[INFO] Force including all modules...'
			sys.stdout.flush()
			for module in bindings.get_all_module_names():
				self.add_required_module(module)

		self.module_methods = set()
		self.js_files = {}
		self.html_scripts = []
		self.compiled_files = []

	def add_required_module(self, name):
		name = name.lower()
		if name in ('buildhash','builddate'): return # ignore these
		if not name in self.modules:
			self.modules.add(name)
			module_jar = bindings.find_module_jar(name)
			if module_jar != None and os.path.exists(module_jar):
				print "[DEBUG] detected module %s, path = %s" % (name, module_jar)
				self.jar_libraries.add(module_jar)
			else:
				print "[DEBUG] unknown module = %s" % name

			if self.depends_map['libraries'].has_key(name):
				for lib in self.depends_map['libraries'][name]:
					lf = os.path.join(self.template_dir,lib)
					if os.path.exists(lf):
						if not lf in self.jar_libraries:
							print "[DEBUG] adding required library: %s" % lib
							self.jar_libraries.add(lf)

			if self.depends_map['dependencies'].has_key(name):
				for depend in self.depends_map['dependencies'][name]:
					self.add_required_module(depend)

	def is_module(self, name):
		if name.isupper(): return False # completely upper case signifies a constant
		if not name[0].isupper() and name != "iPhone": return False
		if 'iPhone.' in name: return False

		return True

	def extract_from_namespace(self, name, line):
		modules = set()
		methods = set()
		symbols = re.findall(r'%s\.(\w+)' % name, line)
		if len(symbols) == 0:
			return modules, methods

		for sym in symbols:
			sub_symbols = self.extract_from_namespace("%s.%s" % (name, sym), line)
			for module in sub_symbols[0]:
				modules.add("%s.%s" % (sym, module))
			for method_name in sub_symbols[1]:
				method_name = "%s.%s" % (sym, method_name)
				methods.add(method_name)

			if sym in ignoreSymbols:
				continue

			if self.is_module(sym):
				modules.add(sym)
			else:
				methods.add(sym)
		return modules, methods

	def extract_and_combine_modules(self, name, line):
		modules, methods = self.extract_from_namespace(name, line)
		for module in modules:
			self.add_required_module(module)
		for method in methods:
			self.module_methods.add(method)

	def extract_modules(self,out):
		for line in out.split(';'):
			self.extract_and_combine_modules('Titanium',line)
			self.extract_and_combine_modules('Ti',line)

	def compile_javascript(self, fullpath):
		js_jar = os.path.join(self.template_dir, 'js.jar')
		# poor man's os.path.relpath (we don't have python 2.6 in windows)
		resource_relative_path = fullpath[len(self.project_dir)+1:].replace("\\", "/")

		# chop off '.js'
		js_class_name = resource_relative_path[:-3]
		escape_chars = ['\\', '/', ' ', '.','-']
		for escape_char in escape_chars:
			js_class_name = js_class_name.replace(escape_char, '_')

		# TODO: add closure compiling too?
		jsc_args = [self.java, '-classpath', js_jar, 'org.mozilla.javascript.tools.jsc.Main',
			'-main-method-class', 'org.appcelerator.titanium.TiScriptRunner',
			'-nosource', '-package', self.appid + '.js', '-encoding', 'utf8',
			'-o', js_class_name, '-d', self.classes_dir, fullpath]

		print "[INFO] Compiling javascript: %s" % resource_relative_path
		sys.stdout.flush()
		so, se = run.run(jsc_args, ignore_error=True, return_error=True)
		if not se is None and len(se):
			sys.stderr.write("[ERROR] %s\n" % se)
			sys.stderr.flush()
			sys.exit(1)

	def compile_into_bytecode(self, paths):
		compile_js = False
		# we only optimize for production deploy type or if it's forcefully overridden with ti.android.compilejs
		if self.tiapp.has_app_property("ti.android.compilejs"):
			if self.tiapp.to_bool(self.tiapp.get_app_property('ti.android.compilejs')):
				print "[DEBUG] Found ti.android.compilejs=true, overriding default (this may take some time)"
				sys.stdout.flush()
				compile_js = True
		elif self.tiapp.has_app_property('ti.deploytype'):
			if self.tiapp.get_app_property('ti.deploytype') == 'production':
				print "[DEBUG] Deploy type is production, turning on JS compilation"
				sys.stdout.flush()
				compile_js = True

		if not compile_js: return

		for fullpath in paths:
			# skip any JS found inside HTML <script>
			if fullpath in self.html_scripts: continue
			self.compile_javascript(fullpath)

	def get_ext(self, path):
		fp = os.path.splitext(path)
		return fp[1][1:]

	def make_function_from_file(self, path, pack=True):
		ext = self.get_ext(path)
		path = os.path.expanduser(path)
		file_contents = codecs.open(path,'r',encoding='utf-8').read()

		if pack:
			file_contents = self.pack(path, ext, file_contents)

		if ext == 'js':
			# determine which modules this file is using
			self.extract_modules(file_contents)

		return file_contents

	def pack(self, path, ext, file_contents):
		def jspack(c): return jspacker.jsmin(c)
		def csspack(c): return CSSPacker(c).pack()

		packers = {'js': jspack, 'css': csspack }
		if ext in packers:
			file_contents = packers[ext](file_contents)
			of = codecs.open(path,'w',encoding='utf-8')
			of.write(file_contents)
			of.close()
		return file_contents

	def extra_source_inclusions(self,path):
		content = codecs.open(path,'r',encoding='utf-8').read()
		p = ScriptProcessor()
		p.feed(content)
		p.close()
		for script in p.scripts:
			# ignore remote scripts
			if script.startswith('http://') or script.startswith('https://'): continue
			# resolve to a full path
			p = os.path.abspath(os.path.join(os.path.join(path,'..'),script))
			self.html_scripts.append(p)

	def compile(self, compile_bytecode=True, info_message="Compiling Javascript Resources ..."):
		if info_message:
			print "[INFO] %s" % info_message
		sys.stdout.flush()
		for root, dirs, files in os.walk(self.project_dir):
			for dir in dirs:
				if dir in ignoreDirs:
					dirs.remove(dir)
			if len(files) > 0:
				prefix = root[len(self.project_dir):]
				for f in files:
					fp = os.path.splitext(f)
					if len(fp)!=2: continue
					if fp[1] == '.jss': continue
					if not fp[1] in ['.html','.js','.css']: continue
					if f in ignoreFiles: continue
					fullpath = os.path.join(root,f)
					if fp[1] == '.html':
						self.extra_source_inclusions(fullpath)
					if fp[1] == '.js':
						relative = prefix[1:]
						js_contents = self.make_function_from_file(fullpath, pack=False)
						if relative!='':
							key = "%s_%s" % (relative,f)
						else:
							key = f
						key = key.replace('.js','').replace('\\','_').replace('/','_').replace(' ','_').replace('.','_')
						self.js_files[fullpath] = (key, js_contents)
		if compile_bytecode:
			self.compile_into_bytecode(self.js_files)

if __name__ == "__main__":
	if len(sys.argv) != 2:
		print "Usage: %s <projectdir>" % sys.argv[0]
		sys.exit(1)

	project_dir = os.path.expanduser(sys.argv[1])
	resources_dir = os.path.join(project_dir, 'Resources')
	root_dir = os.path.join(project_dir, 'build', 'android')
	destdir = os.path.join(root_dir, 'bin', 'classes')
	sys.path.append("..")
	from tiapp import TiAppXML
	tiapp = TiAppXML(os.path.join(project_dir, 'tiapp.xml'))

	c = Compiler(tiapp, resources_dir, 'java', destdir, root_dir)
	project_deltafy = Deltafy(resources_dir)
	project_deltas = project_deltafy.scan()
	c.compile()
<commit_msg>TIMOB-3465 Fix detection of XML module<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
#
# Resource to Android Page Compiler
# Handles JS, CSS and HTML files only
#
import os, sys, re, shutil, tempfile, run, codecs, traceback, types
import jspacker, simplejson
from xml.sax.saxutils import escape
from sgmllib import SGMLParser
from csspacker import CSSPacker
from deltafy import Deltafy
import bindings

ignoreFiles = ['.gitignore', '.cvsignore', '.DS_Store']
ignoreDirs = ['.git','.svn','_svn', 'CVS']
ignoreSymbols = ['version','userAgent','name','_JSON','include','fireEvent','addEventListener','removeEventListener','buildhash','builddate']
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))

# class for extracting javascripts
class ScriptProcessor(SGMLParser):
	def __init__(self):
		SGMLParser.__init__(self)
		self.scripts = []

	def unknown_starttag(self, tag, attrs):
		if tag == 'script':
			for attr in attrs:
				if attr[0]=='src':
					self.scripts.append(attr[1])

class Compiler(object):
	def __init__(self,tiapp,project_dir,java,classes_dir,root_dir, include_all_modules=False):
		self.tiapp = tiapp
		self.java = java
		self.appname = tiapp.properties['name']
		self.classes_dir = classes_dir
		self.template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
		self.appid = tiapp.properties['id']
		self.root_dir = root_dir
		self.project_dir = os.path.abspath(os.path.expanduser(project_dir))
		self.modules = set()
		self.jar_libraries = set()

		json_contents = open(os.path.join(self.template_dir,'dependency.json')).read()
		self.depends_map = simplejson.loads(json_contents)

		# go ahead and slurp in any required modules
		for required in self.depends_map['required']:
			self.add_required_module(required)

		if (tiapp.has_app_property('ti.android.include_all_modules')):
			if tiapp.to_bool(tiapp.get_app_property('ti.android.include_all_modules')):
				include_all_modules = True
		if include_all_modules:
			print '[INFO] Force including all modules...'
			sys.stdout.flush()
			for module in bindings.get_all_module_names():
				self.add_required_module(module)

		self.module_methods = set()
		self.js_files = {}
		self.html_scripts = []
		self.compiled_files = []

	def add_required_module(self, name):
		name = name.lower()
		if name in ('buildhash','builddate'): return # ignore these
		if not name in self.modules:
			self.modules.add(name)
			module_jar = bindings.find_module_jar(name)
			if module_jar != None and os.path.exists(module_jar):
				print "[DEBUG] detected module %s, path = %s" % (name, module_jar)
				self.jar_libraries.add(module_jar)
			else:
				print "[DEBUG] unknown module = %s" % name

			if self.depends_map['libraries'].has_key(name):
				for lib in self.depends_map['libraries'][name]:
					lf = os.path.join(self.template_dir,lib)
					if os.path.exists(lf):
						if not lf in self.jar_libraries:
							print "[DEBUG] adding required library: %s" % lib
							self.jar_libraries.add(lf)

			if self.depends_map['dependencies'].has_key(name):
				for depend in self.depends_map['dependencies'][name]:
					self.add_required_module(depend)

	def is_module(self, name):
		ucase_module_names = ("XML", "API", "JSON", "UI")
		if name.isupper() and name not in ucase_module_names: return False # completely upper case signifies a constant
		if not name[0].isupper() and name != "iPhone": return False
		if 'iPhone.' in name: return False

		return True

	def extract_from_namespace(self, name, line):
		modules = set()
		methods = set()
		symbols = re.findall(r'%s\.(\w+)' % name, line)
		if len(symbols) == 0:
			return modules, methods

		for sym in symbols:
			sub_symbols = self.extract_from_namespace("%s.%s" % (name, sym), line)
			for module in sub_symbols[0]:
				modules.add("%s.%s" % (sym, module))
			for method_name in sub_symbols[1]:
				method_name = "%s.%s" % (sym, method_name)
				methods.add(method_name)

			if sym in ignoreSymbols:
				continue

			if self.is_module(sym):
				modules.add(sym)
			else:
				methods.add(sym)
		return modules, methods

	def extract_and_combine_modules(self, name, line):
		modules, methods = self.extract_from_namespace(name, line)
		for module in modules:
			self.add_required_module(module)
		for method in methods:
			self.module_methods.add(method)

	def extract_modules(self,out):
		for line in out.split(';'):
			self.extract_and_combine_modules('Titanium',line)
			self.extract_and_combine_modules('Ti',line)

	def compile_javascript(self, fullpath):
		js_jar = os.path.join(self.template_dir, 'js.jar')
		# poor man's os.path.relpath (we don't have python 2.6 in windows)
		resource_relative_path = fullpath[len(self.project_dir)+1:].replace("\\", "/")

		# chop off '.js'
		js_class_name = resource_relative_path[:-3]
		escape_chars = ['\\', '/', ' ', '.','-']
		for escape_char in escape_chars:
			js_class_name = js_class_name.replace(escape_char, '_')

		# TODO: add closure compiling too?
		jsc_args = [self.java, '-classpath', js_jar, 'org.mozilla.javascript.tools.jsc.Main',
			'-main-method-class', 'org.appcelerator.titanium.TiScriptRunner',
			'-nosource', '-package', self.appid + '.js', '-encoding', 'utf8',
			'-o', js_class_name, '-d', self.classes_dir, fullpath]

		print "[INFO] Compiling javascript: %s" % resource_relative_path
		sys.stdout.flush()
		so, se = run.run(jsc_args, ignore_error=True, return_error=True)
		if not se is None and len(se):
			sys.stderr.write("[ERROR] %s\n" % se)
			sys.stderr.flush()
			sys.exit(1)

	def compile_into_bytecode(self, paths):
		compile_js = False
		# we only optimize for production deploy type or if it's forcefully overridden with ti.android.compilejs
		if self.tiapp.has_app_property("ti.android.compilejs"):
			if self.tiapp.to_bool(self.tiapp.get_app_property('ti.android.compilejs')):
				print "[DEBUG] Found ti.android.compilejs=true, overriding default (this may take some time)"
				sys.stdout.flush()
				compile_js = True
		elif self.tiapp.has_app_property('ti.deploytype'):
			if self.tiapp.get_app_property('ti.deploytype') == 'production':
				print "[DEBUG] Deploy type is production, turning on JS compilation"
				sys.stdout.flush()
				compile_js = True

		if not compile_js: return

		for fullpath in paths:
			# skip any JS found inside HTML <script>
			if fullpath in self.html_scripts: continue
			self.compile_javascript(fullpath)

	def get_ext(self, path):
		fp = os.path.splitext(path)
		return fp[1][1:]

	def make_function_from_file(self, path, pack=True):
		ext = self.get_ext(path)
		path = os.path.expanduser(path)
		file_contents = codecs.open(path,'r',encoding='utf-8').read()

		if pack:
			file_contents = self.pack(path, ext, file_contents)

		if ext == 'js':
			# determine which modules this file is using
			self.extract_modules(file_contents)

		return file_contents

	def pack(self, path, ext, file_contents):
		def jspack(c): return jspacker.jsmin(c)
		def csspack(c): return CSSPacker(c).pack()

		packers = {'js': jspack, 'css': csspack }
		if ext in packers:
			file_contents = packers[ext](file_contents)
			of = codecs.open(path,'w',encoding='utf-8')
			of.write(file_contents)
			of.close()
		return file_contents

	def extra_source_inclusions(self,path):
		content = codecs.open(path,'r',encoding='utf-8').read()
		p = ScriptProcessor()
		p.feed(content)
		p.close()
		for script in p.scripts:
			# ignore remote scripts
			if script.startswith('http://') or script.startswith('https://'): continue
			# resolve to a full path
			p = os.path.abspath(os.path.join(os.path.join(path,'..'),script))
			self.html_scripts.append(p)

	def compile(self, compile_bytecode=True, info_message="Compiling Javascript Resources ..."):
		if info_message:
			print "[INFO] %s" % info_message
		sys.stdout.flush()
		for root, dirs, files in os.walk(self.project_dir):
			for dir in dirs:
				if dir in ignoreDirs:
					dirs.remove(dir)
			if len(files) > 0:
				prefix = root[len(self.project_dir):]
				for f in files:
					fp = os.path.splitext(f)
					if len(fp)!=2: continue
					if fp[1] == '.jss': continue
					if not fp[1] in ['.html','.js','.css']: continue
					if f in ignoreFiles: continue
					fullpath = os.path.join(root,f)
					if fp[1] == '.html':
						self.extra_source_inclusions(fullpath)
					if fp[1] == '.js':
						relative = prefix[1:]
						js_contents = self.make_function_from_file(fullpath, pack=False)
						if relative!='':
							key = "%s_%s" % (relative,f)
						else:
							key = f
						key = key.replace('.js','').replace('\\','_').replace('/','_').replace(' ','_').replace('.','_')
						self.js_files[fullpath] = (key, js_contents)
		if compile_bytecode:
			self.compile_into_bytecode(self.js_files)

if __name__ == "__main__":
	if len(sys.argv) != 2:
		print "Usage: %s <projectdir>" % sys.argv[0]
		sys.exit(1)

	project_dir = os.path.expanduser(sys.argv[1])
	resources_dir = os.path.join(project_dir, 'Resources')
	root_dir = os.path.join(project_dir, 'build', 'android')
	destdir = os.path.join(root_dir, 'bin', 'classes')
	sys.path.append("..")
	from tiapp import TiAppXML
	tiapp = TiAppXML(os.path.join(project_dir, 'tiapp.xml'))

	c = Compiler(tiapp, resources_dir, 'java', destdir, root_dir)
	project_deltafy = Deltafy(resources_dir)
	project_deltas = project_deltafy.scan()
	c.compile()
<|endoftext|>


<commit_before>from distutils.core import setup
import os
import shutil

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name = "Theia",
    version = "0.0.1",
    author = "Ryan Cote",
    author_email = "minervaconsole@gmail.com",
    description = ("A python remote packet capture and replay utility"),
    license = "Apache 2.0",
    keywords = "security pcap",
    url = "http://github.com/rc1405/theia.git",
    packages=['theia',],
    long_description=read('README.md'),
    classifiers=[
        "Development Status :: Alpha",
        "Topic :: Utilities",
        "License :: Apache 2.0",
    ],
    data_files = [('/etc/theia', ['conf/agent.yaml','conf/server.yaml'])]
    scripts = ["theia-server.py", "theia-agent.py", "theia-genkey.py"]
)
<commit_msg>Install changes<commit_after>from distutils.core import setup
import os
import shutil

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name = "Theia",
    version = "0.0.1",
    author = "Ryan Cote",
    author_email = "minervaconsole@gmail.com",
    description = ("A python remote packet capture and replay utility"),
    license = "Apache 2.0",
    keywords = "security pcap",
    url = "http://github.com/rc1405/theia.git",
    packages=['theia',],
    long_description=read('README.md'),
    classifiers=[
        "Development Status :: 2 - Pre-Alpha",
        "Topic :: Utilities",
        "License :: Apache 2.0",
    ],
    requires=[
        "pyzmq",
        "cryptography",
        "PyYAML",
        "msgpack"
    ],
    data_files = [('/etc/theia', ['conf/agent.yaml','conf/server.yaml'])],
    scripts = ["theia-server.py", "theia-agent.py", "theia-genkey.py"]
)
<|endoftext|>


<commit_before>#!/usr/bin/python
"""
Usage: xtrabackup_send.py <hostname>
Author: Matthieu 'Korrigan' Rosinski <mro@quanta-computing.com>

This script runs xtrabackup and pipe the output to <hostname>

"""
import os
import sys

import subprocess
import argparse

opts = None

def main():
    """
    Main entry point for xtrabackup_send

    """
    global opts

    parser = argparse.ArgumentParser(
        description='This program is a wrapper for sending xtrabackup to a target over SSH',
        epilog='Copyright Quanta-computing 2014',
        )
    parser.add_argument('-u', '--user', help='Specifies the remote user to use for SSH auth')
    parser.add_argument('-k', '--ssh-key', help='Specified a custom ssh key to use')
    parser.add_argument('-d', '--debug', action='store_true', help='Switch to loglevel DEBUG')
    parser.add_argument('host', help='The remote hostname or IP address')
    opts = parser.parse_args()
    send_backup(opts.host)

def send_backup(host):
    """
    Executes innobackupex and pipe it trough gzip and ssh

    """
    ssh_host = host
    ssh_key = []
    if opts.user:
        ssh_host = "{}@{}".format(opts.user, ssh_host)
    if opts.ssh_key:
        ssh_key = ['-i', opts.ssh_key]
    ssh = subprocess.Popen(['ssh', ssh_host] + ssh_key,
                           stdin=subprocess.PIPE)
    gzip = subprocess.Popen(['gzip', '-q', '-c', '-'],
                            stdin=subprocess.PIPE,
                            stdout=ssh.stdin)
    xtrabackup = subprocess.Popen(['innobackupex', '--stream=tar', '/tmp'],
                                  stdout=gzip.stdin)
    pids = [gzip.pid, xtrabackup.pid, ssh.pid]
    status = 0
    while len(pids):
        pid, ret = os.wait()
        pids.remove(pid)
        status += ret
    sys.exit(status)

if __name__ == "__main__":
    main()
<commit_msg>updated send script with debug info<commit_after>#!/usr/bin/python
"""
Usage: xtrabackup_send.py <hostname>
Author: Matthieu 'Korrigan' Rosinski <mro@quanta-computing.com>

This script runs xtrabackup and pipe the output to <hostname>

"""
import os
import sys

import subprocess
import argparse

opts = None

def main():
    """
    Main entry point for xtrabackup_send

    """
    global opts

    parser = argparse.ArgumentParser(
        description='This program is a wrapper for sending xtrabackup to a target over SSH',
        epilog='Copyright Quanta-computing 2014',
        )
    parser.add_argument('-u', '--user', help='Specifies the remote user to use for SSH auth')
    parser.add_argument('-k', '--ssh-key', help='Specified a custom ssh key to use')
    parser.add_argument('-d', '--debug', action='store_true', help='Switch to loglevel DEBUG')
    parser.add_argument('host', help='The remote hostname or IP address')
    opts = parser.parse_args()
    send_backup(opts.host)

def send_backup(host):
    """
    Executes innobackupex and pipe it trough gzip and ssh

    """
    ssh_host = host
    ssh_key = []
    if opts.user:
        ssh_host = "{}@{}".format(opts.user, ssh_host)
    if opts.ssh_key:
        ssh_key = ['-i', opts.ssh_key]
    ssh = subprocess.Popen(['ssh', ssh_host] + ssh_key,
                           stdin=subprocess.PIPE)
    gzip = subprocess.Popen(['gzip', '-q', '-c', '-'],
                            stdin=subprocess.PIPE,
                            stdout=ssh.stdin)
    xtrabackup = subprocess.Popen(['innobackupex', '--stream=tar', '/tmp'],
                                  stdout=gzip.stdin)
    pids = [gzip.pid, xtrabackup.pid, ssh.pid]
    status = 0
    while len(pids) > 0:
        print "Waiting for pids [{}] to exit".format(pids)
        pid, ret = os.wait()
        print "PID {} exited with status {}".format(pid, ret)
        pids.remove(pid)
        status += ret
    sys.exit(status)

if __name__ == "__main__":
    main()
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

__author__ = 'Alexey Zankevich'

setup(
    name="django-orm-sugar",
    version="0.2.1",
    py_modules=['django_orm_sugar'],
    author="Alexey Zankevich",
    author_email="alex.zankevich@gmail.com",
    description="Django ORM sugar library to simplify querying",
    keywords=['Django', 'ORM', 'util', 'sugar'],
    license="MIT",
    classifiers=["Framework :: Django :: 1.8",
                 "Programming Language :: Python :: 2.7",
                 "Programming Language :: Python :: 3.0",
                 "Programming Language :: Python :: 3.1",
                 "Programming Language :: Python :: 3.2",
                 "Programming Language :: Python :: 3.3",
                 "Programming Language :: Python :: 3.4",
                 "Programming Language :: Python :: 3.5"
    ]
)

<commit_msg>updated setup file<commit_after>from setuptools import setup, find_packages

__author__ = 'Alexey Zankevich'

LONG_DESCRIPTION = open('README.md').read()

setup(
    name="django-orm-sugar",
    version="0.2.1",
    py_modules=['django_orm_sugar'],
    author="Alexey Zankevich",
    author_email="alex.zankevich@gmail.com",
    description="Django ORM sugar library to simplify querying",
    keywords=['Django', 'ORM', 'util', 'sugar'],
    license="MIT",
    platforms=['Platform Independent'],
    url="https://github.com/Nepherhotep/django-orm-sugar",
    install_requires=['django'],
    classifiers=["Framework :: Django :: 1.8",
                 "Programming Language :: Python :: 2.7",
                 "Programming Language :: Python :: 3.0",
                 "Programming Language :: Python :: 3.1",
                 "Programming Language :: Python :: 3.2",
                 "Programming Language :: Python :: 3.3",
                 "Programming Language :: Python :: 3.4",
                 "Programming Language :: Python :: 3.5"]
)

<|endoftext|>


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

import logging
import os
from datetime import datetime
from pathlib import Path

import pytz
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.text import slugify

from survey.models import Survey

LOGGER = logging.getLogger(__name__)

class Survey2X:

    """ Abstract class for Survey exporter. """

    def __init__(self, survey=None):
        self._check_survey(survey)
        self.survey = survey

    def _check_survey(self, survey):
        if not isinstance(survey, Survey):
            msg = "Expected Survey not '{}'".format(survey.__class__.__name__)
            raise TypeError(msg)

    def _get_x(self):
        return self.__class__.__name__.split("Survey2")[1].lower()

    def _get_x_dir(self):
        directory_name = "{}_DIRECTORY".format(self._get_x().upper())
        try:
            return getattr(settings, directory_name)
        except:
            raise ImproperlyConfigured("Please define a value for {} in your settings".format(directory_name))

    def file_name(self):
        """ Return the csv file name for a Survey.

        :param Survey survey: The survey we're treating. """
        file_name = "{}.{}".format(slugify(self.survey.name), self._get_x())
        path = Path(self._get_x_dir(), file_name)
        return str(path)

    @property
    def file_modification_time(self):
        """ Return the modification time of the "x" file. """
        if not os.path.exists(self.file_name()):
            earliest_working_timestamp_for_windows = 86400
            mtime = earliest_working_timestamp_for_windows
        else:
            mtime = os.path.getmtime(self.file_name())
        mtime = datetime.utcfromtimestamp(mtime)
        mtime = mtime.replace(tzinfo=pytz.timezone("UTC"))
        return mtime

    @property
    def latest_answer_date(self):
        """ The date at which the last answer was given"""
        return self.survey.latest_answer_date()

    def need_update(self):
        """ Does a file need an update ?
        If the file was generated before the last answer was given, it needs update. """
        latest_answer_date = self.latest_answer_date
        no_response_at_all = latest_answer_date is None
        if no_response_at_all:
            return False
        file_modification_time = self.file_modification_time
        LOGGER.debug(
            "We %sneed an update because latest_answer_date=%s > file_modification_time=%s is %s \n",
            "" if latest_answer_date > file_modification_time else "do not ",
            latest_answer_date,
            file_modification_time,
            latest_answer_date > file_modification_time,
        )
        return latest_answer_date >= file_modification_time

    def __str__(self):
        """ Return a string that will be written into a file.

        :rtype String:
        """
        raise NotImplementedError("Please implement __str__")

    def generate_file(self):
        """ Generate a x file corresponding to a Survey. """
        LOGGER.debug("Exporting survey '%s' to %s", self.survey, self._get_x())
        file_path = Path(self.file_name())
        if not file_path.parent.exists():
            raise NotADirectoryError(file_path.parent)
        try:
            with open(file_path, "w", encoding="UTF-8") as f:
                f.write(str(self))
            LOGGER.info("Wrote %s in %s", self._get_x(), self.file_name())
        except IOError as exc:
            msg = "Must fix {} ".format(self._get_x_dir())
            msg += "in order to generate {} : {}".format(self._get_x(), exc)
            raise IOError(msg)
<commit_msg>Fix R0201: Method could be a function<commit_after># -*- coding: utf-8 -*-

import logging
import os
from datetime import datetime
from pathlib import Path

import pytz
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.text import slugify

from survey.models import Survey

LOGGER = logging.getLogger(__name__)

class Survey2X:

    """ Abstract class for Survey exporter. """

    def __init__(self, survey=None):
        self._check_survey(survey)
        self.survey = survey

    @staticmethod
    def _check_survey(survey):
        if not isinstance(survey, Survey):
            msg = "Expected Survey not '{}'".format(survey.__class__.__name__)
            raise TypeError(msg)

    def _get_x(self):
        return self.__class__.__name__.split("Survey2")[1].lower()

    def _get_x_dir(self):
        directory_name = "{}_DIRECTORY".format(self._get_x().upper())
        try:
            return getattr(settings, directory_name)
        except:
            raise ImproperlyConfigured("Please define a value for {} in your settings".format(directory_name))

    def file_name(self):
        """ Return the csv file name for a Survey.

        :param Survey survey: The survey we're treating. """
        file_name = "{}.{}".format(slugify(self.survey.name), self._get_x())
        path = Path(self._get_x_dir(), file_name)
        return str(path)

    @property
    def file_modification_time(self):
        """ Return the modification time of the "x" file. """
        if not os.path.exists(self.file_name()):
            earliest_working_timestamp_for_windows = 86400
            mtime = earliest_working_timestamp_for_windows
        else:
            mtime = os.path.getmtime(self.file_name())
        mtime = datetime.utcfromtimestamp(mtime)
        mtime = mtime.replace(tzinfo=pytz.timezone("UTC"))
        return mtime

    @property
    def latest_answer_date(self):
        """ The date at which the last answer was given"""
        return self.survey.latest_answer_date()

    def need_update(self):
        """ Does a file need an update ?
        If the file was generated before the last answer was given, it needs update. """
        latest_answer_date = self.latest_answer_date
        no_response_at_all = latest_answer_date is None
        if no_response_at_all:
            return False
        file_modification_time = self.file_modification_time
        LOGGER.debug(
            "We %sneed an update because latest_answer_date=%s > file_modification_time=%s is %s \n",
            "" if latest_answer_date > file_modification_time else "do not ",
            latest_answer_date,
            file_modification_time,
            latest_answer_date > file_modification_time,
        )
        return latest_answer_date >= file_modification_time

    def __str__(self):
        """ Return a string that will be written into a file.

        :rtype String:
        """
        raise NotImplementedError("Please implement __str__")

    def generate_file(self):
        """ Generate a x file corresponding to a Survey. """
        LOGGER.debug("Exporting survey '%s' to %s", self.survey, self._get_x())
        file_path = Path(self.file_name())
        if not file_path.parent.exists():
            raise NotADirectoryError(file_path.parent)
        try:
            with open(file_path, "w", encoding="UTF-8") as f:
                f.write(str(self))
            LOGGER.info("Wrote %s in %s", self._get_x(), self.file_name())
        except IOError as exc:
            msg = "Must fix {} ".format(self._get_x_dir())
            msg += "in order to generate {} : {}".format(self._get_x(), exc)
            raise IOError(msg)
<|endoftext|>


<commit_before>import os
from distutils.core import setup

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

README = read('README.md')

setup(
    name = "django-smart-load-tag",
    version = "0.1",
    url = 'http://github.com/codysoyland/django-smart-load-tag',
    license = 'BSD',
    description = "An attempt to bring namespaces and more control to Django's {% load %} tag.",
    long_description = README,
    author = 'Cody Soyland',
    author_email = 'codysoyland@gmail.com',
    packages = [
        'smart_load_tag',
        'smart_load_tag.templatetags',
    ],
    classifiers = [
        'Development Status :: 4 - Beta',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
    ]
)
<commit_msg>Version 0.2<commit_after>import os
from distutils.core import setup

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

README = read('README.md')

setup(
    name = "django-smart-load-tag",
    version = "0.2",
    url = 'http://github.com/codysoyland/django-smart-load-tag',
    license = 'BSD',
    description = "An attempt to bring namespaces and more control to Django's {% load %} tag.",
    long_description = README,
    author = 'Cody Soyland',
    author_email = 'codysoyland@gmail.com',
    packages = [
        'smart_load_tag',
        'smart_load_tag.templatetags',
    ],
    classifiers = [
        'Development Status :: 4 - Beta',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
    ]
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2020 GEM Foundation
#
# OpenQuake 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.
#
# OpenQuake 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 OpenQuake. If not, see <http://www.gnu.org/licenses/>.

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

if sys.version_info < (3, 6):
    sys.exit('Sorry, Python < 3.6 is not supported')

def get_version():
    version_re = r"^__version__\s+=\s+['\"]([^'\"]*)['\"]"
    version = None

    package_init = 'openquake/baselib/__init__.py'
    for line in open(package_init, 'r'):
        version_match = re.search(version_re, line, re.M)
        if version_match:
            version = version_match.group(1)
            break
    else:
        sys.exit('__version__ variable not found in %s' % package_init)

    return version

def get_readme():
    with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
                           'README.md'), encoding='utf-8') as readme:
        return readme.read()

version = get_version()
readme = get_readme()

url = "https://github.com/gem/oq-engine"

PY_MODULES = ['openquake.commands.__main__']

install_requires = [
    'setuptools',
    'h5py >=2.9, <2.11',
    'numpy >=1.16, <1.19',
    'scipy >=1.3, <1.5',
    'pandas >=0.25, <1.1',
    'pyzmq <20.0',
    'psutil >=2.0, <5.7',
    'shapely >=1.3, <1.8',
    'docutils >=0.11, <0.15',
    'decorator >=4.3',
    'django >=1.11, <2.3',
    'matplotlib >=1.5, <3.2',
    'requests >=2.20, <2.24',
    'pyshp ==1.2.3',
    'toml',
]

extras_require = {
    'celery':  ["celery >=4.0, <4.4"],
    'cluster': ["python-pam",
                "django-pam",
                "gunicorn",
                "python-prctl ==1.6.1",
                "setproctitle"],
    'osgeo':  [
        'pyproj >=1.9',
        'GDAL == 3.1.2',
    ],
    'dev':  [
        'pytest >=4.5',
        'flake8 >=3.5, <3.8',
        'pdbpp',
        'ipython',
        'silx == 0.10',
    ]
}

setup(
    name="openquake.engine",
    version=version,
    author="GEM Foundation",
    author_email="devops@openquake.org",
    maintainer='GEM Foundation',
    maintainer_email='devops@openquake.org',
    description=("Computes earthquake hazard and risk."),
    license="AGPL3",
    keywords="earthquake seismic hazard risk",
    url=url,
    long_description=readme,
    long_description_content_type='text/markdown',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Education',
        'Intended Audience :: Science/Research',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Operating System :: OS Independent',
        'Topic :: Scientific/Engineering',
        'Environment :: Console',
        'Environment :: Web Environment',
    ],
    packages=find_packages(exclude=["qa_tests", "qa_tests.*",
                                    "tools",
                                    "*.*.tests", "*.*.tests.*",
                                    "openquake.engine.bin",
                                    "openquake.engine.bin.*"]),
    py_modules=PY_MODULES,
    include_package_data=True,
    package_data={"openquake.engine": [
        "openquake.cfg", "README.md",
        "LICENSE", "CONTRIBUTORS.txt"]},
    namespace_packages=['openquake'],
    install_requires=install_requires,
    extras_require=extras_require,
    entry_points={
        'console_scripts': ['oq = openquake.commands.__main__:oq'],
    },
    test_loader='openquake.baselib.runtests:TestLoader',
    test_suite='openquake.risklib,openquake.commonlib,openquake.calculators',
    zip_safe=False,
    )
<commit_msg>GDAL >= 2.4 as on master<commit_after># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2020 GEM Foundation
#
# OpenQuake 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.
#
# OpenQuake 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 OpenQuake. If not, see <http://www.gnu.org/licenses/>.

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

if sys.version_info < (3, 6):
    sys.exit('Sorry, Python < 3.6 is not supported')

def get_version():
    version_re = r"^__version__\s+=\s+['\"]([^'\"]*)['\"]"
    version = None

    package_init = 'openquake/baselib/__init__.py'
    for line in open(package_init, 'r'):
        version_match = re.search(version_re, line, re.M)
        if version_match:
            version = version_match.group(1)
            break
    else:
        sys.exit('__version__ variable not found in %s' % package_init)

    return version

def get_readme():
    with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
                           'README.md'), encoding='utf-8') as readme:
        return readme.read()

version = get_version()
readme = get_readme()

url = "https://github.com/gem/oq-engine"

PY_MODULES = ['openquake.commands.__main__']

install_requires = [
    'setuptools',
    'h5py >=2.9, <2.11',
    'numpy >=1.16, <1.19',
    'scipy >=1.3, <1.5',
    'pandas >=0.25, <1.1',
    'pyzmq <20.0',
    'psutil >=2.0, <5.7',
    'shapely >=1.3, <1.8',
    'docutils >=0.11, <0.15',
    'decorator >=4.3',
    'django >=1.11, <2.3',
    'matplotlib >=1.5, <3.2',
    'requests >=2.20, <2.24',
    'pyshp ==1.2.3',
    'toml',
]

extras_require = {
    'celery':  ["celery >=4.0, <4.4"],
    'cluster': ["python-pam",
                "django-pam",
                "gunicorn",
                "python-prctl ==1.6.1",
                "setproctitle"],
    'osgeo':  [
        'pyproj >=1.9',
        'GDAL >= 2.4',
    ],
    'dev':  [
        'pytest >=4.5',
        'flake8 >=3.5, <3.8',
        'pdbpp',
        'ipython',
        'silx == 0.10',
    ]
}

setup(
    name="openquake.engine",
    version=version,
    author="GEM Foundation",
    author_email="devops@openquake.org",
    maintainer='GEM Foundation',
    maintainer_email='devops@openquake.org',
    description=("Computes earthquake hazard and risk."),
    license="AGPL3",
    keywords="earthquake seismic hazard risk",
    url=url,
    long_description=readme,
    long_description_content_type='text/markdown',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Education',
        'Intended Audience :: Science/Research',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Operating System :: OS Independent',
        'Topic :: Scientific/Engineering',
        'Environment :: Console',
        'Environment :: Web Environment',
    ],
    packages=find_packages(exclude=["qa_tests", "qa_tests.*",
                                    "tools",
                                    "*.*.tests", "*.*.tests.*",
                                    "openquake.engine.bin",
                                    "openquake.engine.bin.*"]),
    py_modules=PY_MODULES,
    include_package_data=True,
    package_data={"openquake.engine": [
        "openquake.cfg", "README.md",
        "LICENSE", "CONTRIBUTORS.txt"]},
    namespace_packages=['openquake'],
    install_requires=install_requires,
    extras_require=extras_require,
    entry_points={
        'console_scripts': ['oq = openquake.commands.__main__:oq'],
    },
    test_loader='openquake.baselib.runtests:TestLoader',
    test_suite='openquake.risklib,openquake.commonlib,openquake.calculators',
    zip_safe=False,
    )
<|endoftext|>


<commit_before>"""
YANK is a testbed for experimenting with algorithms for the efficient computation of small molecule binding free energies to biomolecular targets using alchemical methods.
YANK is built on OpenMM, the API for molecular simulation, and uses its GPU-accelerated library implementation for hardware acceleration.
"""
from __future__ import print_function
import os
import sys
import distutils.extension
from setuptools import setup, Extension, find_packages
import numpy
import glob
import os
from os.path import relpath, join
import subprocess
from Cython.Build import cythonize
DOCLINES = __doc__.split("\n")

########################
VERSION = "0.16.1"  # Primary base version of the build
DEVBUILD = None      # Dev build status, Either None or Integer as string
ISRELEASED = True  # Are we releasing this as a full cut?
__version__ = VERSION
########################
CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: The MIT License (MIT)
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

################################################################################
# Writing version control information to the module
################################################################################

def git_version():
    # Return the git revision as a string
    # copied from numpy setup.py
    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 write_version_py(filename='Yank/version.py'):
    cnt = """
# This file is automatically generated by setup.py
short_version = '{base_version:s}'
version = '{version:s}'
full_version = '{full_version:s}'
git_revision = '{git_revision:s}'
release = {isrelease:s}
"""
    # Adding the git rev number needs to be done inside write_version_py(),
    # otherwise the import of numpy.version messes up the build under Python 3.
    base_version = VERSION
    if DEVBUILD is not None and DEVBUILD != "None":
        local_version = base_version + ".dev" + DEVBUILD
    else:
        local_version = base_version
    full_version = local_version

    if os.path.exists('.git'):
        git_revision = git_version()
    else:
        git_revision = 'Unknown'

    if not ISRELEASED:
        full_version += '-' + git_revision[:7]

    a = open(filename, 'w')
    try:
        a.write(cnt.format(base_version=base_version,   # Base version e.g. X.Y.Z
                           version=local_version,       # Flushed out version, usually just base, but can be X.Y.Z.devN
                           full_version=full_version,   # Full version + git short hash, unless released
                           git_revision=git_revision,   # Matched full github hash
                           isrelease=str(ISRELEASED)))  # Released flag
    finally:
        a.close()

################################################################################
# USEFUL SUBROUTINES
################################################################################

def find_package_data(data_root, package_root):
    files = []
    for root, dirnames, filenames in os.walk(data_root):
        for fn in filenames:
            files.append(relpath(join(root, fn), package_root))
    return files

################################################################################
# SETUP
################################################################################

mixing_ext = distutils.extension.Extension("yank.mixing._mix_replicas", ['./Yank/mixing/_mix_replicas.pyx'])

write_version_py()
setup(
    name='yank',
    author='John Chodera',
    author_email='john.chodera@choderalab.org',
    description=DOCLINES[0],
    long_description="\n".join(DOCLINES[2:]),
    version=__version__,
    license='MIT',
    url='https://github.com/choderalab/yank',
    platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
    classifiers=CLASSIFIERS.splitlines(),
    package_dir={'yank': 'Yank'},
    packages=['yank', "yank.tests", "yank.tests.data", "yank.commands", "yank.mixing", "yank.reports"], #+ ['yank.{}'.format(package) for package in find_packages('yank')],
    package_data={'yank': find_package_data('Yank/tests/data', 'yank') + ['reports/*.ipynb'],
                  },
    zip_safe=False,
    install_requires=[
        'numpy',
        'scipy',
        'cython',
        'openmm',
        'pymbar',
        'openmmtools>=0.10.0',
        'docopt>=0.6.1',
        'netcdf4',
        'schema',
        'openmoltools',
        'mdtraj',
        'pyyaml'
        ],
    ext_modules=cythonize(mixing_ext),
    entry_points={'console_scripts': ['yank = yank.cli:main']})
<commit_msg>Bump to 0.16.2, deactivate release mode<commit_after>"""
YANK is a testbed for experimenting with algorithms for the efficient computation of small molecule binding free energies to biomolecular targets using alchemical methods.
YANK is built on OpenMM, the API for molecular simulation, and uses its GPU-accelerated library implementation for hardware acceleration.
"""
from __future__ import print_function
import os
import sys
import distutils.extension
from setuptools import setup, Extension, find_packages
import numpy
import glob
import os
from os.path import relpath, join
import subprocess
from Cython.Build import cythonize
DOCLINES = __doc__.split("\n")

########################
VERSION = "0.16.2"  # Primary base version of the build
DEVBUILD = "0"      # Dev build status, Either None or Integer as string
ISRELEASED = False  # Are we releasing this as a full cut?
__version__ = VERSION
########################
CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: The MIT License (MIT)
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

################################################################################
# Writing version control information to the module
################################################################################

def git_version():
    # Return the git revision as a string
    # copied from numpy setup.py
    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 write_version_py(filename='Yank/version.py'):
    cnt = """
# This file is automatically generated by setup.py
short_version = '{base_version:s}'
version = '{version:s}'
full_version = '{full_version:s}'
git_revision = '{git_revision:s}'
release = {isrelease:s}
"""
    # Adding the git rev number needs to be done inside write_version_py(),
    # otherwise the import of numpy.version messes up the build under Python 3.
    base_version = VERSION
    if DEVBUILD is not None and DEVBUILD != "None":
        local_version = base_version + ".dev" + DEVBUILD
    else:
        local_version = base_version
    full_version = local_version

    if os.path.exists('.git'):
        git_revision = git_version()
    else:
        git_revision = 'Unknown'

    if not ISRELEASED:
        full_version += '-' + git_revision[:7]

    a = open(filename, 'w')
    try:
        a.write(cnt.format(base_version=base_version,   # Base version e.g. X.Y.Z
                           version=local_version,       # Flushed out version, usually just base, but can be X.Y.Z.devN
                           full_version=full_version,   # Full version + git short hash, unless released
                           git_revision=git_revision,   # Matched full github hash
                           isrelease=str(ISRELEASED)))  # Released flag
    finally:
        a.close()

################################################################################
# USEFUL SUBROUTINES
################################################################################

def find_package_data(data_root, package_root):
    files = []
    for root, dirnames, filenames in os.walk(data_root):
        for fn in filenames:
            files.append(relpath(join(root, fn), package_root))
    return files

################################################################################
# SETUP
################################################################################

mixing_ext = distutils.extension.Extension("yank.mixing._mix_replicas", ['./Yank/mixing/_mix_replicas.pyx'])

write_version_py()
setup(
    name='yank',
    author='John Chodera',
    author_email='john.chodera@choderalab.org',
    description=DOCLINES[0],
    long_description="\n".join(DOCLINES[2:]),
    version=__version__,
    license='MIT',
    url='https://github.com/choderalab/yank',
    platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
    classifiers=CLASSIFIERS.splitlines(),
    package_dir={'yank': 'Yank'},
    packages=['yank', "yank.tests", "yank.tests.data", "yank.commands", "yank.mixing", "yank.reports"], #+ ['yank.{}'.format(package) for package in find_packages('yank')],
    package_data={'yank': find_package_data('Yank/tests/data', 'yank') + ['reports/*.ipynb'],
                  },
    zip_safe=False,
    install_requires=[
        'numpy',
        'scipy',
        'cython',
        'openmm',
        'pymbar',
        'openmmtools>=0.10.0',
        'docopt>=0.6.1',
        'netcdf4',
        'schema',
        'openmoltools',
        'mdtraj',
        'pyyaml'
        ],
    ext_modules=cythonize(mixing_ext),
    entry_points={'console_scripts': ['yank = yank.cli:main']})
<|endoftext|>