<commit_before>import math
import random
import matplotlib.pyplot as plt
import numpy as np

# Source: http://web.eecs.utk.edu/~plank/plank/papers/FAST-2005.pdf
LDPC_RATE = 1.0496
LDPC_XOR_PER_WORD = 30 / 4
RS_XOR_PER_WORD = 44.6

# Computational complexity of arithmetic operations
# Source:
# https://streamcomputing.eu/blog/2012-07-16/how-expensive-is-an-operation-on-a-cpu/
ADDITION_COMPLEXITY = 1
MULTIPLICATION_COMPLEXITY = 4

def rs_decoding_complexity(code_length, packet_size, erasure_prob):
    '''Compute the decoding complexity of Reed-Solomon codes

    Return the number of operations (additions and multiplications)
    required to decode a Reed-Solomon code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm.

    Args:
    code_length: The length of the code in number of coded symbols.
    packet_size: The size of a packet in number of symbols.
    erasure_prob: The erasure probability of the packet erasure channel.

    Returns: The total complexity of decoding.

    '''
    additions = code_length * (erasure_prob * code_length - 1) * packet_size
    multiplications = pow(code_length, 2) * erasure_prob * packet_size;
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def rs_decoding_complexity_large_packets(code_length, erasure_prob):
    '''Compute the decoding complexity of Reed-Solomon codes

    Return the number of operations (additions and multiplications)
    required to decode a Reed-Solomon code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm. This function
    considers the asymptotic case as the packet size approaches
    infinity.

    Args:
    code_length: The length of the code in number of coded symbols.
    erasure_prob: The erasure probability of the packet erasure channel.

    Returns:
    The total complexity of decoding.

    '''
    raise NotImplemented('Use the rs_decoding_complexity() method instead.')
    additions = code_length * (erasure_prob * code_length - 1)
    multiplications = pow(code_length, 2) * erasure_prob
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def block_diagonal_decoding_complexity(code_length, packet_size, erasure_prob, partitions):
    '''Compute the decoding complexity of a block-diagonal code

    Return the number of operations (additions and multiplications)
    required to decode a block-diagonal code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm. This function
    considers the asymptotic case as the packet size approaches
    infinity.

    Args:
    code_length: The length of the code in number of coded symbols.
    packet_size: The size of a packet in number of symbols.
    erasure_prob: The erasure probability of the packet erasure channel.
    partitions: The number of block-diagonal code partitions.

    Returns: The total complexity of decoding.

    '''
    assert isinstance(code_length, int)
    assert isinstance(packet_size, int)
    assert isinstance(erasure_prob, float)
    assert isinstance(partitions, int)
    assert code_length % partitions == 0, 'Partitions must divide code_length.'
    partition_length = code_length / partitions

    # TODO: Will this compute the correct complexity? There might be a
    # problem in that a packet may contain symbols from various partitions.
    partition_complexity = rs_decoding_complexity(partition_length, packet_size, erasure_prob)
    return partition_complexity * partitions

def peeling_decoding_complexity(code_length, code_rate, erasure_prob):
    '''Compute the decoding complexity of decoding an erasure code using a
    peeling decoder.

    Args:

    code_length: The length of the code in number of coded symbols.

    code_rate: The rate of the code as given by
    num_information_symbols / num_coded_symbols.

    erasure_prob: The packet erasure probability.

    Returns: The total complexity of decoding.

    '''
    information_symbols = round(code_length * code_rate)

    # Compute the average degree for the ideal Soliton distribution
    avg_check_degree = 1 / information_symbols
    avg_check_degree += sum([k / (k * (k - 1)) for k in range(2, information_symbols + 1)])

    num_iterations = round(code_length * erasure_prob)
    additions_per_iteration = avg_check_degree - 1
    multiplications_per_iteration = avg_check_degree
    complexity_per_iteration = additions_per_iteration * ADDITION_COMPLEXITY
    complexity_per_iteration += multiplications_per_iteration * MULTIPLICATION_COMPLEXITY
    return num_iterations * complexity_per_iteration

def matrix_vector_complexity(rows, cols):
    '''Compute the complexity of matrix-vector multiplication

    Return the complexity of multiplying a matrix A with number of
    rows and columns as given in the argument by a vector x. The
    multiplication is done as A*x.

    Args:
    rows: The number of rows of the matrix.
    cols: The number of columns of the matrix.

    Returns:
    The complexity of the multiplication.

    '''
    additions = cols * rows - 1
    multiplications = cols * rows
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def order_stat(icdf, total, kth):
    '''Compute the order statistic of a given distribution numerically

    Compute the k:th order statistic for total number of random
    variables with distribution given by the argument. Runs in O(total).

    Args:
    icdf: The inverse cumulative distribution function of the
    probability distribution of interest. Provided as a function with
    one argument.
    total: The total number of realizations.
    kth: The order to compute the statistic of.

    Returns:
    The k:th order statistic for total number of random variables
    with distribution given by the argument.

    '''
    # assert isinstance(icdf, fun)
    assert isinstance(total, int)
    assert isinstance(kth, int)
    assert total >= kth, 'kth must be less or equal to total.'
    realizations = [icdf(random.random()) for _ in range(total)]
    return np.partition(np.asarray(realizations), kth)[kth]

def expected_order_stat(icdf, total, kth, samples=1000):
    '''Compute the expected order statistic numerically

    Args:
    icdf: The inverse cumulative distribution function of the
    probability distribution of interest. Provided as a function with
    one argument.
    total: The total number of realizations.
    kth: The order to compute the statistic of.
    samples: Number of times to sample the order statistic.

    Returns:
    The expected k:th order statistic for total number of random variables
    with distribution given by the argument.
    '''
    realizations = [order_stat(icdf, total, kth) for _ in range(samples)]
    return sum(realizations) / (len(realizations) + 1)

def order_mean_shifted_exponential(total, kth, mu=1):
    '''Compute the expected k:th order statistic of a shifted exponential distribution

    The expectation is computed analytically.

    Args:
    total: The total number of realizations.
    kth: The order to compute the statistic of.
    mu: The exponential distribution parameter. Also called the straggling parameter.

    Returns:
    The k:th order statistic for total number of random variables
    distributed accoridng to the shifted expinential distribution.
    '''
    return 1 + (1 / mu) * math.log(total / (total - kth))

def icdf_shifted_exponential(value, mu=1):
    '''ICDF of the shifted exponential distribution.

    Pass uniformly distributed random numbers into this function to
    generate random numbers from the shifted exponential distribution.

    Args:
    value: The value to compute the ICDF of. Must be less than 1.
    mu: The exponential distribution parameter. Also called the straggling parameter.

    Returns:
    The ICDF evaluated at value.

    '''
    assert value < 1, 'Cannot compute the ICDF of values larger than or equal to 1.'
    return 1 - math.log(1 - value) / mu;

def main():
    map_servers = 600
    map_threshold = 400
    rate = map_threshold / map_servers

    # Compute the map latency by scaling it by the number of
    # operations performed by each server.

    rows = 1e5
    cols = 1e5
    vevtors_per_server = map_threshold

    map_complexity = matrix_vector_complexity(rows, cols, vectors )

    samples = 500
    map_runtimes = [order_stat(icdf_shifted_exponential, k, q) for _ in range(samples)]
    sample_mean = sum(runtimes) / (len(runtimes) + 1)

    # analytical_mean = order_mean_shifted_exponential(k, q)
    # print('Sample mean: ' + str(sample_mean) + '. Analytical mean: ' + str(analytical_mean) + '.')

    fig = plt.figure()
    plt.hist(runtimes)
    plt.grid(True, which='both')
    plt.ylabel('Probability', fontsize=18)
    plt.xlabel('Runtime', fontsize=18)
    plt.autoscale()
    plt.tight_layout()
    plt.show()
    return

if __name__ == '__main__':
    main()
<commit_msg>Finite field arithmetic cost.<commit_after>'''This module contains code for computing the complexity of various
operations.

'''

import math
import random
import matplotlib.pyplot as plt
import numpy as np

# Source: http://web.eecs.utk.edu/~plank/plank/papers/FAST-2005.pdf
LDPC_RATE = 1.0496
LDPC_XOR_PER_WORD = 30 / 4
RS_XOR_PER_WORD = 44.6

# Finite field arithmetic complexity for fields of size 2^100
# Source: Zhi, L., Higgins, J., & Clement, M. (2001).
# Performance of finite field arithmetic in an elliptic curve cryptosystem.

# Ignore addition cost to simplify analysis
# ADDITION_COMPLEXITY = 0.13e-6
ADDITION_COMPLEXITY = 0
MULTIPLICATION_COMPLEXITY = 87e-6

def rs_decoding_complexity(code_length, packet_size, erasure_prob):
    '''Compute the decoding complexity of Reed-Solomon codes

    Return the number of operations (additions and multiplications)
    required to decode a Reed-Solomon code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm.

    Args:
    code_length: The length of the code in number of coded symbols.
    packet_size: The size of a packet in number of symbols.
    erasure_prob: The erasure probability of the packet erasure channel.

    Returns: The total complexity of decoding.

    '''
    additions = code_length * (erasure_prob * code_length - 1) * packet_size
    multiplications = pow(code_length, 2) * erasure_prob * packet_size;
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def rs_decoding_complexity_large_packets(code_length, erasure_prob):
    '''Compute the decoding complexity of Reed-Solomon codes

    Return the number of operations (additions and multiplications)
    required to decode a Reed-Solomon code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm. This function
    considers the asymptotic case as the packet size approaches
    infinity.

    Args:
    code_length: The length of the code in number of coded symbols.
    erasure_prob: The erasure probability of the packet erasure channel.

    Returns:
    The total complexity of decoding.

    '''
    raise NotImplemented('Use the rs_decoding_complexity() method instead.')
    additions = code_length * (erasure_prob * code_length - 1)
    multiplications = pow(code_length, 2) * erasure_prob
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def block_diagonal_decoding_complexity(code_length, packet_size, erasure_prob, partitions):
    '''Compute the decoding complexity of a block-diagonal code

    Return the number of operations (additions and multiplications)
    required to decode a block-diagonal code over the packet erasure
    channel, and using the Berelkamp-Massey algorithm. This function
    considers the asymptotic case as the packet size approaches
    infinity.

    Args:
    code_length: The length of the code in number of coded symbols.
    packet_size: The size of a packet in number of symbols.
    erasure_prob: The erasure probability of the packet erasure channel.
    partitions: The number of block-diagonal code partitions.

    Returns: The total complexity of decoding.

    '''
    assert isinstance(code_length, int)
    assert isinstance(packet_size, int)
    assert isinstance(erasure_prob, float)
    assert isinstance(partitions, int)
    assert code_length % partitions == 0, 'Partitions must divide code_length.'
    partition_length = code_length / partitions
    partition_complexity = rs_decoding_complexity(partition_length, packet_size, erasure_prob)
    return partition_complexity * partitions

