<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This code is distributed under the GPLv3 license.
# Copyright (c) Polytechnique.org


import codecs
import os
import re
import sys

from setuptools import find_packages, setup

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


def get_version(package_name):
    version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
    package_components = package_name.split('.')
    init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
    with codecs.open(init_path, 'r', 'utf-8') as f:
        for line in f:
            match = version_re.match(line[:-1])
            if match:
                return match.groups()[0]
    return '0.1.0'


def clean_readme(fname):
    """Cleanup README.rst for proper PyPI formatting."""
    with codecs.open(fname, 'r', 'utf-8') as f:
        return ''.join(
            re.sub(r':\w+:`([^`]+?)( <[^<>]+>)?`', r'``\1``', line)
            for line in f
            if not (line.startswith('.. currentmodule') or line.startswith('.. toctree'))
        )


PACKAGE = 'xorgauth'


setup(
    name=PACKAGE,
    version=get_version(PACKAGE),
    author="Polytechnique.org dev team",
    author_email="<EMAIL>",
    description="Polytechnique.org authentication provider",
    long_description=clean_readme('README.rst'),
    license='AGPLv3',
    keywords=['sso', 'authentication', 'authgroupex', 'openid connect'],
    url='https://github.com/Polytechnique-org/%s' % PACKAGE,
    download_url='http://pypi.python.org/pypi/%s/' % PACKAGE,

    packages=find_packages(include=[PACKAGE, '%s.*' % PACKAGE]),
    include_package_data=True,

    #python_requires='>=3.4.2',
    python_requires='>=2.7',
    install_requires=[
        'Django>=1.11',
        'django-oidc-provider',
        'django-bootstrap3',
        'django-zxcvbn-password',
        'getconf',
    ],
    setup_requires=[
        'setuptools>=0.8',
    ],
<commit_msg>Use Django 2.0 only when using Python 3<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This code is distributed under the GPLv3 license.
# Copyright (c) Polytechnique.org


import codecs
import os
import re
import sys

from setuptools import find_packages, setup

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


def get_version(package_name):
    version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
    package_components = package_name.split('.')
    init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
    with codecs.open(init_path, 'r', 'utf-8') as f:
        for line in f:
            match = version_re.match(line[:-1])
            if match:
                return match.groups()[0]
    return '0.1.0'


def clean_readme(fname):
    """Cleanup README.rst for proper PyPI formatting."""
    with codecs.open(fname, 'r', 'utf-8') as f:
        return ''.join(
            re.sub(r':\w+:`([^`]+?)( <[^<>]+>)?`', r'``\1``', line)
            for line in f
            if not (line.startswith('.. currentmodule') or line.startswith('.. toctree'))
        )


PACKAGE = 'xorgauth'


setup(
    name=PACKAGE,
    version=get_version(PACKAGE),
    author="Polytechnique.org dev team",
    author_email="<EMAIL>",
    description="Polytechnique.org authentication provider",
    long_description=clean_readme('README.rst'),
    license='AGPLv3',
    keywords=['sso', 'authentication', 'authgroupex', 'openid connect'],
    url='https://github.com/Polytechnique-org/%s' % PACKAGE,
    download_url='http://pypi.python.org/pypi/%s/' % PACKAGE,

    packages=find_packages(include=[PACKAGE, '%s.*' % PACKAGE]),
    include_package_data=True,

    python_requires='>=3.4.2' if sys.version_info >= (3,) else '>=2.7',
    install_requires=[
        'Django>=1.11' if sys.version_info >= (3,) else 'Django>=1.11,<2.0',
        'django-oidc-provider',
        'django-bootstrap3',
        'django-zxcvbn-password',
        'getconf',
    ],
    setup_requires=[
        'setuptools>=0.8',
    ],

{'fraction_non_alphanumeric': 0.177, 'fraction_numerical': 0.0135, 'mean_word_length': 3.074338085539715, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 20, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3445634', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1382, 'n_words': 268}