1
0

setup.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. [pygments.styles]
  48. diffstyle = pagure.ui.diff_style:DiffStyle
  49. [console_scripts]
  50. pagure-admin=pagure.cli.admin:main
  51. """,
  52. classifiers=[
  53. 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
  54. 'Operating System :: POSIX :: Linux',
  55. 'Programming Language :: Python :: 2',
  56. 'Programming Language :: Python :: 2.6',
  57. 'Programming Language :: Python :: 2.7',
  58. 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
  59. 'Topic :: Software Development :: Bug Tracking',
  60. 'Topic :: Software Development :: Version Control',
  61. ]
  62. )