def peeling_decoding_complexity(code_length, code_rate, erasure_prob):
    '''Compute the decoding complexity of decoding an erasure code using a
    peeling decoder.

    Args:

    code_length: The length of the code in number of coded symbols.

    code_rate: The rate of the code as given by
    num_information_symbols / num_coded_symbols.

    erasure_prob: The packet erasure probability.

    Returns: The total complexity of decoding.

    '''
    information_symbols = round(code_length * code_rate)

    # Compute the average degree for the ideal Soliton distribution
    avg_check_degree = 1 / information_symbols
    avg_check_degree += sum([k / (k * (k - 1)) for k in range(2, information_symbols + 1)])

    num_iterations = round(code_length * erasure_prob)
    additions_per_iteration = avg_check_degree - 1
    multiplications_per_iteration = avg_check_degree
    complexity_per_iteration = additions_per_iteration * ADDITION_COMPLEXITY
    complexity_per_iteration += multiplications_per_iteration * MULTIPLICATION_COMPLEXITY
    return num_iterations * complexity_per_iteration

def matrix_vector_complexity(rows, cols):
    '''Compute the complexity of matrix-vector multiplication

    Return the complexity of multiplying a matrix A with number of
    rows and columns as given in the argument by a vector x. The
    multiplication is done as A*x.

    Args:

    rows: The number of rows of the matrix.

    cols: The number of columns of the matrix.

    Returns: The complexity of the multiplication.

    '''
    additions = cols * rows - 1
    multiplications = cols * rows
    return additions * ADDITION_COMPLEXITY + multiplications * MULTIPLICATION_COMPLEXITY

def order_stat(icdf, total, kth):
    '''Compute the order statistic of a given distribution numerically

    Compute the k:th order statistic for total number of random
    variables with distribution given by the argument. Runs in O(total).

    Args:
    icdf: The inverse cumulative distribution function of the
    probability distribution of interest. Provided as a function with
    one argument.
    total: The total number of realizations.
    kth: The order to compute the statistic of.

    Returns:
    The k:th order statistic for total number of random variables
    with distribution given by the argument.

    '''
    # assert isinstance(icdf, fun)
    assert isinstance(total, int)
    assert isinstance(kth, int)
    assert total >= kth, 'kth must be less or equal to total.'
    realizations = [icdf(random.random()) for _ in range(total)]
    return np.partition(np.asarray(realizations), kth)[kth]

def expected_order_stat(icdf, total, kth, samples=1000):
    '''Compute the expected order statistic numerically

    Args:
    icdf: The inverse cumulative distribution function of the
    probability distribution of interest. Provided as a function with
    one argument.
    total: The total number of realizations.
    kth: The order to compute the statistic of.
    samples: Number of times to sample the order statistic.

    Returns:
    The expected k:th order statistic for total number of random variables
    with distribution given by the argument.
    '''
    realizations = [order_stat(icdf, total, kth) for _ in range(samples)]
    return sum(realizations) / (len(realizations) + 1)

def order_mean_shifted_exponential(total, kth, mu=1):
    '''Compute the expected k:th order statistic of a shifted exponential distribution

    The expectation is computed analytically.

    Args:
    total: The total number of realizations.
    kth: The order to compute the statistic of.
    mu: The exponential distribution parameter. Also called the straggling parameter.

    Returns:
    The k:th order statistic for total number of random variables
    distributed accoridng to the shifted expinential distribution.
    '''
    return 1 + (1 / mu) * math.log(total / (total - kth))

def icdf_shifted_exponential(value, mu=1):
    '''ICDF of the shifted exponential distribution.

    Pass uniformly distributed random numbers into this function to
    generate random numbers from the shifted exponential distribution.

    Args:
    value: The value to compute the ICDF of. Must be less than 1.
    mu: The exponential distribution parameter. Also called the straggling parameter.

    Returns:
    The ICDF evaluated at value.

    '''
    assert value < 1, 'Cannot compute the ICDF of values larger than or equal to 1.'
    return 1 - math.log(1 - value) / mu;

def main():
    map_servers = 600
    map_threshold = 400
    rate = map_threshold / map_servers

    # Compute the map latency by scaling it by the number of
    # operations performed by each server.

    rows = 1e5
    cols = 1e5
    vevtors_per_server = map_threshold

    map_complexity = matrix_vector_complexity(rows, cols, vectors )

    samples = 500
    map_runtimes = [order_stat(icdf_shifted_exponential, k, q) for _ in range(samples)]
    sample_mean = sum(runtimes) / (len(runtimes) + 1)

    # analytical_mean = order_mean_shifted_exponential(k, q)
    # print('Sample mean: ' + str(sample_mean) + '. Analytical mean: ' + str(analytical_mean) + '.')

    fig = plt.figure()
    plt.hist(runtimes)
    plt.grid(True, which='both')
    plt.ylabel('Probability', fontsize=18)
    plt.xlabel('Runtime', fontsize=18)
    plt.autoscale()
    plt.tight_layout()
    plt.show()
    return

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


<commit_before>from setuptools import setup

setup(
    name='kibana',
    packages=['kibana'],
    version='0.6',
    description='Kibana configuration index (.kibana) command line interface and python API (visualization import/export and mappings refresh)',
    author='Ryan Farley',
    author_email='rfarley@mitre.org',
    url='https://github.com/rfarley3/Kibana',
    download_url='https://github.com/rfarley3/Kibana/tarball/0.4',
    keywords=['kibana', 'config', 'import', 'export', 'mappings'],
    classifiers=[],
    install_requires=(
        'elasticsearch',
        'argparse',
        'requests',
    ),
    entry_points={
        'console_scripts': [
            'dotkibana = kibana.__main__:main',
        ]
    },
)
<commit_msg>Fix download_url, ver bump to coordinate<commit_after>from setuptools import setup

setup(
    name='kibana',
    packages=['kibana'],
    version='0.7',
    description='Kibana configuration index (.kibana) command line interface and python API (visualization import/export and mappings refresh)',
    author='Ryan Farley',
    author_email='rfarley@mitre.org',
    url='https://github.com/rfarley3/Kibana',
    download_url='https://github.com/rfarley3/Kibana/tarball/0.7',
    keywords=['kibana', 'config', 'import', 'export', 'mappings'],
    classifiers=[],
    install_requires=(
        'elasticsearch',
        'argparse',
        'requests',
    ),
    entry_points={
        'console_scripts': [
            'dotkibana = kibana.__main__:main',
        ]
    },
)
<|endoftext|>


<commit_before>import re
from setuptools import setup, find_packages

EXTRAS_REQUIRE = {
    "marshmallow": ["marshmallow>=3.13.0"],
    "yaml": ["PyYAML>=3.10"],
    "validation": ["prance[osv]>=0.11"],
    "lint": ["flake8==3.9.2", "flake8-bugbear==21.4.3", "pre-commit~=2.4"],
    "docs": [
        "marshmallow>=3.13.0",
        "pyyaml==5.4.1",
        "sphinx==4.2.0",
        "sphinx-issues==1.2.0",
        "sphinx-rtd-theme==0.5.2",
    ],
}
EXTRAS_REQUIRE["tests"] = (
    EXTRAS_REQUIRE["yaml"]
    + EXTRAS_REQUIRE["validation"]
    + ["marshmallow>=3.13.0", "pytest", "mock"]
)
EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"]

def find_version(fname):
    """Attempts to find the version number in the file names fname.
    Raises RuntimeError if not found.
    """
    version = ""
    with open(fname) as fp:
        reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
        for line in fp:
            m = reg.match(line)
            if m:
                version = m.group(1)
                break
    if not version:
        raise RuntimeError("Cannot find version information.")
    return version

def read(fname):
    with open(fname) as fp:
        content = fp.read()
    return content

setup(
    name="apispec",
    version=find_version("src/apispec/__init__.py"),
    description="A pluggable API specification generator. Currently supports the "
    "OpenAPI Specification (f.k.a. the Swagger specification).",
    long_description=read("README.rst"),
    author="Steven Loria",
    author_email="sloria1@gmail.com",
    url="https://github.com/marshmallow-code/apispec",
    packages=find_packages("src"),
    package_dir={"": "src"},
    include_package_data=True,
    extras_require=EXTRAS_REQUIRE,
    license="MIT",
    zip_safe=False,
    keywords="apispec swagger openapi specification oas documentation spec rest api",
    python_requires=">=3.6",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3 :: Only",
    ],
    test_suite="tests",
    project_urls={
        "Funding": "https://opencollective.com/marshmallow",
        "Issues": "https://github.com/marshmallow-code/apispec/issues",
        "Tidelift": "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi",  # noqa: B950,E501
    },
)
<commit_msg>Bump flake8-bugbear from 21.4.3 to 21.9.1<commit_after>import re
from setuptools import setup, find_packages

EXTRAS_REQUIRE = {
    "marshmallow": ["marshmallow>=3.13.0"],
    "yaml": ["PyYAML>=3.10"],
    "validation": ["prance[osv]>=0.11"],
    "lint": ["flake8==3.9.2", "flake8-bugbear==21.9.1", "pre-commit~=2.4"],
    "docs": [
        "marshmallow>=3.13.0",
        "pyyaml==5.4.1",
        "sphinx==4.2.0",
        "sphinx-issues==1.2.0",
        "sphinx-rtd-theme==0.5.2",
    ],
}
EXTRAS_REQUIRE["tests"] = (
    EXTRAS_REQUIRE["yaml"]
    + EXTRAS_REQUIRE["validation"]
    + ["marshmallow>=3.13.0", "pytest", "mock"]
)
EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"]

