-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
124 lines (112 loc) · 3.25 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Scrapfly SAS and Contributors. All Rights Reserved.
# Johann Saunier <johann@scrapfly.io>
#
# Licensed under the BSD 2-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may obtain a copy of the
# License at https://opensource.org/licenses/BSD-2-Clause
import pathlib
import re
import sys
from setuptools import find_packages, setup
if sys.version_info < (3, 6):
raise RuntimeError("Scrapfly SDK requires Python 3.6+")
HERE = pathlib.Path(__file__).parent
MODULE = 'scrapfly'
PACKAGE = 'scrapfly-sdk'
txt = (HERE / MODULE / '__init__.py').read_text('utf-8')
try:
version = re.findall(r"^__version__ = '([^']+)'\r?$", txt, re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')
install_requires = [
'decorator>=4.2.0',
'requests>=2.25.0',
'python-dateutil>=2.1,<3.0.0',
'loguru>=0.5',
'urllib3>=1.26.0',
'backoff>=1.10.0'
]
def read(f):
return (HERE / f).read_text('utf-8').strip()
EXTRA_DEPENDENCIES = {
'develop': [
'bumpversion',
'isort',
'readme_renderer',
'twine',
'setuptools',
'wheel',
'pdoc3'
],
'deploy': [
'bumpversion',
'isort',
'readme_renderer',
'twine',
'setuptools',
'wheel',
'pdoc3',
'pip',
'colorama',
'sentry-sdk'
],
'scrapy': [
'scrapy>=2.4.0'
],
'parser': [
'lxml',
'beautifulsoup4',
'soupsieve',
'extruct'
],
'speedups': [
'brotlipy',
'msgpack'
],
'concurrency': []
}
all_deps = set()
for env, deps in EXTRA_DEPENDENCIES.items():
if env == 'develop': continue
[all_deps.add(dep) for dep in deps]
EXTRA_DEPENDENCIES['all'] = list(all_deps)
print(EXTRA_DEPENDENCIES)
setup(
name=PACKAGE,
version=version,
description='Scrapfly SDK for Scrapfly',
keywords=['scraping', 'web scraping', 'data', 'extraction', 'scrapfly', 'sdk', 'cloud', 'scrapy'],
author='Scrapfly',
author_email='tech@scrapfly.io',
license='BSD',
url='https://github.com/scrapfly/python-sdk',
long_description=read('README.md'),
long_description_content_type="text/markdown",
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet'
],
project_urls={
'Company': 'https://scrapfly.io',
'Documentation': 'https://scrapfly.io/docs',
'Source': 'https://github.com/scrapfly/python-sdk',
},
packages=find_packages(),
python_requires='>=3.6',
install_requires=install_requires,
extras_require=EXTRA_DEPENDENCIES,
include_package_data=True,
)