Skip to content

Commit fbce67d

Browse files
committed
Merge pull request html5lib#263 from gsnedders/fix_setuptools_fun
Try dealing with the backwards incompatible changes in setuptools again; r=nobody!
2 parents 5197f55 + c562f28 commit fbce67d

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

requirements-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if [[ $USE_OPTIONAL != "true" && $USE_OPTIONAL != "false" ]]; then
66
fi
77

88
# Make sure we're running setuptools >= 18.5
9-
pip install -U pip setuptools
9+
pip install -U pip setuptools>=18.5
1010

1111
pip install -U -r requirements-test.txt
1212

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
six
22
webencodings
33
ordereddict ; python_version < '2.7'
4+
setuptools>=18.5

setup.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
from __future__ import print_function
2+
13
import ast
24
import codecs
5+
import sys
36

47
from os.path import join, dirname
5-
from setuptools import setup, find_packages
8+
from setuptools import setup, find_packages, __version__ as setuptools_version
9+
from pkg_resources import parse_version
610

11+
if parse_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)
715

816
classifiers = [
917
'Development Status :: 5 - Production/Stable',
@@ -28,7 +36,7 @@
2836
long_description = readme_file.read() + '\n' + changes_file.read()
2937

3038
version = None
31-
with open(join("html5lib", "__init__.py"), "rb") as init_file:
39+
with open(join(here, "html5lib", "__init__.py"), "rb") as init_file:
3240
t = ast.parse(init_file.read(), filename="__init__.py", mode="exec")
3341
assert isinstance(t, ast.Module)
3442
assignments = filter(lambda x: isinstance(x, ast.Assign), t.body)
@@ -52,6 +60,7 @@
5260
install_requires=[
5361
'six',
5462
'webencodings',
63+
'setuptools>=18.5'
5564
],
5665
extras_require={
5766
# A empty extra that only has a conditional marker will be
@@ -60,8 +69,8 @@
6069

6170
# A conditional extra will only install these items when the extra is
6271
# 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"],
6574

6675
# Standard extras, will be installed when the extra is requested.
6776
"genshi": ["genshi"],
@@ -72,6 +81,6 @@
7281
# extra that will be installed whenever the condition matches and the
7382
# all extra is requested.
7483
"all": ["genshi", "chardet>=2.2"],
75-
"all:platform.python_implementation == 'CPython'": ["datrie", "lxml"],
84+
"all:platform_python_implementation == 'CPython'": ["datrie", "lxml"],
7685
},
7786
)

0 commit comments

Comments
 (0)