def find_version(fname):
    """Attempts to find the version number in the file names fname.
    Raises RuntimeError if not found.
    """
    version = ""
    with open(fname) as fp:
        reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
        for line in fp:
            m = reg.match(line)
            if m:
                version = m.group(1)
                break
    if not version:
        raise RuntimeError("Cannot find version information.")
    return version

def read(fname):
    with open(fname) as fp:
        content = fp.read()
    return content

setup(
    name="apispec",
    version=find_version("src/apispec/__init__.py"),
    description="A pluggable API specification generator. Currently supports the "
    "OpenAPI Specification (f.k.a. the Swagger specification).",
    long_description=read("README.rst"),
    author="Steven Loria",
    author_email="sloria1@gmail.com",
    url="https://github.com/marshmallow-code/apispec",
    packages=find_packages("src"),
    package_dir={"": "src"},
    include_package_data=True,
    extras_require=EXTRAS_REQUIRE,
    license="MIT",
    zip_safe=False,
    keywords="apispec swagger openapi specification oas documentation spec rest api",
    python_requires=">=3.6",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3 :: Only",
    ],
    test_suite="tests",
    project_urls={
        "Funding": "https://opencollective.com/marshmallow",
        "Issues": "https://github.com/marshmallow-code/apispec/issues",
        "Tidelift": "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi",  # noqa: B950,E501
    },
)
<|endoftext|>


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

###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#   * Redistributions of source code must retain the above copyright notice,
#     this list of conditions, and the following disclaimer.
#   * Redistributions in binary form must reproduce the above copyright notice,
#     this list of conditions, and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#   * Neither the name of the author of this software nor the name of
#     contributors to this software may be used to endorse or promote products
#     derived from this software without specific prior written consent.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
###

import os
import sys

if sys.version_info < (2, 6, 0):
    sys.stderr.write("Supybot requires Python 2.6 or newer.")
    sys.stderr.write(os.linesep)
    sys.exit(-1)

import textwrap

clean = False
while '--clean' in sys.argv:
    clean = True
    sys.argv.remove('--clean')

import glob
import shutil
import os.path

from src.version import version

plugins = [s for s in os.listdir('plugins') if
           os.path.exists(os.path.join('plugins', s, 'plugin.py'))]

def normalizeWhitespace(s):
    return ' '.join(s.split())

try:
    from distutils.core import setup
    from distutils.sysconfig import get_python_lib
except ImportError, e:
    s = normalizeWhitespace("""Supybot requires the distutils package to
    install. This package is normally included with Python, but for some
    unfathomable reason, many distributions to take it out of standard Python
    and put it in another package, usually caled 'python-dev' or python-devel'
    or something similar. This is one of the dumbest things a distribution can
    do, because it means that developers cannot rely on *STANDARD* Python
    modules to be present on systems of that distribution. Complain to your
    distribution, and loudly. If you how much of our time we've wasted telling
    people to install what should be included by default with Python you'd
    understand why we're unhappy about this.  Anyway, to reiterate, install the
    development package for Python that your distribution supplies.""")
    sys.stderr.write(os.linesep*2)
    sys.stderr.write(textwrap.fill(s))
    sys.stderr.write(os.linesep*2)
    sys.exit(-1)

if clean:
    previousInstall = os.path.join(get_python_lib(), 'supybot')
    if os.path.exists(previousInstall):
        try:
            print 'Removing current installation.'
            shutil.rmtree(previousInstall)
        except Exception, e:
            print 'Couldn\'t remove former installation: %s' % e
            sys.exit(-1)

packages = ['supybot',
            'supybot.utils',
            'supybot.drivers',
            'supybot.plugins',] + \
            ['supybot.plugins.'+s for s in plugins] + \
            [
             'supybot.plugins.Dict.local',
             'supybot.plugins.Math.local',
             'supybot.plugins.RSS.local',
             'supybot.plugins.Time.local',
             'supybot.plugins.Time.local.dateutil',
            ]

package_dir = {'supybot': 'src',
               'supybot.utils': 'src/utils',
               'supybot.plugins': 'plugins',
               'supybot.drivers': 'src/drivers',
               'supybot.plugins.Google.local': 'plugins/Google/local',
               'supybot.plugins.Google.local.simplejson':
               'plugins/Google/local/simplejson',
               'supybot.plugins.Dict.local': 'plugins/Dict/local',
               'supybot.plugins.Math.local': 'plugins/Math/local',
               'supybot.plugins.RSS.local': 'plugins/RSS/local',
               'supybot.plugins.Time.local': 'plugins/Time/local',
               'supybot.plugins.Time.local.dateutil':
               'plugins/Time/local/dateutil',
              }

for plugin in plugins:
    package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin

setup(
    # Metadata
    name='supybot',
    version=version,
    author='Jeremy Fincher',
    url='http://sourceforge.net/projects/supybot/',
    author_email='jemfinch@supybot.com',
    download_url='http://www.sf.net/project/showfiles.php?group_id=58965',
    description='A flexible and extensible Python IRC bot and framework.',
    long_description=normalizeWhitespace("""A robust, full-featured Python IRC
    bot with a clean and flexible plugin API.  Equipped with a complete ACL
    system for specifying user permissions with as much as per-command
    granularity.  Batteries are included in the form of numerous plugins
    already written."""),
    classifiers = [
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Environment :: No Input/Output (Daemon)',
        'Intended Audience :: End Users/Desktop',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Topic :: Communications :: Chat :: Internet Relay Chat',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Operating System :: POSIX',
        'Operating System :: Microsoft :: Windows',
        'Programming Language :: Python',
        ],

    # Installation data
    packages=packages,

    package_dir=package_dir,

    scripts=['scripts/supybot',
             'scripts/supybot-test',
             'scripts/supybot-botchk',
             'scripts/supybot-wizard',
             'scripts/supybot-adduser',
             'scripts/supybot-plugin-doc',
             'scripts/supybot-plugin-create',
             ]
    )

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
<commit_msg>Remove a few more references to local.simplejson<commit_after>#!/usr/bin/env python

###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#   * Redistributions of source code must retain the above copyright notice,
#     this list of conditions, and the following disclaimer.
#   * Redistributions in binary form must reproduce the above copyright notice,
#     this list of conditions, and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#   * Neither the name of the author of this software nor the name of
#     contributors to this software may be used to endorse or promote products
#     derived from this software without specific prior written consent.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
###

import os
import sys

if sys.version_info < (2, 6, 0):
    sys.stderr.write("Supybot requires Python 2.6 or newer.")
    sys.stderr.write(os.linesep)
    sys.exit(-1)

import textwrap

clean = False
while '--clean' in sys.argv:
    clean = True
    sys.argv.remove('--clean')

import glob
import shutil
import os.path

from src.version import version

plugins = [s for s in os.listdir('plugins') if
           os.path.exists(os.path.join('plugins', s, 'plugin.py'))]

def normalizeWhitespace(s):
    return ' '.join(s.split())

try:
    from distutils.core import setup
    from distutils.sysconfig import get_python_lib
except ImportError, e:
    s = normalizeWhitespace("""Supybot requires the distutils package to
    install. This package is normally included with Python, but for some
    unfathomable reason, many distributions to take it out of standard Python
    and put it in another package, usually caled 'python-dev' or python-devel'
    or something similar. This is one of the dumbest things a distribution can
    do, because it means that developers cannot rely on *STANDARD* Python
    modules to be present on systems of that distribution. Complain to your
    distribution, and loudly. If you how much of our time we've wasted telling
    people to install what should be included by default with Python you'd
    understand why we're unhappy about this.  Anyway, to reiterate, install the
    development package for Python that your distribution supplies.""")
    sys.stderr.write(os.linesep*2)
    sys.stderr.write(textwrap.fill(s))
    sys.stderr.write(os.linesep*2)
    sys.exit(-1)

if clean:
    previousInstall = os.path.join(get_python_lib(), 'supybot')
    if os.path.exists(previousInstall):
        try:
            print 'Removing current installation.'
            shutil.rmtree(previousInstall)
        except Exception, e:
            print 'Couldn\'t remove former installation: %s' % e
            sys.exit(-1)

packages = ['supybot',
            'supybot.utils',
            'supybot.drivers',
            'supybot.plugins',] + \
            ['supybot.plugins.'+s for s in plugins] + \
            [
             'supybot.plugins.Dict.local',
             'supybot.plugins.Math.local',
             'supybot.plugins.RSS.local',
             'supybot.plugins.Time.local',
             'supybot.plugins.Time.local.dateutil',
            ]

package_dir = {'supybot': 'src',
               'supybot.utils': 'src/utils',
               'supybot.plugins': 'plugins',
               'supybot.drivers': 'src/drivers',
               'supybot.plugins.Dict.local': 'plugins/Dict/local',
               'supybot.plugins.Math.local': 'plugins/Math/local',
               'supybot.plugins.RSS.local': 'plugins/RSS/local',
               'supybot.plugins.Time.local': 'plugins/Time/local',
               'supybot.plugins.Time.local.dateutil':
               'plugins/Time/local/dateutil',
              }

for plugin in plugins:
    package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin

setup(
    # Metadata
    name='supybot',
    version=version,
    author='Jeremy Fincher',
    url='http://sourceforge.net/projects/supybot/',
    author_email='jemfinch@supybot.com',
    download_url='http://www.sf.net/project/showfiles.php?group_id=58965',
    description='A flexible and extensible Python IRC bot and framework.',
    long_description=normalizeWhitespace("""A robust, full-featured Python IRC
    bot with a clean and flexible plugin API.  Equipped with a complete ACL
    system for specifying user permissions with as much as per-command
    granularity.  Batteries are included in the form of numerous plugins
    already written."""),
    classifiers = [
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Environment :: No Input/Output (Daemon)',
        'Intended Audience :: End Users/Desktop',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Topic :: Communications :: Chat :: Internet Relay Chat',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Operating System :: POSIX',
        'Operating System :: Microsoft :: Windows',
        'Programming Language :: Python',
        ],

    # Installation data
    packages=packages,

    package_dir=package_dir,

    scripts=['scripts/supybot',
             'scripts/supybot-test',
             'scripts/supybot-botchk',
             'scripts/supybot-wizard',
             'scripts/supybot-adduser',
             'scripts/supybot-plugin-doc',
             'scripts/supybot-plugin-create',
             ]
    )

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
<|endoftext|>


