-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
79 lines (62 loc) · 2.12 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
import os
import time
import setuptools
from setuptools.command.install import install
# from stealthchromedriver import (
# __version__,
# __title__,
# __author__,
# __description__,
# __long_description__,
# )
with open('./stealthchromedriver/__meta__.py') as fp:
exec(fp.read())
class InstallWrapper(install):
@staticmethod
def install_package(name):
try:
from pip import main as pipmain
except ImportError:
from pip._internal import main as pipmain
pipmain(['install', name])
@staticmethod
def _post_install():
InstallWrapper.install_package('tqdm')
time.sleep(3)
InstallWrapper._post_install_2()
@staticmethod
def _post_install_2():
from stealthchromedriver._util import _check_binaries_exist
from distutils.sysconfig import get_python_lib
lib_path = get_python_lib()
package_path = os.path.join(lib_path, __title__)
check_path = os.path.join(package_path, 'bin')
print(''
'check path:', check_path)
_check_binaries_exist(check_path)
def run(self):
# Run the standard PyPi copy
install.run(self)
# run custom actions for site-packages/yourlibname/path
self._post_install()
setuptools.setup(
name=__title__,
version=__version__,
description=__description__,
long_description=__long_description__,
author=__author__,
author_email="[email protected]",
url="https://github.com/ultrafunkamsterdam/" + __title__,
packages=setuptools.find_packages(),
install_requires=["tqdm","selenium"],
license="MIT",
cmdclass={"install":InstallWrapper},
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
)