This repository has been archived by the owner on Jul 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·81 lines (73 loc) · 2.61 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
#!/usr/bin/env python3
#
# build-utilities
# Copyright (c) 2015, Alexandre ACEBEDO, All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library.
#
"""
Setup script for build-utilities
"""
import sys
import os
from platform import python_version
try:
import versioneer
except Exception as e:
sys.exit("versioneer for python3 is missing")
try:
from setuptools import setup, find_packages
except Exception as e:
sys.exit("setuptools for python3 is missing")
from setuptools.command.install import install
class InstallCommand(install):
user_options = install.user_options + [
('prefix=', None, 'Install prefix pathsomething')
]
def initialize_options(self):
install.initialize_options(self)
self.prefix = None
def finalize_options(self):
#print('The custom option for install is ', self.custom_option)
install.finalize_options(self)
def run(self):
if self.prefix != None:
os.environ["PYTHONPATH"] = os.path.join(self.prefix,"lib","python{}.{}".format(python_version()[0],python_version()[2]),"site-packages")
install.run(self)
def process_setup():
"""
Setup function
"""
if sys.version_info < (3,0):
sys.exit("build-utilities only supports python3. Please run setup.py with python3.")
cmds = versioneer.get_cmdclass()
cmds["install"] = InstallCommand
setup(
name="build-utilities",
version=versioneer.get_version(),
cmdclass=cmds,
packages=find_packages("src"),
package_dir ={'':'src'},
install_requires=['GitPython>=2.0', 'progressbar2>=2.0.0'],
author="Alexandre ACEBEDO",
author_email="Alexandre ACEBEDO",
description="Build utilities for python and go projects.",
license="LGPLv3",
keywords="build go python",
url="http://github.com/aacebedo/build-utilities",
entry_points={'console_scripts':
['build-utilities = buildutilities.__main__:BuildUtilities.main']}
)
if __name__ == "__main__":
process_setup()