<commit_before>import sys
from setuptools import setup

setup(name='smappdragon',
	packages=['smappdragon', 'smappdragon.collection', 'smappdragon.tools'],
	version='0.0.41',
	description='smappdragon is a set of tools for working with twitter data',
	author='yvan',
	author_email='yns207@nyu.edu',
	url='https://github.com/SMAPPNYU/smappdragon',
	keywords='twitter parse smappdragon',
	license='MIT',
	install_requires=[
	  'pymongo>=3.2.1'
	]
)<commit_msg>vbump<commit_after>import sys
from setuptools import setup

setup(name='smappdragon',
	packages=['smappdragon', 'smappdragon.collection', 'smappdragon.tools'],
	version='0.0.42',
	description='smappdragon is a set of tools for working with twitter data',
	author='yvan',
	author_email='yns207@nyu.edu',
	url='https://github.com/SMAPPNYU/smappdragon',
	keywords='twitter parse smappdragon',
	license='MIT',
	install_requires=[
	  'pymongo>=3.2.1'
	]
)<|endoftext|>


<commit_before>#!/usr/bin/env python
# coding: utf-8
from distutils.core import setup

from setuptools import find_packages

setup(
    name='django-approval',
    version='0.9.20160611',
    packages=find_packages('.'),
    include_package_data=True,
    url='',
    author='S Kossouho',
    author_email='artscoop93@gmail.com',
    description='Approval mechanisms for model instances in Django 1.8+',
    requires=['django', 'django_picklefield', 'unidecode', 'django_annoying'],
    classifiers=["License :: OSI Approved :: BSD License",
                 "Framework :: Django",
                 "Development Status :: 4 - Beta",
                 "Programming Language :: Python :: 3"
                 ]

)
<commit_msg>[f] Set setup.py metadata to show MIT License instead of BSD<commit_after>#!/usr/bin/env python
# coding: utf-8
from distutils.core import setup

from setuptools import find_packages

setup(
    name='django-approval',
    version='0.9.20160611',
    packages=find_packages('.'),
    include_package_data=True,
    url='',
    author='S Kossouho',
    author_email='artscoop93@gmail.com',
    description='Approval mechanisms for model instances in Django 1.8+',
    requires=['django', 'django_picklefield', 'unidecode', 'django_annoying'],
    classifiers=["License :: OSI Approved :: MIT License",
                 "Framework :: Django",
                 "Development Status :: 4 - Beta",
                 "Programming Language :: Python :: 3"
                 ]

)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='ak-vendor',
    version='0.9.28',
    description="Some vendor scripts that we use here at Appknox",
    long_description="All the Vendor/helper files the Appknox relies on",
    url='https://github.com/appknox/vendor',
    author='dhilipsiva',
    author_email='dhilipsiva@gmail.com',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
    ],

    keywords='appknox vendor',
    packages=find_packages(),
    data_files=[
        ('excel', ['ak_vendor/translations/ja/subheading.xlsx',
                   'ak_vendor/translations/ja/vulnerability.xlsx']),
        ('report', ['ak_vendor/report.html']),
        ('translations', ['ak_vendor/locale/ja/LC_MESSAGES/django.po']),
    ],
    include_package_data=True,
    entry_points='',
    install_requires=[
        "python3-protobuf==2.5.0",
    ],
    zip_safe=False,
    extras_require={
        'dev': [''],
        'test': [''],
    },
)
<commit_msg>Update Version<commit_after>from setuptools import setup, find_packages

setup(
    name='ak-vendor',
    version='0.9.29',
    description="Some vendor scripts that we use here at Appknox",
    long_description="All the Vendor/helper files the Appknox relies on",
    url='https://github.com/appknox/vendor',
    author='dhilipsiva',
    author_email='dhilipsiva@gmail.com',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
    ],

    keywords='appknox vendor',
    packages=find_packages(),
    data_files=[
        ('excel', ['ak_vendor/translations/ja/subheading.xlsx',
                   'ak_vendor/translations/ja/vulnerability.xlsx']),
        ('report', ['ak_vendor/report.html']),
        ('translations', ['ak_vendor/locale/ja/LC_MESSAGES/django.po']),
    ],
    include_package_data=True,
    entry_points='',
    install_requires=[
        "python3-protobuf==2.5.0",
    ],
    zip_safe=False,
    extras_require={
        'dev': [''],
        'test': [''],
    },
)
<|endoftext|>


<commit_before>from setuptools import setup

def readme():
    with open('README.md') as f:
        return f.read()

setup(name='riboutils',
        version='0.1',
        description="This package contains utilities for other ribosome profiling projects.",
        long_description=readme(),
        keywords="ribosome profiling utilities translation",
        url="",
        author="Brandon Malone",
        author_email="bmmalone@gmail.com",
        license='MIT',
        packages=['riboutils'],
        install_requires = [
            'numpy',
            'pandas',
            'scipy',
            'tqdm',
            'appdirs',
            'statsmodels',
            'misc[bio]'
        ],
        extras_require = {
        },
        include_package_data=True,
        test_suite='nose.collector',
        tests_require=['nose'],
        entry_points = {
            'console_scripts': [
                'extract-metagene-profiles=riboutils.extract_metagene_profiles:main',
                'estimate-metagene-profile-bayes-factors=riboutils.estimate_metagene_profile_bayes_factors:main',
                'select-periodic-offsets=riboutils.select_periodic_offsets:main'
                               ]
        },
        zip_safe=False
        )
<commit_msg>FIX moved bio script to misc.bio_utils<commit_after>from setuptools import setup

console_scripts = [
    'extract-metagene-profiles=riboutils.extract_metagene_profiles:main',
    'estimate-metagene-profile-bayes-factors=riboutils.estimate_metagene_profile_bayes_factors:main',
    'select-periodic-offsets=riboutils.select_periodic_offsets:main'
]

def readme():
    with open('README.md') as f:
        return f.read()

setup(name='riboutils',
        version='0.1',
        description="This package contains utilities for other ribosome profiling projects.",
        long_description=readme(),
        keywords="ribosome profiling utilities translation",
        url="",
        author="Brandon Malone",
        author_email="bmmalone@gmail.com",
        license='MIT',
        packages=['riboutils'],
        install_requires = [
            'numpy',
            'pandas',
            'scipy',
            'tqdm',
            'appdirs',
            'statsmodels',
            'misc[bio]'
        ],
        extras_require = {
        },
        include_package_data=True,
        test_suite='nose.collector',
        tests_require=['nose'],
        entry_points = {
            'console_scripts': console_scripts
        },
        zip_safe=False
)
<|endoftext|>


<commit_before># coding=utf-8
# :bc: Not importing unicode_literals because in Python 2 distutils,
# some values are expected to be byte strings.
from __future__ import absolute_import, division, print_function

from codecs import StreamReader, open
from os.path import dirname, join, realpath

from setuptools import setup

cwd = dirname(realpath(__file__))

##
# Load long description for PyPi.
with open(join(cwd, 'README.rst'), 'r', 'utf-8') as f: # type: StreamReader
    long_description = f.read()

##
# Off we go!
# noinspection SpellCheckingInspection
setup(
    name        = 'filters',
    description = 'Validation and data pipelines made easy!',
    url         = 'https://filters.readthedocs.io/',

    version = '1.3.1',

    packages = ['filters'],

    long_description = long_description,

    install_requires = [
        'class-registry',
        'python-dateutil',
        'pytz',
        'py2casefold; python_version < "3.0"',
        'regex',
        'six',
        'typing; python_version < "3.0"',
    ],

    extras_require = {
        'django':['filters-django'],
        'iso': ['filters-iso'],
    },

    test_suite    = 'test',
    test_loader   = 'nose.loader:TestLoader',
    tests_require = [
        'nose',
    ],

    license = 'MIT',

    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Text Processing :: Filters',
    ],

    keywords = 'data validation',

    author          = 'Phoenix Zerin',
    author_email    = 'phoenix.zerin@eflglobal.com',
)
<commit_msg>Bumping version number.<commit_after># coding=utf-8
# :bc: Not importing unicode_literals because in Python 2 distutils,
# some values are expected to be byte strings.
from __future__ import absolute_import, division, print_function

from codecs import StreamReader, open
from os.path import dirname, join, realpath

from setuptools import setup

cwd = dirname(realpath(__file__))

##
# Load long description for PyPi.
with open(join(cwd, 'README.rst'), 'r', 'utf-8') as f: # type: StreamReader
    long_description = f.read()

##
# Off we go!
# noinspection SpellCheckingInspection
setup(
    name        = 'filters',
    description = 'Validation and data pipelines made easy!',
    url         = 'https://filters.readthedocs.io/',

    version = '1.3.2',

    packages = ['filters'],

    long_description = long_description,

    install_requires = [
        'class-registry',
        'python-dateutil',
        'pytz',
        'py2casefold; python_version < "3.0"',
        'regex',
        'six',
        'typing; python_version < "3.0"',
    ],

    extras_require = {
        'django':['filters-django'],
        'iso': ['filters-iso'],
    },

    test_suite    = 'test',
    test_loader   = 'nose.loader:TestLoader',
    tests_require = [
        'nose',
    ],

    license = 'MIT',

    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Text Processing :: Filters',
    ],

    keywords = 'data validation',

    author          = 'Phoenix Zerin',
    author_email    = 'phoenix.zerin@eflglobal.com',
)
<|endoftext|>


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

from setuptools import setup, find_packages

try:
    long_description = open('README.md').read()
except:
    long_description = ''

