File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 33
44import sys
55
6- from setuptools import setup
6+ from pkg_resources import parse_version
7+ from setuptools import setup , __version__ as setuptools_version
78
89
910with open ('README.rst' ) as readme_file :
1516test_requirements = [
1617]
1718
18- INSTALL_REQUIRES = [
19+ def has_environment_marker_platform_impl_support ():
20+ """Code extracted from 'pytest/setup.py'
21+ https://github.com/pytest-dev/pytest/blob/7538680c/setup.py#L31
22+ The first known release to support environment marker with range operators
23+ it is 18.5, see:
24+ https://setuptools.readthedocs.io/en/latest/history.html#id235
25+ """
26+ return parse_version (setuptools_version ) >= parse_version ('18.5' )
27+
28+ install_requires = [
1929 'w3lib>=1.8.0' ,
2030 'lxml>=2.3' ,
2131 'six>=1.5.2' ,
2232 'cssselect>=0.9'
2333]
34+ extras_require = {}
2435
25- if sys .version_info [0 :2 ] < (3 , 0 ):
26- INSTALL_REQUIRES .append ("functools32" )
36+ if not has_environment_marker_platform_impl_support ():
37+ if sys .version_info [0 :2 ] < (3 , 0 ):
38+ install_requires .append ("functools32" )
39+ else :
40+ extras_require [":python_version<'3.0'" ] = ["functools32" ]
2741
2842setup (
2943 name = 'parsel' ,
3953 package_dir = {'parsel' :
4054 'parsel' },
4155 include_package_data = True ,
42- install_requires = INSTALL_REQUIRES ,
56+ install_requires = install_requires ,
57+ extras_require = extras_require ,
4358 license = "BSD" ,
4459 zip_safe = False ,
4560 keywords = 'parsel' ,
You can’t perform that action at this time.
0 commit comments