-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·55 lines (45 loc) · 1.35 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
#!/usr/bin/env python3
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
VERSION: str = "0.1"
class GitLabInstallCommand(install):
"""
Customized install command, which allows us to generate a man page
"""
def run(self):
install.run(self)
help2man_found = False
try:
subprocess.check_call(["which", "help2man"])
help2man_found = True
except subprocess.CalledProcessError:
help2man_found = False
if help2man_found:
print("Found optional dependency help2man - generating man page")
subprocess.call(
[
"help2man",
"--no-info",
"--version-string={}".format(VERSION),
"./git-lab.py",
"--output",
"/usr/local/share/man/man1/git-lab.1",
]
)
else:
print("Could not find optional dependency help2man - not generating a man page")
setup(
name="lab",
version=VERSION,
packages=find_packages(),
cmdclass={
"install": GitLabInstallCommand,
},
entry_points={
"console_scripts": [
"git-lab = lab:main",
]
},
install_requires=open("requirements.txt").readlines(),
)