|
| 1 | +from __future__importprint_function |
| 2 | + |
1 | 3 | importast
|
2 | 4 | importcodecs
|
| 5 | +importsys |
3 | 6 |
|
4 | 7 | fromos.pathimportjoin,dirname
|
5 |
| -fromsetuptoolsimportsetup,find_packages |
| 8 | +fromsetuptoolsimportsetup,find_packages,__version__assetuptools_version |
| 9 | +frompkg_resourcesimportparse_version |
6 | 10 |
|
| 11 | +ifparse_version(setuptools_version)<parse_version("18.5"): |
| 12 | +print("html5lib requires setuptools version 18.5 or above; " |
| 13 | +"please upgrade before installing (you have %s)"%setuptools_version) |
| 14 | +sys.exit(1) |
7 | 15 |
|
8 | 16 | classifiers= [
|
9 | 17 | 'Development Status :: 5 - Production/Stable',
|
|
28 | 36 | long_description=readme_file.read()+'\n'+changes_file.read()
|
29 | 37 |
|
30 | 38 | version=None
|
31 |
| -withopen(join("html5lib","__init__.py"),"rb")asinit_file: |
| 39 | +withopen(join(here,"html5lib","__init__.py"),"rb")asinit_file: |
32 | 40 | t=ast.parse(init_file.read(),filename="__init__.py",mode="exec")
|
33 | 41 | assertisinstance(t,ast.Module)
|
34 | 42 | assignments=filter(lambdax:isinstance(x,ast.Assign),t.body)
|
|
52 | 60 | install_requires=[
|
53 | 61 | 'six',
|
54 | 62 | 'webencodings',
|
| 63 | +'setuptools>=18.5' |
55 | 64 | ],
|
56 | 65 | extras_require={
|
57 | 66 | # A empty extra that only has a conditional marker will be
|
|
60 | 69 |
|
61 | 70 | # A conditional extra will only install these items when the extra is
|
62 | 71 | # requested and the condition matches.
|
63 |
| -"datrie:platform.python_implementation == 'CPython'": ["datrie"], |
64 |
| -"lxml:platform.python_implementation == 'CPython'": ["lxml"], |
| 72 | +"datrie:platform_python_implementation == 'CPython'": ["datrie"], |
| 73 | +"lxml:platform_python_implementation == 'CPython'": ["lxml"], |
65 | 74 |
|
66 | 75 | # Standard extras, will be installed when the extra is requested.
|
67 | 76 | "genshi": ["genshi"],
|
|
72 | 81 | # extra that will be installed whenever the condition matches and the
|
73 | 82 | # all extra is requested.
|
74 | 83 | "all": ["genshi","chardet>=2.2"],
|
75 |
| -"all:platform.python_implementation == 'CPython'": ["datrie","lxml"], |
| 84 | +"all:platform_python_implementation == 'CPython'": ["datrie","lxml"], |
76 | 85 | },
|
77 | 86 | )
|