setup.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 :: 3",
  59. "Programming Language :: Python :: 3.9",
  60. "Programming Language :: Python :: 3.10",
  61. "Programming Language :: Python :: 3.11",
  62. "Programming Language :: Python :: 3.12",
  63. "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
  64. "Topic :: Software Development :: Bug Tracking",
  65. "Topic :: Software Development :: Version Control",
  66. ],
  67. )