setup(
    name='django-render-url',
    version='0.9.9.1',
    packages=find_packages(),
    author='WANG Tai',
    author_email='i@wangtai.me',
    url='https://github.com/wangtai/django_render',
    description='a very light django plugin',
    long_description=long_description,
    license='Apache2',
    requires=[
        'Django',
        'enum34'
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Topic :: System :: Installation/Setup'
    ],
    include_package_data=True,
    zip_safe=False
)
<commit_msg>Update version to 0992<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: xiLin.ding

from setuptools import setup, find_packages

try:
    long_description = open('README.md').read()
except:
    long_description = ''

setup(
    name='django-render-url',
    version='0.9.9.2',
    packages=find_packages(),
    author='WANG Tai',
    author_email='i@wangtai.me',
    url='https://github.com/wangtai/django_render',
    description='a very light django plugin',
    long_description=long_description,
    license='Apache2',
    requires=[
        'Django',
        'enum34'
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Topic :: System :: Installation/Setup'
    ],
    include_package_data=True,
    zip_safe=False
)
<|endoftext|>


<commit_before># Command to build:
from distutils.core import setup
import glob

package_prefix = "Lib/site-packages/aiml"

setup(name="PyAIML",
    version="0.5",
    author="Cort Stratton",
    author_email="cort@users.sourceforge.net",
    description="Python AIML Interpreter",
    url="http://pyaiml.sourceforge.net/",
    packages=["aiml"],
    data_files=[
        (package_prefix, glob.glob("aiml/self-test.aiml")),
        (package_prefix, glob.glob("*.txt")),
    ],
)
<commit_msg>Added more metadata to facilitate registering with the Python Package Index.<commit_after># Command to build:
from distutils.core import setup
import glob

package_prefix = "Lib/site-packages/aiml"

setup(name="PyAIML",
    version="0.5",
    author="Cort Stratton",
    author_email="cort@users.sourceforge.net",
    maintainer="Cort Stratton",
    maintainer_email="cort@users.sourceforge.net",

    description="An interpreter package for AIML, the Artificial Intelligence Markup Language",
    long_description="""PyAIML implements an interpreter for AIML, the Artificial Intelligence
Markup Language developed by Dr. Richard Wallace of the A.L.I.C.E. Foundation.
It can be used to implement a conversational AI program.""",
    url="http://pyaiml.sourceforge.net/",
    platforms=["any"],
    classifiers=["Development Status :: 3 - Alpha",
                 "Environment :: Console",
                 "Intended Audience :: Developers",
                 "Programming Language :: Python",
                 "Operating System :: OS Independent",
                 "Topic :: Communications :: Chat",
                 "Topic :: Scientific/Engineering :: Artificial Intelligence"
                 ],

    packages=["aiml"],
    data_files=[
        (package_prefix, glob.glob("aiml/self-test.aiml")),
        (package_prefix, glob.glob("*.txt")),
    ],
)
<|endoftext|>


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

here = path.abspath(path.dirname(__file__))
exec(open('nanoplot/version.py').read())

setup(
    name='NanoPlot',
    version=__version__,
    description='Plotting suite for Oxford Nanopore sequencing data and alignments',
    long_description=open(path.join(here, "README.md")).read(),
    long_description_content_type="text/markdown",
    url='https://github.com/wdecoster/NanoPlot',
    author='Wouter De Coster',
    author_email='decosterwouter@gmail.com',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
    keywords='nanopore sequencing plotting quality control',
    packages=find_packages() + ['extra', 'scripts'],
    python_requires='>=3',
    install_requires=['biopython',
                      'pysam>0.10.0.0',
                      'pandas>=0.22.0',
                      'numpy',
                      'scipy',
                      'python-dateutil',
                      'seaborn',
                      'nanoplotter>=0.36.0',
                      'nanoget>=1.5.2',
                      'nanomath>=0.21.0'
                      ],
    package_data={'NanoPlot': []},
    package_dir={'nanoplot': 'nanoplot'},
    include_package_data=True,
    entry_points={
        'console_scripts': [
            'NanoPlot=nanoplot.NanoPlot:main',
        ],
    },
)
<commit_msg>make dependent on latest nanoplotter<commit_after># Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))
exec(open('nanoplot/version.py').read())

setup(
    name='NanoPlot',
    version=__version__,
    description='Plotting suite for Oxford Nanopore sequencing data and alignments',
    long_description=open(path.join(here, "README.md")).read(),
    long_description_content_type="text/markdown",
    url='https://github.com/wdecoster/NanoPlot',
    author='Wouter De Coster',
    author_email='decosterwouter@gmail.com',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
    keywords='nanopore sequencing plotting quality control',
    packages=find_packages() + ['extra', 'scripts'],
    python_requires='>=3',
    install_requires=['biopython',
                      'pysam>0.10.0.0',
                      'pandas>=0.22.0',
                      'numpy',
                      'scipy',
                      'python-dateutil',
                      'seaborn',
                      'nanoplotter>=0.39.3',
                      'nanoget>=1.5.2',
                      'nanomath>=0.21.0'
                      ],
    package_data={'NanoPlot': []},
    package_dir={'nanoplot': 'nanoplot'},
    include_package_data=True,
    entry_points={
        'console_scripts': [
            'NanoPlot=nanoplot.NanoPlot:main',
        ],
    },
)
<|endoftext|>


<commit_before>#!/usr/bin/python
# coding=utf-8
"""
Setuptools setup file, used to install or test 'cmd2'
"""
from setuptools import setup

DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications.  It
provides a simple API which is an extension of Python's built-in cmd module.  cmd2 provides a wealth of features on top
of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary when using cmd.

The latest documentation for cmd2 can be read online here:
https://cmd2.readthedocs.io/

Main features:

    - Searchable command history (`history` command and `<Ctrl>+r`) - optionally persistent
    - Text file scripting of your application with `load` (`@`) and `_relative_load` (`@@`)
    - Python scripting of your application with ``pyscript``
    - Run shell commands with ``!``
    - Pipe command output to shell commands with `|`
    - Redirect command output to file with `>`, `>>`
    - Bare `>`, `>>` with no filename send output to paste buffer (clipboard)
    - `py` enters interactive Python console (opt-in `ipy` for IPython console)
    - Option to display long output using a pager with ``cmd2.Cmd.ppaged()``
    - Multi-line commands
    - Special-character command shortcuts (beyond cmd's `?` and `!`)
    - Command aliasing similar to bash `alias` command
    - Macros, which are similar to aliases, but they can contain argument placeholders
    - Ability to load commands at startup from an initialization script
    - Settable environment parameters
    - Parsing commands with arguments using `argparse`, including support for sub-commands
    - Unicode character support
    - Good tab-completion of commands, sub-commands, file system paths, and shell commands
    - Automatic tab-completion of `argparse` flags when using one of the `cmd2` `argparse` decorators
    - Support for Python 3.4+ on Windows, macOS, and Linux
    - Trivial to provide built-in help for all commands
    - Built-in regression testing framework for your applications (transcript-based testing)
    - Transcripts for use with built-in regression can be automatically generated from `history -t`
    - Alerts that seamlessly print while user enters text at prompt

Usable without modification anywhere cmd is used; simply import cmd2.Cmd in place of cmd.Cmd.

Version 0.9.0+ of cmd2 supports Python 3.4+ only. If you wish to use cmd2 with Python 2.7, then
please install version 0.8.x.
"""

CLASSIFIERS = list(filter(None, map(str.strip,
"""
Development Status :: 5 - Production/Stable
Environment :: Console
Operating System :: OS Independent
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines())))  # noqa: E128

SETUP_REQUIRES = ['setuptools_scm']

INSTALL_REQUIRES = ['pyperclip >= 1.5.27', 'colorama', 'attrs >= 16.3.0', 'wcwidth >= 0.1.7']

EXTRAS_REQUIRE = {
    # Windows also requires pyreadline to ensure tab completion works
    ":sys_platform=='win32'": ['pyreadline'],
    # Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
    ":python_version<'3.5'": ['contextlib2', 'typing'],
    # Extra dependencies for running unit tests
    'test': ["argcomplete ; sys_platform!='win32'",  # include argcomplete tests where available
             "gnureadline; sys_platform=='darwin'",  # include gnureadline on macOS to ensure it is available in tox env
             "mock ; python_version<'3.6'",  # for python 3.5 and earlier we need the third party mock module
             'codecov', 'pytest', 'pytest-cov', 'pytest-mock'],
    # development only dependencies:  install with 'pip install -e .[dev]'
    'dev': ["mock ; python_version<'3.6'",  # for python 3.5 and earlier we need the third party mock module
            'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'pylint',
            'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', 'invoke', 'twine>=1.11',
            ]
}

setup(
    name="cmd2",
    use_scm_version=True,
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    classifiers=CLASSIFIERS,
    author='Catherine Devlin',
    author_email='catherine.devlin@gmail.com',
    url='https://github.com/python-cmd2/cmd2',
    license='MIT',
    platforms=['any'],
    packages=['cmd2'],
    keywords='command prompt console cmd',
    python_requires='>=3.4',
    setup_requires=SETUP_REQUIRES,
    install_requires=INSTALL_REQUIRES,
    extras_require=EXTRAS_REQUIRE,
)
<commit_msg>Remove test dependency on argcomplete<commit_after>#!/usr/bin/python
# coding=utf-8
"""
Setuptools setup file, used to install or test 'cmd2'
"""
from setuptools import setup

DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications.  It
provides a simple API which is an extension of Python's built-in cmd module.  cmd2 provides a wealth of features on top
of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary when using cmd.

The latest documentation for cmd2 can be read online here:
https://cmd2.readthedocs.io/

