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__ = (
  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. pagure = pagure.lib.git_auth:PagureGitAuth
  51. pagure_authorized_keys = pagure.lib.git_auth:PagureGitAuth
  52. """,
  53. classifiers=[
  54. "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
  55. "Operating System :: POSIX :: Linux",
  56. "Programming Language :: Python :: 3",
  57. "Programming Language :: Python :: 3.9",
  58. "Programming Language :: Python :: 3.10",
  59. "Programming Language :: Python :: 3.11",
  60. "Programming Language :: Python :: 3.12",
  61. "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
  62. "Topic :: Software Development :: Bug Tracking",
  63. "Topic :: Software Development :: Version Control",
  64. ],
  65. )