Skip to content

Commit 1deba2f

Browse files
committed
Exclude pandas installation for Python < 3.7
numpy, a pandas dependency, required Python > 3.7 as of version 1.20.0. Hence, case_sparql_select cannot import pandas in a Python 3.6 environment. This patch adds steps to disable dependency installation and tests for case_sparql_select if Python is detected to be < 3.7.x. As a reminder, Python 3.6 goes EOL on 2021-12-23. By or at that time, 3.6 will be removed from this project. References: * [AC-178] Add website repository's sample runner to CASE-Utilities-Python repository * [PEP-0494] https://www.python.org/dev/peps/pep-0494/#and-beyond-schedule * [numpy 1.20.0] https://pypi.org/project/numpy/1.20.0/ Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent 8d3118e commit 1deba2f

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ case_sparql_select output.html input.sparql input.json [input-2.json ...]
6262
case_sparql_select output.md input.sparql input.json [input-2.json ...]
6363
```
6464

65+
Note that `case_sparql_select` is not guaranteed to function with Pythons below version 3.7.
66+
6567

6668
### `local_uuid`
6769

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ classifiers =
1818
# TODO The constraint on pyparsing can be removed when rdflib Issue #1190 is resolved.
1919
# https://github.com/RDFLib/rdflib/issues/1190
2020
install_requires =
21-
pandas
21+
# Note that numpy (pandas dependency) is only supported in Python >= 3.7.
22+
pandas;python_version>='3.7'
2223
pyparsing < 3.0.0
2324
rdflib-jsonld
2425
requests
@@ -30,4 +31,5 @@ python_requires = >=3.6
3031
console_scripts =
3132
case_file = case_utils.case_file:main
3233
case_sparql_construct = case_utils.case_sparql_construct:main
34+
# Note that numpy (pandas dependency, and pandas is dependency of case_sparql_select) is only supported in Python >= 3.7.
3335
case_sparql_select = case_utils.case_sparql_select:main

tests/Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ all-case_sparql_construct: \
7373

7474
all-case_sparql_select: \
7575
.venv.done.log
76-
$(MAKE) \
77-
--directory case_sparql_select
76+
# Only descend if python>=3.7, due to pandas dependency unsatisfiable in 3.6.x.
77+
# Boolean explanation: sys.exit(False) has exit status 0.
78+
venv/bin/python3 -c 'import sys ; sys.exit(not (sys.version_info < (3, 7)))' \
79+
|| $(MAKE) \
80+
--directory case_sparql_select
7881

7982
# These check calls are provided in preferred run-order.
8083
check: \
@@ -103,9 +106,12 @@ check-case_sparql_construct: \
103106

104107
check-case_sparql_select: \
105108
.venv.done.log
106-
$(MAKE) \
107-
--directory case_sparql_select \
108-
check
109+
# Only descend if python>=3.7, due to pandas dependency unsatisfiable in 3.6.x.
110+
# Boolean explanation: sys.exit(False) has exit status 0.
111+
venv/bin/python3 -c 'import sys ; sys.exit(not (sys.version_info < (3, 7)))' \
112+
|| $(MAKE) \
113+
--directory case_sparql_select \
114+
check
109115

110116
check-isomorphic_diff: \
111117
.venv.done.log

0 commit comments

Comments
 (0)