Main features:

    - Searchable command history (`history` command and `<Ctrl>+r`) - optionally persistent
    - Text file scripting of your application with `load` (`@`) and `_relative_load` (`@@`)
    - Python scripting of your application with ``pyscript``
    - Run shell commands with ``!``
    - Pipe command output to shell commands with `|`
    - Redirect command output to file with `>`, `>>`
    - Bare `>`, `>>` with no filename send output to paste buffer (clipboard)
    - `py` enters interactive Python console (opt-in `ipy` for IPython console)
    - Option to display long output using a pager with ``cmd2.Cmd.ppaged()``
    - Multi-line commands
    - Special-character command shortcuts (beyond cmd's `?` and `!`)
    - Command aliasing similar to bash `alias` command
    - Macros, which are similar to aliases, but they can contain argument placeholders
    - Ability to load commands at startup from an initialization script
    - Settable environment parameters
    - Parsing commands with arguments using `argparse`, including support for sub-commands
    - Unicode character support
    - Good tab-completion of commands, sub-commands, file system paths, and shell commands
    - Automatic tab-completion of `argparse` flags when using one of the `cmd2` `argparse` decorators
    - Support for Python 3.4+ on Windows, macOS, and Linux
    - Trivial to provide built-in help for all commands
    - Built-in regression testing framework for your applications (transcript-based testing)
    - Transcripts for use with built-in regression can be automatically generated from `history -t`
    - Alerts that seamlessly print while user enters text at prompt

Usable without modification anywhere cmd is used; simply import cmd2.Cmd in place of cmd.Cmd.

Version 0.9.0+ of cmd2 supports Python 3.4+ only. If you wish to use cmd2 with Python 2.7, then
please install version 0.8.x.
"""

CLASSIFIERS = list(filter(None, map(str.strip,
"""
Development Status :: 5 - Production/Stable
Environment :: Console
Operating System :: OS Independent
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines())))  # noqa: E128

SETUP_REQUIRES = ['setuptools_scm']

INSTALL_REQUIRES = ['pyperclip >= 1.5.27', 'colorama', 'attrs >= 16.3.0', 'wcwidth >= 0.1.7']

EXTRAS_REQUIRE = {
    # Windows also requires pyreadline to ensure tab completion works
    ":sys_platform=='win32'": ['pyreadline'],
    # Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
    ":python_version<'3.5'": ['contextlib2', 'typing'],
    # Extra dependencies for running unit tests
    'test': ["gnureadline; sys_platform=='darwin'",  # include gnureadline on macOS to ensure it is available in tox env
             "mock ; python_version<'3.6'",  # for python 3.5 and earlier we need the third party mock module
             'codecov', 'pytest', 'pytest-cov', 'pytest-mock'],
    # development only dependencies:  install with 'pip install -e .[dev]'
    'dev': ["mock ; python_version<'3.6'",  # for python 3.5 and earlier we need the third party mock module
            'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'pylint',
            'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', 'invoke', 'twine>=1.11',
            ]
}

setup(
    name="cmd2",
    use_scm_version=True,
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    classifiers=CLASSIFIERS,
    author='Catherine Devlin',
    author_email='catherine.devlin@gmail.com',
    url='https://github.com/python-cmd2/cmd2',
    license='MIT',
    platforms=['any'],
    packages=['cmd2'],
    keywords='command prompt console cmd',
    python_requires='>=3.4',
    setup_requires=SETUP_REQUIRES,
    install_requires=INSTALL_REQUIRES,
    extras_require=EXTRAS_REQUIRE,
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
"""Installer script for Pywikibot framework.

To create a new distribution:
-----------------------------

- replace the developmental version string in ``pywikibot.__metadata.py``
  by the corresponing final release
- create the package with::

    python setup.py sdist

- push the change to gerrit and merge it to the repository
- upload the package to pypy by::

    twine upload dist/*

- create a new tag with the version number of the final release
- move the existing 'stable' tag to that new tag
- delete 'stable' tag in gerrit to be overridden later
- synchronize the local tags with the remote repositoy
- prepare the next release by increasing the version number in
  ``pywikibot.__metadata.py`` and adding developmental identifier
- upload this patchset to gerrit and merge it.
"""
#
# (C) Pywikibot team, 2009-2021
#
# Distributed under the terms of the MIT license.
#
# ## KEEP PYTHON 2 SUPPORT FOR THIS SCRIPT ## #
import os
import sys

from pkg_resources import parse_version, safe_version
from setuptools import setup

PYTHON_VERSION = sys.version_info[:3]

VERSIONS_REQUIRED_MESSAGE = """
Pywikibot is not available on:
{version}

This version of Pywikibot only supports Python 3.5+.
"""

def python_is_supported():
    """Check that Python is supported."""
    return PYTHON_VERSION >= (3, 5, 0)

if not python_is_supported():  # pragma: no cover
    # pwb.py checks this exception
    raise RuntimeError(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))

# ------- setup extra_requires ------- #
extra_deps = {
    # Core library dependencies
    'eventstreams': ['sseclient!=0.0.23,!=0.0.24,>=0.0.18'],
    'isbn': ['python-stdnum>=1.15'],
    'Graphviz': ['pydot>=1.2'],
    'Google': ['google>=1.7'],
    'mwparserfromhell': ['mwparserfromhell>=0.3.3'],
    'Tkinter': [  # vulnerability found in Pillow<6.2.2
        'Pillow>=6.2.2,<8.0.0;python_version<"3.6"',
        'Pillow>=6.2.2;python_version>="3.6" and python_version<"3.9"',
        'Pillow>=8.0.0;python_version>="3.9"',
    ],
    'mwoauth': ['mwoauth!=0.3.1,>=0.2.4'],
    'html': ['BeautifulSoup4'],
    'http': ['fake_useragent'],
    'flake8': [  # Due to incompatibilities between packages the order matters.
        'flake8>=3.7.5',
        'pydocstyle>=4.0.0',
        'hacking',
        'flake8-coding',
        'flake8-colors>=0.1.9',
        'flake8-comprehensions>=3.1.4;python_version>="3.8"',
        'flake8-comprehensions>=2.2.0',
        'flake8-docstrings>=1.3.1',
        'flake8-future-import',
        'flake8-mock>=0.3',
        'flake8-print>=2.0.1',
        'flake8-quotes>=2.0.1',
        'flake8-string-format',
        'flake8-tuple>=0.2.8',
        'flake8-no-u-prefixed-strings>=0.2',
        'pep8-naming>=0.7',
        'pyflakes>=2.1.0',
    ],
}

# ------- setup extra_requires for scripts ------- #
script_deps = {
    'flickrripper.py': [
        'flickrapi>=2.2',
    ] + extra_deps['Tkinter'],
    'imageharvest.py': extra_deps['html'],
    'isbn.py': extra_deps['isbn'],
    'match_images.py': extra_deps['Tkinter'],
    'patrol.py': extra_deps['mwparserfromhell'],
    'states_redirect.py': ['pycountry'],
    'weblinkchecker.py': ['memento_client!=0.6.0,>=0.5.1'],
}

extra_deps.update(script_deps)
extra_deps.update({'scripts': [i for k, v in script_deps.items() for i in v]})

# ------- setup install_requires ------- #
# packages which are mandatory
dependencies = [
    'requests>=2.20.1,<2.26.0;python_version<"3.6"',
    'requests>=2.20.1;python_version>="3.6"',
    # PEP 440
    'setuptools>=20.2, !=50.0.0, <50.2.0 ; python_version < "3.6"',
    'setuptools>=20.2 ; python_version >= "3.6"',
]

try:
    import bz2
except ImportError:  # pragma: no cover
    # Use bz2file if the python is not compiled with bz2 support.
    dependencies.append('bz2file')
else:
    assert bz2

# ------- setup tests_require ------- #
test_deps = ['bz2file', 'mock']
# Some of the ui_tests depend on accessing the console window's menu
# to set the console font and copy and paste, achieved using pywinauto
# which depends on pywin32.
# These tests may be disabled because pywin32 depends on VC++, is time
# consuming to build, and the console window can't be accessed during appveyor
# builds.
if os.name == 'nt' and os.environ.get('PYSETUP_TEST_NO_UI', '0') != '1':
    test_deps += [
        'pywinauto>0.6.4',
        'pywin32>=225',
    ]

# Add all dependencies as test dependencies,
# so all scripts can be compiled for script_tests, etc.
if 'PYSETUP_TEST_EXTRAS' in os.environ:  # pragma: no cover
    test_deps += [i for k, v in extra_deps.items() if k != 'flake8' for i in v]

# These extra dependencies are needed other unittest fails to load tests.
test_deps += extra_deps['eventstreams']

class _DottedDict(dict):
    __getattr__ = dict.__getitem__

# import metadata
metadata = _DottedDict()
name = 'pywikibot'
path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(path, name, '__metadata__.py')) as f:
    exec(f.read(), metadata)
assert metadata.__name__ == name

def get_validated_version():  # pragma: no cover
    """Get a validated pywikibot module version string.

    The version number from pywikibot.__metadata__.__version__ is used.
    setup.py with 'sdist' option is used to create a new source distribution.
    In that case the version number is validated: Read tags from git.
    Verify that the new release is higher than the last repository tag
    and is not a developmental release.

    @return: pywikibot module version string
    @rtype: str
    """
    version = metadata.__version__
    if 'sdist' not in sys.argv:
        return version

    # validate version for sdist
    from contextlib import suppress
    from subprocess import run, PIPE
    try:
        tags = run(['git', 'tag'], check=True, stdout=PIPE,
                   universal_newlines=True).stdout.splitlines()
    except Exception as e:
        print(e)
        sys.exit('Creating source distribution canceled.')

    for tag in ('stable', 'python2'):
        with suppress(ValueError):
            tags.remove(tag)

    last_tag = tags[-1]

    warnings = []
    if 'dev' in version:
        warnings.append('Distribution must not be a developmental release.')

    if parse_version(version) < parse_version('0'):
        # any version which is not a valid PEP 440 version will be considered
        # less than any valid PEP 440 version
        warnings.append(
            version + ' is not a valid version string following PEP 440.')
    elif safe_version(version) != version:
        warnings.append(
            '{} does not follow PEP 440. Use {} as version string instead.'
            .format(version, safe_version(version)))

    if parse_version(version) <= parse_version(last_tag):
        warnings.append(
            'New version "{}" is not higher than last version "{}".'
            .format(version, last_tag))

    if warnings:
        print(__doc__)
        print('\n\n'.join(warnings))
        sys.exit('\nBuild of distribution package canceled.')

    return version

