forked from miyakogi/pyppeteer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
95 lines (84 loc) · 2.48 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup
import sys
basedir = path.dirname(path.abspath(__file__))
extra_args = {}
if (3, 6) > sys.version_info >= (3, 5):
in_dir = path.join(basedir, 'pyppeteer')
out_dir = path.join(basedir, '.pyppeteer')
packages = ['pyppeteer']
package_dir = {'pyppeteer': '.pyppeteer'}
if not path.exists(out_dir):
if path.exists(in_dir):
try:
from py_backwards.compiler import compile_files
except ImportError:
import subprocess
subprocess.run(
[sys.executable, '-m', 'pip', 'install', 'py-backwards']
)
from py_backwards.compiler import compile_files
target = (sys.version_info[0], sys.version_info[1])
compile_files(in_dir, out_dir, target)
else:
raise Exception('Could not find package directory')
else:
packages = ['pyppeteer']
package_dir = {'pyppeteer': 'pyppeteer'}
readme_file = path.join(basedir, 'README.md')
with open(readme_file) as f:
src = f.read()
try:
from m2r import M2R
readme = M2R()(src)
except ImportError:
readme = src
requirements = [
'pyee<6',
'websockets',
'appdirs',
'urllib3<1.25',
'tqdm'
]
test_requirements = [
'syncer',
'tornado>=5',
]
setup(
name='pyppeteer',
version='0.0.25',
description=('Headless chrome/chromium automation library '
'(unofficial port of puppeteer)'),
long_description=readme,
author="Hiroyuki Takagi",
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/pyppeteer',
packages=packages,
package_dir=package_dir,
include_package_data=True,
install_requires=requirements,
entry_points={
'console_scripts': [
'pyppeteer-install = pyppeteer.command:install',
],
},
license="MIT license",
zip_safe=False,
keywords='pyppeteer',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
python_requires='>=3.5',
test_suite='tests',
tests_require=test_requirements,
**extra_args
)