Skip to content

Commit f6251fa

Browse files
Conditionally required rdflib-jsonld when py < 3.6
Using environment markers in setup.py: https://www.python.org/dev/peps/pep-0508/#environment-markers
1 parent d445d38 commit f6251fa

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# pip install -r requirements.txt
33
lxml
44
requests
5-
rdflib>=6.0.1
5+
rdflib>=6.0.1; python_version>="3.7"
6+
rdflib<6.0.0; python_version<"3.7"
7+
rdflib-jsonld<=0.5.0; python_version<"3.7"
68
pyrdfa3
79
mf2py>=1.1.0
810
six>=1.11

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ def get_version():
3838
packages=find_packages(exclude=['tests',]),
3939
package_data={'extruct': ['VERSION']},
4040
install_requires=['lxml',
41-
'rdflib',
42-
'rdflib-jsonld',
41+
'rdflib<6.0.0;python_version<"3.7"',
42+
'rdflib-jsonld;python_version<"3.7"',
43+
# rdflib 6.x.y (only on 3.7 and up) contains jsonld
44+
'rdflib>=6.0.1;python_version>="3.7"',
4345
'pyrdfa3',
4446
'mf2py',
4547
'w3lib',

0 commit comments

Comments
 (0)