def read_desc(filename):  # pragma: no cover
    """Read long description.

    Combine included restructured text files which must be done before
    uploading because the source isn't available after creating the package.
    """
    desc = []
    with open(filename) as f:
        for line in f:
            if line.strip().startswith('.. include::'):
                include = os.path.relpath(line.rsplit('::')[1].strip())
                if os.path.exists(include):
                    with open(include) as g:
                        desc.append(g.read())
                else:
                    print('Cannot include {0}; file not found'.format(include))
            else:
                desc.append(line)
    return ''.join(desc)

def get_packages(name):  # pragma: no cover
    """Find framework packages."""
    from setuptools import find_namespace_packages
    packages = find_namespace_packages(include=[name + '.*'])
    return [str(name)] + packages

def main():
    """Setup entry point."""
    version = get_validated_version()
    setup(
        name=metadata.__name__,
        version=version,
        description=metadata.__description__,
        long_description=read_desc('README.rst'),
        keywords=metadata.__keywords__.split(),
        maintainer=metadata.__maintainer__,
        maintainer_email=metadata.__maintainer_email__,
        license=metadata.__license__,
        packages=get_packages(name),
        python_requires='>=3.5.0',
        install_requires=dependencies,
        extras_require=extra_deps,
        url=metadata.__url__,
        download_url=metadata.__download_url__,
        test_suite='tests.collector',
        tests_require=test_deps,
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3 :: Only',
            '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',
            'Programming Language :: Python :: 3.10',
            'Programming Language :: Python :: Implementation :: CPython',
            'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki',
            'Topic :: Software Development :: Libraries :: Python Modules',
            'Topic :: Utilities',
        ],
        use_2to3=False
    )

    # Finally show distribution version before uploading
    if 'sdist' in sys.argv:
        print('\nDistribution package created for version {}'.format(version))

if __name__ == '__main__':  # pragma: no cover
    main()
<commit_msg>[dist] setuptools >= 40.1.0 is required to create a new distribution<commit_after># -*- coding: utf-8 -*-
"""Installer script for Pywikibot framework.

To create a new distribution:
-----------------------------

- replace the developmental version string in ``pywikibot.__metadata.py``
  by the corresponing final release
- create the package with::

    python setup.py sdist

- push the change to gerrit and merge it to the repository
- upload the package to pypy by::

    twine upload dist/*

- create a new tag with the version number of the final release
- move the existing 'stable' tag to that new tag
- delete 'stable' tag in gerrit to be overridden later
- synchronize the local tags with the remote repositoy
- prepare the next release by increasing the version number in
  ``pywikibot.__metadata.py`` and adding developmental identifier
- upload this patchset to gerrit and merge it.
"""
#
# (C) Pywikibot team, 2009-2021
#
# Distributed under the terms of the MIT license.
#
# ## KEEP PYTHON 2 SUPPORT FOR THIS SCRIPT ## #
import os
import sys

from pkg_resources import parse_version, safe_version
from setuptools import setup

PYTHON_VERSION = sys.version_info[:3]

VERSIONS_REQUIRED_MESSAGE = """
Pywikibot is not available on:
{version}

This version of Pywikibot only supports Python 3.5+.
"""

def python_is_supported():
    """Check that Python is supported."""
    return PYTHON_VERSION >= (3, 5, 0)

if not python_is_supported():  # pragma: no cover
    # pwb.py checks this exception
    raise RuntimeError(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))

# ------- setup extra_requires ------- #
extra_deps = {
    # Core library dependencies
    'eventstreams': ['sseclient!=0.0.23,!=0.0.24,>=0.0.18'],
    'isbn': ['python-stdnum>=1.15'],
    'Graphviz': ['pydot>=1.2'],
    'Google': ['google>=1.7'],
    'mwparserfromhell': ['mwparserfromhell>=0.3.3'],
    'Tkinter': [  # vulnerability found in Pillow<6.2.2
        'Pillow>=6.2.2,<8.0.0;python_version<"3.6"',
        'Pillow>=6.2.2;python_version>="3.6" and python_version<"3.9"',
        'Pillow>=8.0.0;python_version>="3.9"',
    ],
    'mwoauth': ['mwoauth!=0.3.1,>=0.2.4'],
    'html': ['BeautifulSoup4'],
    'http': ['fake_useragent'],
    'flake8': [  # Due to incompatibilities between packages the order matters.
        'flake8>=3.7.5',
        'pydocstyle>=4.0.0',
        'hacking',
        'flake8-coding',
        'flake8-colors>=0.1.9',
        'flake8-comprehensions>=3.1.4;python_version>="3.8"',
        'flake8-comprehensions>=2.2.0',
        'flake8-docstrings>=1.3.1',
        'flake8-future-import',
        'flake8-mock>=0.3',
        'flake8-print>=2.0.1',
        'flake8-quotes>=2.0.1',
        'flake8-string-format',
        'flake8-tuple>=0.2.8',
        'flake8-no-u-prefixed-strings>=0.2',
        'pep8-naming>=0.7',
        'pyflakes>=2.1.0',
    ],
}

# ------- setup extra_requires for scripts ------- #
script_deps = {
    'flickrripper.py': [
        'flickrapi>=2.2',
    ] + extra_deps['Tkinter'],
    'imageharvest.py': extra_deps['html'],
    'isbn.py': extra_deps['isbn'],
    'match_images.py': extra_deps['Tkinter'],
    'patrol.py': extra_deps['mwparserfromhell'],
    'states_redirect.py': ['pycountry'],
    'weblinkchecker.py': ['memento_client!=0.6.0,>=0.5.1'],
}

extra_deps.update(script_deps)
extra_deps.update({'scripts': [i for k, v in script_deps.items() for i in v]})

# ------- setup install_requires ------- #
# packages which are mandatory
dependencies = [
    'requests>=2.20.1,<2.26.0;python_version<"3.6"',
    'requests>=2.20.1;python_version>="3.6"',
    # PEP 440
    'setuptools>=20.2, !=50.0.0, <50.2.0 ; python_version < "3.6"',
    'setuptools>=20.2 ; python_version >= "3.6"',
]

try:
    import bz2
except ImportError:  # pragma: no cover
    # Use bz2file if the python is not compiled with bz2 support.
    dependencies.append('bz2file')
else:
    assert bz2

# ------- setup tests_require ------- #
test_deps = ['bz2file', 'mock']
# Some of the ui_tests depend on accessing the console window's menu
# to set the console font and copy and paste, achieved using pywinauto
# which depends on pywin32.
# These tests may be disabled because pywin32 depends on VC++, is time
# consuming to build, and the console window can't be accessed during appveyor
# builds.
if os.name == 'nt' and os.environ.get('PYSETUP_TEST_NO_UI', '0') != '1':
    test_deps += [
        'pywinauto>0.6.4',
        'pywin32>=225',
    ]

# Add all dependencies as test dependencies,
# so all scripts can be compiled for script_tests, etc.
if 'PYSETUP_TEST_EXTRAS' in os.environ:  # pragma: no cover
    test_deps += [i for k, v in extra_deps.items() if k != 'flake8' for i in v]

# These extra dependencies are needed other unittest fails to load tests.
test_deps += extra_deps['eventstreams']

class _DottedDict(dict):
    __getattr__ = dict.__getitem__

# import metadata
metadata = _DottedDict()
name = 'pywikibot'
path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(path, name, '__metadata__.py')) as f:
    exec(f.read(), metadata)
assert metadata.__name__ == name

def get_validated_version():  # pragma: no cover
    """Get a validated pywikibot module version string.

    The version number from pywikibot.__metadata__.__version__ is used.
    setup.py with 'sdist' option is used to create a new source distribution.
    In that case the version number is validated: Read tags from git.
    Verify that the new release is higher than the last repository tag
    and is not a developmental release.

    @return: pywikibot module version string
    @rtype: str
    """
    version = metadata.__version__
    if 'sdist' not in sys.argv:
        return version

    # validate version for sdist
    from contextlib import suppress
    from subprocess import run, PIPE
    try:
        tags = run(['git', 'tag'], check=True, stdout=PIPE,
                   universal_newlines=True).stdout.splitlines()
    except Exception as e:
        print(e)
        sys.exit('Creating source distribution canceled.')

    for tag in ('stable', 'python2'):
        with suppress(ValueError):
            tags.remove(tag)

    last_tag = tags[-1]

    warnings = []
    if 'dev' in version:
        warnings.append('Distribution must not be a developmental release.')

    if parse_version(version) < parse_version('0'):
        # any version which is not a valid PEP 440 version will be considered
        # less than any valid PEP 440 version
        warnings.append(
            version + ' is not a valid version string following PEP 440.')
    elif safe_version(version) != version:
        warnings.append(
            '{} does not follow PEP 440. Use {} as version string instead.'
            .format(version, safe_version(version)))

    if parse_version(version) <= parse_version(last_tag):
        warnings.append(
            'New version "{}" is not higher than last version "{}".'
            .format(version, last_tag))

    if warnings:
        print(__doc__)
        print('\n\n'.join(warnings))
        sys.exit('\nBuild of distribution package canceled.')

    return version

def read_desc(filename):  # pragma: no cover
    """Read long description.

    Combine included restructured text files which must be done before
    uploading because the source isn't available after creating the package.
    """
    desc = []
    with open(filename) as f:
        for line in f:
            if line.strip().startswith('.. include::'):
                include = os.path.relpath(line.rsplit('::')[1].strip())
                if os.path.exists(include):
                    with open(include) as g:
                        desc.append(g.read())
                else:
                    print('Cannot include {0}; file not found'.format(include))
            else:
                desc.append(line)
    return ''.join(desc)

def get_packages(name):  # pragma: no cover
    """Find framework packages."""
    try:
        from setuptools import find_namespace_packages
    except ImportError:
        sys.exit(
            'setuptools >= 40.1.0 is required to create a new distribution.')
    packages = find_namespace_packages(include=[name + '.*'])
    return [str(name)] + packages

