|
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 |
|
|
Pierre-Yves Chibon |
88ffca |
lines = open(requirements_file).readlines()
|
|
Pierre-Yves Chibon |
88ffca |
return [
|
|
Pierre-Yves Chibon |
88ffca |
line.rstrip().split('#')[0]
|
|
Pierre-Yves Chibon |
88ffca |
for line in lines
|
|
Pierre-Yves Chibon |
88ffca |
if not line.startswith('#')
|
|
Pierre-Yves Chibon |
88ffca |
]
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
setup(
|
|
Pierre-Yves Chibon |
fe5017 |
name='pagure',
|
|
Pierre-Yves Chibon |
88ffca |
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+',
|
|
Pierre-Yves Chibon |
fe5017 |
download_url='https://fedorahosted.org/releases/p/r/pagure/',
|
|
Pierre-Yves Chibon |
fe5017 |
url='https://fedorahosted.org/pagure/',
|
|
Pierre-Yves Chibon |
fe5017 |
packages=['pagure'],
|
|
Pierre-Yves Chibon |
88ffca |
include_package_data=True,
|
|
Pierre-Yves Chibon |
88ffca |
install_requires=get_requirements(),
|
|
Pierre-Yves Chibon |
88ffca |
)
|