1
0

setup.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env python
  2. """
  3. Setup script
  4. """
  5. # Required to build on EL6
  6. __requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']
  7. import pkg_resources
  8. import os
  9. import re
  10. from setuptools import setup
  11. pagurefile = os.path.join(os.path.dirname(__file__), 'pagure', '__init__.py')
  12. # Thanks to SQLAlchemy:
  13. # https://github.com/zzzeek/sqlalchemy/blob/master/setup.py#L104
  14. with open(pagurefile) as stream:
  15. __version__ = re.compile(
  16. r".*__version__ = '(.*?)'", re.S
  17. ).match(stream.read()).group(1)
  18. def get_requirements(requirements_file='requirements.txt'):
  19. """Get the contents of a file listing the requirements.
  20. :arg requirements_file: path to a requirements file
  21. :type requirements_file: string
  22. :returns: the list of requirements, or an empty list if
  23. `requirements_file` could not be opened or read
  24. :return type: list
  25. """
  26. with open(requirements_file) as f:
  27. return [
  28. line.rstrip().split('#')[0]
  29. for line in f.readlines()
  30. if not line.startswith('#')
  31. ]
  32. setup(
  33. name='pagure',
  34. description='A light-weight git-centered forge based on pygit2.',
  35. version=__version__,
  36. author='Pierre-Yves Chibon',
  37. author_email='pingou@pingoured.fr',
  38. maintainer='Pierre-Yves Chibon',
  39. maintainer_email='pingou@pingoured.fr',
  40. license='GPLv2+',
  41. download_url='https://pagure.io/releases/pagure/',
  42. url='https://pagure.io/pagure/',
  43. packages=['pagure'],
  44. include_package_data=True,
  45. install_requires=get_requirements(),
  46. entry_points="""
  47. [moksha.consumer]
  48. integrator = pagureCI.consumer:Integrator
  49. """,
  50. classifiers=[
  51. 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
  52. 'Operating System :: POSIX :: Linux',
  53. 'Programming Language :: Python :: 2',
  54. 'Programming Language :: Python :: 2.6',
  55. 'Programming Language :: Python :: 2.7',
  56. 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
  57. 'Topic :: Software Development :: Bug Tracking',
  58. 'Topic :: Software Development :: Version Control',
  59. ]
  60. )