-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
124 lines (108 loc) · 3.76 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
"""
:Author: Daniel Mohr
:Email: daniel.mohr@dlr.de
:Date: 2022-05-25
:License: GNU GENERAL PUBLIC LICENSE, Version 2, June 1991.
"""
from distutils.core import Command, setup
class CheckModules(Command):
"""
:Author: Daniel Mohr
:Email: daniel.mohr@gmx.de
:Date: 2017-01-08
:License: GNU GENERAL PUBLIC LICENSE, Version 2, June 1991.
checking for modules need to run the software
"""
description = "checking for modules need to run the software"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
# pylint: disable=bad-option-value,import-outside-toplevel
import importlib
summary = ""
i = 0
print("checking for modules need to run the software (scripts and")
print("modules/packages) of this package:\n")
print("checking for the modules mentioned in the 'setup.py':")
for module in self.distribution.metadata.get_requires():
if self.verbose:
print("try to load %s" % module)
try:
importlib.import_module(module)
if self.verbose:
print(" loaded.")
except ImportError:
i += 1
summary += "module '%s' is not available\n" % module
print("module '%s' is not available <---WARNING---" % module)
print(
"\nSummary\n%d modules are not available (not unique)\n%s\n" % (
i, summary))
class CheckModulesModulefinder(Command):
"""
:Author: Daniel Mohr
:Email: daniel.mohr@gmx.de
:Date: 2017-01-08
:License: GNU GENERAL PUBLIC LICENSE, Version 2, June 1991.
checking for modules need to run the scripts (modulefinder)
"""
description = "checking for modules need to run the scripts (modulefinder)"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
# pylint: disable=bad-option-value,import-outside-toplevel
import modulefinder
for script in self.distribution.scripts:
print("\nchecking for modules used in '%s':" % script)
finder = modulefinder.ModuleFinder()
finder.run_script(script)
finder.report()
# necessary modules
REQUIRED_MODULES = [
'cgi',
'os',
'subprocess',
'sys',
'tempfile',
]
setup(
name='gitolite_web_interface',
version='2022.05.25',
cmdclass={
'check_modules': CheckModules,
'check_modules_modulefinder': CheckModulesModulefinder,
},
description='gitolite_web_interface should give the possibility to add '
'ssh keys over http on a gitolite installation.',
long_description='',
keywords='ssh key git gitolite http sskm',
author='Daniel Mohr',
author_email='daniel.mohr@dlr.de',
maintainer='Daniel Mohr',
maintainer_email='daniel.mohr@dlr.de',
url='https://github.com/dlr-pa/gitolite_web_interface',
download_url='https://github.com/dlr-pa/gitolite_web_interface',
packages=['gitolite_web_interface_mod'],
license='GNU GENERAL PUBLIC LICENSE, Version 2, June 1991',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Internet',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Site Management',
'Topic :: Scientific/Engineering'
],
requires=REQUIRED_MODULES
)