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 88ffca
# Required to build on EL6
Pierre-Yves Chibon 4c6c3a
__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']
Pierre-Yves Chibon 88ffca
import pkg_resources
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="""
farhaanbukhsh 4c78f4
    [moksha.consumer]
farhaanbukhsh 3f88c9
    integrator = pagureCI.consumer:Integrator
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
)