setup.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. pagure = pagure.lib.git_auth:PagureGitAuth
  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.7',
  57. 'Programming Language :: Python :: 3',
  58. 'Programming Language :: Python :: 3.4',
  59. 'Programming Language :: Python :: 3.5',
  60. 'Programming Language :: Python :: 3.6',
  61. 'Programming Language :: Python :: 3.7',
  62. 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
  63. 'Topic :: Software Development :: Bug Tracking',
  64. 'Topic :: Software Development :: Version Control',
  65. ]
  66. )