Blame setup.py

Pierre-Yves Chibon 88ffca
#!/usr/bin/env python
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
"""
Pierre-Yves Chibon 88ffca
Setup script
Pierre-Yves Chibon 88ffca
"""
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 4d1da1
import os
Pierre-Yves Chibon 4d1da1
import re
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
from setuptools import setup
Pierre-Yves Chibon 84bf94
Pierre-Yves Chibon 84bf94
Pierre-Yves Chibon 84bf94
pagurefile = os.path.join(os.path.dirname(__file__), 'pagure', '__init__.py')
Pierre-Yves Chibon 84bf94
Pierre-Yves Chibon 84bf94
# Thanks to SQLAlchemy:
Pierre-Yves Chibon 84bf94
# https://github.com/zzzeek/sqlalchemy/blob/master/setup.py#L104
Pierre-Yves Chibon 84bf94
with open(pagurefile) as stream:
Pierre-Yves Chibon 84bf94
    __version__ = re.compile(
Pierre-Yves Chibon 84bf94
        r".*__version__ = '(.*?)'", re.S
Pierre-Yves Chibon 84bf94
    ).match(stream.read()).group(1)
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
def get_requirements(requirements_file='requirements.txt'):
Pierre-Yves Chibon 88ffca
    """Get the contents of a file listing the requirements.
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
    :arg requirements_file: path to a requirements file
Pierre-Yves Chibon 88ffca
    :type requirements_file: string
Pierre-Yves Chibon 88ffca
    :returns: the list of requirements, or an empty list if
Pierre-Yves Chibon 88ffca
              `requirements_file` could not be opened or read
Pierre-Yves Chibon 88ffca
    :return type: list
Pierre-Yves Chibon 88ffca
    """
Pierre-Yves Chibon 88ffca
Jeremy Cline 2eaa12
    with open(requirements_file) as f:
Jeremy Cline 2eaa12
        return [
Jeremy Cline 2eaa12
            line.rstrip().split('#')[0]
Jeremy Cline 2eaa12
            for line in f.readlines()
Jeremy Cline 2eaa12
            if not line.startswith('#')
Jeremy Cline 2eaa12
        ]
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
Pierre-Yves Chibon 88ffca
setup(
Pierre-Yves Chibon fe5017
    name='pagure',
Jeremy Cline 15aa41
    description='A light-weight git-centered forge based on pygit2.',
Pierre-Yves Chibon 88ffca
    version=__version__,
Pierre-Yves Chibon 88ffca
    author='Pierre-Yves Chibon',
Pierre-Yves Chibon 88ffca
    author_email='pingou@pingoured.fr',
Pierre-Yves Chibon 88ffca
    maintainer='Pierre-Yves Chibon',
Pierre-Yves Chibon 88ffca
    maintainer_email='pingou@pingoured.fr',
Pierre-Yves Chibon 88ffca
    license='GPLv2+',
Jeremy Cline 15aa41
    download_url='https://pagure.io/releases/pagure/',
Jeremy Cline 15aa41
    url='https://pagure.io/pagure/',
Pierre-Yves Chibon fe5017
    packages=['pagure'],
Pierre-Yves Chibon 88ffca
    include_package_data=True,
Pierre-Yves Chibon 88ffca
    install_requires=get_requirements(),
farhaanbukhsh 4c78f4
    entry_points="""
Pierre-Yves Chibon 079c2a
    [console_scripts]
Pierre-Yves Chibon 079c2a
    pagure-admin=pagure.cli.admin:main
Pierre-Yves Chibon 145998
Pierre-Yves Chibon 145998
    [pagure.git_auth.helpers]
Pierre-Yves Chibon 145998
    test_auth = pagure.lib.git_auth:GitAuthTestHelper
Pierre-Yves Chibon 145998
    gitolite2 = pagure.lib.git_auth:Gitolite2Auth
Pierre-Yves Chibon 145998
    gitolite3 = pagure.lib.git_auth:Gitolite3Auth
Jeremy Cline 15aa41
    """,
Jeremy Cline 15aa41
    classifiers=[
Jeremy Cline 15aa41
        'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
Jeremy Cline 15aa41
        'Operating System :: POSIX :: Linux',
Jeremy Cline 15aa41
        'Programming Language :: Python :: 2',
Jeremy Cline 15aa41
        'Programming Language :: Python :: 2.6',
Jeremy Cline 15aa41
        'Programming Language :: Python :: 2.7',
Jeremy Cline 15aa41
        'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
Jeremy Cline 15aa41
        'Topic :: Software Development :: Bug Tracking',
Jeremy Cline 15aa41
        'Topic :: Software Development :: Version Control',
Jeremy Cline 15aa41
    ]
Pierre-Yves Chibon 88ffca
)