def main():
    """Setup entry point."""
    version = get_validated_version()
    setup(
        name=metadata.__name__,
        version=version,
        description=metadata.__description__,
        long_description=read_desc('README.rst'),
        keywords=metadata.__keywords__.split(),
        maintainer=metadata.__maintainer__,
        maintainer_email=metadata.__maintainer_email__,
        license=metadata.__license__,
        packages=get_packages(name),
        python_requires='>=3.5.0',
        install_requires=dependencies,
        extras_require=extra_deps,
        url=metadata.__url__,
        download_url=metadata.__download_url__,
        test_suite='tests.collector',
        tests_require=test_deps,
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: MIT License',
            'Natural Language :: English',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3 :: Only',
            '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',
            'Programming Language :: Python :: 3.10',
            'Programming Language :: Python :: Implementation :: CPython',
            'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki',
            'Topic :: Software Development :: Libraries :: Python Modules',
            'Topic :: Utilities',
        ],
        use_2to3=False
    )

    # Finally show distribution version before uploading
    if 'sdist' in sys.argv:
        print('\nDistribution package created for version {}'.format(version))

if __name__ == '__main__':  # pragma: no cover
    main()
<|endoftext|>


<commit_before>import os
from setuptools import setup, find_packages

version = '1.0a1'
description = "installs a WSGI application in place of a real URI for testing"

here = os.path.dirname(__file__)
readme = os.path.join(here, "README.rst")
long_description = open(readme).read()

setup(
    name = 'wsgi_intercept',
    version = version,
    author = 'Titus Brown, Kumar McMillan',
    author_email = 'kumar.mcmillan@gmail.com',
    description = description,
    url="http://code.google.com/p/wsgi-intercept/",
    long_description = long_description,
    license = 'MIT License',
    packages = find_packages(),
    test_suite = "nose.collector",
    tests_require=[
        'nose',
        'Paste',
        'httplib2',
        'mechanize',
        'mechanoid',
        'WebTest',
        'zope.testbrowser',
        'webunit',
        ],
    )
<commit_msg>Spacing style<commit_after>import os
from setuptools import setup, find_packages

version = '1.0a1'
description = "installs a WSGI application in place of a real URI for testing"

here = os.path.dirname(__file__)
readme = os.path.join(here, "README.rst")
long_description = open(readme).read()

setup(
    name='wsgi_intercept',
    version=version,
    author='Titus Brown, Kumar McMillan',
    author_email='kumar.mcmillan@gmail.com',
    description=description,
    url="http://code.google.com/p/wsgi-intercept/",
    long_description=long_description,
    license='MIT License',
    packages=find_packages(),
    test_suite="nose.collector",
    tests_require=[
        'nose',
        'Paste',
        'httplib2',
        'mechanize',
        'mechanoid',
        'WebTest',
        'zope.testbrowser',
        'webunit',
        ],
    )
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
# pylint: disable=fixme

from setuptools import setup

with open('README.rst') as readme_file:
    readme = readme_file.read()

with open('HISTORY.rst') as history_file:
    history = history_file.read()

requirements = [
    'click>=6.0',
    'python-xlib',
    'xkbgroup',
]

test_requirements = [
    'tox',
]

setup(
    name='swytcher',
    version='0.3.1',
    description="Automatically switch layout based on your active window",
    long_description=readme + '\n\n' + history,
    author="Eddie Dunn",
    author_email='eddie.dunn@gmail.com',
    url='https://github.com/eddie-dunn/swytcher',
    packages=[
        'swytcher',
    ],
    package_dir={'swytcher': 'swytcher'},
    entry_points={
        'console_scripts': [
            'swytcher=swytcher.cli:main'
        ]
    },
    include_package_data=True,
    install_requires=requirements,
    license="MIT license",
    zip_safe=False,
    keywords='keyboard layout switcher',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
    ],
    test_suite='tests',
    tests_require=test_requirements
)
<commit_msg>setup.py: Add python_requires >= 3<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
# pylint: disable=fixme

from setuptools import setup

with open('README.rst') as readme_file:
    readme = readme_file.read()

with open('HISTORY.rst') as history_file:
    history = history_file.read()

requirements = [
    'click>=6.0',
    'python-xlib',
    'xkbgroup',
]

test_requirements = [
    'tox',
]

setup(
    name='swytcher',
    version='0.3.1',
    description="Automatically switch layout based on your active window",
    long_description=readme + '\n\n' + history,
    author="Eddie Dunn",
    author_email='eddie.dunn@gmail.com',
    url='https://github.com/eddie-dunn/swytcher',
    packages=[
        'swytcher',
    ],
    package_dir={'swytcher': 'swytcher'},
    entry_points={
        'console_scripts': [
            'swytcher=swytcher.cli:main'
        ]
    },
    include_package_data=True,
    install_requires=requirements,
    license="MIT license",
    zip_safe=False,
    keywords='keyboard layout switcher',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
    ],
    test_suite='tests',
    tests_require=test_requirements,
    python_requires='>=3',
)
<|endoftext|>


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

from distutils.core import setup

setup(name              = "tropo-webapi-python",
      version           = "0.1.0",
      url               = "http://github.com/tropo/tropo-webapi-python",
      maintainer        = "Voxeo",
      maintainer_email  = "support@tropo.com",
      long_description  = "Python Tropo WebAPI implementation",
      platforms         = ["Platform Independent"],
      classifiers       = [
          "Development Status :: 4 - Beta",
          "Intended Audience :: Developers",
          "License :: OSI Approved :: MIT License",
          "Operating System :: OS Independent",
          "Programming Language :: Python"
      ],
      py_modules = ['tropo'],
)

<commit_msg>Modified setup.py: added description and license fields, changed long_description text<commit_after>#!/usr/bin/env python

from distutils.core import setup

setup(name              = "tropo-webapi-python",
      version           = "0.1.0",
      url               = "http://github.com/tropo/tropo-webapi-python",
      maintainer        = "Voxeo",
      maintainer_email  = "support@tropo.com",
      description	= "Python library for building voice/SMS/IM/Twitter apps at Tropo.com",
      long_description  = "This module implements a set of classes and methods for manipulating the Web API for the Tropo cloud communications service at http://www.tropo.com/",
      platforms         = ["Platform Independent"],
      license		= "MIT",
      classifiers       = [
          "Development Status :: 4 - Beta",
          "Intended Audience :: Developers",
          "License :: OSI Approved :: MIT License",
          "Operating System :: OS Independent",
          "Programming Language :: Python"
      ],
      py_modules = ['tropo'],
)

<|endoftext|>


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

from __future__ import absolute_import, division, print_function, unicode_literals

from setuptools import setup, find_packages

setup(
    name="autovenv",
    version="0.2.1577246524",
    description="virtualenv with less hassle",
    url="http://autovenv.readthedocs.org",
    long_description="Virtual environments are great, but they can be a bit annoying to create, manage, and switch between. It gets even worse when multiple different python versions come into play. autovenv takes the annoyance away.\n\nFull documentation is at https://autovenv.readthedocs.org",
    author="Robert Lechte",
    author_email="robertlechte@gmail.com",
    install_requires=["virtualenv", "appdirs", "pathlib2", "pyyaml", "six"],
    packages=find_packages(),
    classifiers=["Development Status :: 3 - Alpha"],
    scripts=[
        "scripts/autovenv.sh",
        "autovenv/python-build/autovenv-python-build",
        "scripts/autovenv-build",
        "scripts/autovenv-pythons-available",
    ],
    include_package_data=True,
    entry_points={"console_scripts": ["autovenv = autovenv:do_command"]},
)
<commit_msg>vbump<commit_after>#!/usr/bin/env python

from __future__ import absolute_import, division, print_function, unicode_literals

from setuptools import setup, find_packages

setup(
    name="autovenv",
    version="0.2.1582845932",
    description="virtualenv with less hassle",
    url="http://autovenv.readthedocs.org",
    long_description="Virtual environments are great, but they can be a bit annoying to create, manage, and switch between. It gets even worse when multiple different python versions come into play. autovenv takes the annoyance away.\n\nFull documentation is at https://autovenv.readthedocs.org",
    author="Robert Lechte",
    author_email="robertlechte@gmail.com",
    install_requires=["virtualenv", "appdirs", "pathlib2", "pyyaml", "six"],
    packages=find_packages(),
    classifiers=["Development Status :: 3 - Alpha"],
    scripts=[
        "scripts/autovenv.sh",
        "autovenv/python-build/autovenv-python-build",
        "scripts/autovenv-build",
        "scripts/autovenv-pythons-available",
    ],
    include_package_data=True,
    entry_points={"console_scripts": ["autovenv = autovenv:do_command"]},
)
<|endoftext|>


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

from setuptools import setup, find_packages
from pip.req import parse_requirements

install_requirements = parse_requirements('OIPA/requirements.txt', session=False)
requirements = [str(ir.req) for ir in install_requirements]

setup(name='OIPA',
      version='2.2.1',
      author='Zimmerman & Zimmerman',
      description="OIPA is an open-source framework that renders IATI compliant XML and \
            related indicator #opendata into the OIPA datamodel for storage. \
            This ETL approach provides I/O using the OIPA Tastypie RESTless API (soon DRF!) \
            providing you with direct XML or JSON output. Does Django and MySQL. \
            Codebase maintained by Zimmerman & Zimmerman in Amsterdam. http://www.oipa.nl/",
      url='https://github.com/catalpainternational/oipa',
      packages=find_packages('OIPA'),  # iati, etc
      package_dir={'': 'OIPA'},
      install_requires=requirements,
      zip_safe=False
      )
<commit_msg>Bump version<commit_after>#!/usr/bin/env python

from setuptools import setup, find_packages
from pip.req import parse_requirements

install_requirements = parse_requirements('OIPA/requirements.txt', session=False)
requirements = [str(ir.req) for ir in install_requirements]

setup(name='OIPA',
      version='2.2.2',
      author='Zimmerman & Zimmerman',
      description="OIPA is an open-source framework that renders IATI compliant XML and \
            related indicator #opendata into the OIPA datamodel for storage. \
            This ETL approach provides I/O using the OIPA Tastypie RESTless API (soon DRF!) \
            providing you with direct XML or JSON output. Does Django and MySQL. \
            Codebase maintained by Zimmerman & Zimmerman in Amsterdam. http://www.oipa.nl/",
      url='https://github.com/catalpainternational/oipa',
      packages=find_packages('OIPA'),  # iati, etc
      package_dir={'': 'OIPA'},
      install_requires=requirements,
      zip_safe=False
      )
<|endoftext|>