-
Notifications
You must be signed in to change notification settings - Fork 272
/
setup.py
executable file
·60 lines (56 loc) · 1.81 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
#!/usr/bin/env python
import os
import platform
from setuptools import setup, find_packages
from setuptools.extension import Extension
USE_CYTHON = 'CYTHONIZE' in os.environ
IS_PYPY = platform.python_implementation() == 'PyPy'
ext = '.pyx' if USE_CYTHON else '.c'
try:
import numpy as np
include_dirs = [np.get_include()]
except ImportError:
include_dirs = []
extensions = [
Extension("scrapely._htmlpage",
["scrapely/_htmlpage%s" % ext],
include_dirs=include_dirs),
Extension("scrapely.extraction._similarity",
["scrapely/extraction/_similarity%s" % ext],
include_dirs=include_dirs),
]
if USE_CYTHON and not IS_PYPY:
from Cython.Build import cythonize
extensions = cythonize(extensions)
if IS_PYPY:
extensions = []
setup(
name='scrapely',
version='0.13.5',
license='BSD',
description='A pure-python HTML screen-scraping library',
author='Scrapy project',
author_email='info@scrapy.org',
url='https://github.com/scrapy/scrapely',
packages=find_packages(exclude=['tests', 'tests.*']),
include_package_data=True,
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Text Processing :: Markup :: HTML',
],
install_requires=['numpy', 'w3lib', 'six'],
extras_require={
'speedup': ['cython']
},
ext_modules=extensions,
)