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