Package: rdflib / 4.2.1-2

html5lib-required-only-for-testing.patch Patch series | download
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
Subject: Demote html5lib to from install_requires to tests_require
Author: chrysn <chrysn@fsfe.org>

html5lib is already in install_requires in Python 3, and has no reason to be
fully required in Python 2.

Forwarded: https://github.com/RDFLib/rdflib/pull/675

--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,8 @@
     kwargs['tests_require'] = ['html5lib', 'networkx']
     kwargs['requires'] = [
         'isodate', 'pyparsing',
-        'SPARQLWrapper']
+        ]
+    html5lib = 'html5lib'
     kwargs['src_root'] = setup_python3()
     assert setup
 else:
@@ -52,7 +53,7 @@
         kwargs['test_suite'] = "nose.collector"
         kwargs['install_requires'] = [
             'isodate',
-            'pyparsing', 'SPARQLWrapper']
+            'pyparsing']
         kwargs['tests_require'] = ['networkx']
 
         if sys.version_info[1]<7:  # Python 2.6
@@ -60,13 +61,18 @@
         if sys.version_info[1]<6:  # Python 2.5
             kwargs['install_requires'].append('pyparsing<=1.5.7')
             kwargs['install_requires'].append('simplejson')
-            kwargs['install_requires'].append('html5lib==0.95')
+            html5lib = 'html5lib==0.95'
         else:
-            kwargs['install_requires'].append('html5lib')
+            html5lib = 'html5lib'
 
     except ImportError:
         from distutils.core import setup
+        html5lib = None
 
+if html5lib is not None: # ie. we're not using the simplified distutils setup
+    kwargs['extras_require'] = {'sparql': ['SPARQLWrapper'], 'html': [html5lib]}
+    kwargs['tests_require'].append('SPARQLWrapper')
+    kwargs['tests_require'].append(html5lib)