File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -241,15 +241,23 @@ def get_latest_scipy_python_version():
241241 """
242242 Retrieve the latest Python version that is supported by SciPy
243243 """
244+ python_version = get_latest_pkg_python_version ("scipy" )
245+ return f"<={ python_version } "
246+
247+
248+ def get_latest_pkg_python_version (pkg ):
249+ """
250+ Retrieve the latest Python version that is supported by <pkg>
251+ """
244252 python_versions = []
245- response = _get_pypi_json ("scipy" )
253+ response = _get_pypi_json (pkg )
246254 for classifier in response .get ("info" ).get ("classifiers" ):
247255 if "Python" in classifier :
248256 match = re .search (r"Python\s+\:\:\s+(\d+\.\d+)" , classifier )
249257 if match is not None :
250258 python_versions .append (match .groups ()[0 ])
251259 python_version = sorted (python_versions , key = Version )[- 1 ]
252- return f"<= { python_version } "
260+ return python_version
253261
254262
255263def _get_pypi_json (pkg ):
You can’t perform that action at this time.
0 commit comments