1
0

setup.py 2.5 KB

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