setup.py 2.3 KB

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