forked from privacyidea/privacyidea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
171 lines (157 loc) · 5.58 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
from setuptools import setup, find_packages
import os
import stat
import sys
#VERSION = "2.1dev4"
VERSION = "3.10"
# Taken from kennethreitz/requests/setup.py
package_directory = os.path.realpath(os.path.dirname(__file__))
def get_file_contents(file_path):
"""Get the context of the file using full path name."""
content = ""
try:
full_path = os.path.join(package_directory, file_path)
content = open(full_path, 'r').read()
except:
print("### could not open file {0!r}".format(file_path), file=sys.stderr)
return content
def get_file_list(file_path):
full_path = os.path.join(package_directory, file_path)
file_list = os.listdir(full_path)
# now we need to add the path to the files
return [file_path + f for f in file_list]
install_requires = [
"argon2_cffi>=20.1.0",
"beautifulsoup4[lxml]>=4.3.2",
"cbor2>=5.0.1",
"configobj>=5.0.6",
"croniter>=0.3.8",
"cryptography>=2.4.2",
"defusedxml>=0.4.1",
"Flask>=0.10.1,<2.0",
"Flask-Babel>=0.9,<3.0",
"Flask-Migrate>=1.2.0,<3.0",
"Flask-Script>=2.0.5",
"Flask-SQLAlchemy>=2.0,<3.0",
"Flask-Versioned>=0.9.4",
"google-auth>=1.23.0",
"grpcio>=1.46",
"huey[redis]>=1.11.0",
"importlib_metadata>=2.1.1; python_version=='3.7'",
"ldap3>=2.8,<2.9",
"MarkupSafe<2.1",
"netaddr>=0.7.12",
"passlib[bcrypt]>=1.7.0",
"protobuf>=3.20",
"pydash>=4.7.4",
"PyJWT>=1.3.0",
"PyMySQL>=0.6.6",
"pyOpenSSL>=17.5",
"pyrad>=2.0",
"python-dateutil>=2.7.3",
"python-gnupg>=0.4.4",
"PyYAML>=5.1",
"requests>=2.7.0",
"segno>=1.5",
"smpplib>=2.0",
"SQLAlchemy>=1.4.0,<2.0"
]
def get_man_pages(dir):
"""
Get man pages in a directory.
:param dir:
:return: list of file names
"""
files = os.listdir(dir)
r_files = []
for file in files:
if file.endswith(".1"):
r_files.append(dir + "/" + file)
return r_files
def get_scripts(dir):
"""
Get files that are executable
:param dir:
:return: list of file names
"""
files = os.listdir(dir)
r_files = []
for file in files:
if os.stat(dir + "/" + file)[stat.ST_MODE] & stat.S_IEXEC:
r_files.append(dir + "/" + file)
return r_files
setup(
name='privacyIDEA',
version=VERSION,
description='privacyIDEA: multifactor authentication management system',
author='privacyidea.org',
license='AGPLv3',
author_email='[email protected]',
url='https://www.privacyidea.org',
keywords='OTP, two factor authentication, management, security',
python_requires='>=3.7',
packages=find_packages(),
scripts=get_scripts("tools"),
entry_points={
'console_scripts': [
'privacyidea-token-janitor = privacyidea.cli.privacyideatokenjanitor:cli',
'pi-manage = privacyidea.cli.pimanage:cli',
'privacyidea-standalone = privacyidea.cli.tools.standalone:cli',
'privacyidea-get-serial = privacyidea.cli.tools.get_serial:byotp_call',
'privacyidea-usercache-cleanup = privacyidea.cli.tools.usercache_cleanup:delete_call',
'privacyidea-get-unused-tokens = privacyidea.cli.tools.get_unused_tokens:cli',
'privacyidea-expired-users = privacyidea.cli.tools.expired_users:expire_call',
'privacyidea-cron = privacyidea.cli.tools.cron:cli'
]},
extras_require={
'doc': ["Pallets-Sphinx-Themes>=1.2.3",
"Sphinx>=1.3.1",
"sphinxcontrib-httpdomain>=1.3.0",
"sphinxcontrib-plantuml>=0.18",
"sphinxcontrib-spelling>=7.0.0"],
'test': ["mock>=2.0.0",
"pyparsing>=3.0",
"pytest>=3.6.0",
"pytest-cov>=2.5.1",
"responses>=0.9.0",
"testfixtures>=6.14.2"],
'postgres': ['psycopg2>=2.8.3'],
'hsm': ['PyKCS11>=1.5.10'],
'kerberos': ['gssapi>=1.7.0']
},
install_requires=install_requires,
include_package_data=True,
data_files=[('etc/privacyidea/',
['deploy/apache/privacyideaapp.wsgi',
'deploy/privacyidea/dictionary']),
('share/man/man1', get_man_pages("tools")),
('lib/privacyidea/migrations',
["migrations/alembic.ini",
"migrations/env.py",
"migrations/README",
"migrations/script.py.mako"]),
('lib/privacyidea/migrations/versions',
get_file_list("migrations/versions/")),
('lib/privacyidea/', ['requirements.txt'])
],
classifiers=["Framework :: Flask",
"License :: OSI Approved :: "
"GNU Affero General Public License v3",
"Programming Language :: Python",
"Development Status :: 5 - Production/Stable",
"Topic :: Internet",
"Topic :: Security",
"Topic :: System ::"
" Systems Administration :: Authentication/Directory",
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12'
],
zip_safe=False,
long_description=get_file_contents('README.rst')
)