88from packaging .version import Version
99
1010
11+ HEADERS = {
12+ "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
13+ }
14+
15+
1116def get_min_python_version ():
1217 """
1318 Find the minimum version of Python supported (i.e., not end-of-life)
1419 """
1520 min_python = (
16- pd .read_html ("https://devguide.python.org/versions/" )[0 ].iloc [- 1 ].Branch
21+ pd .read_html (
22+ "https://devguide.python.org/versions/" ,
23+ storage_options = HEADERS ,
24+ )[0 ]
25+ .iloc [- 1 ]
26+ .Branch
1727 )
1828 return min_python
1929
@@ -25,7 +35,8 @@ def get_min_numba_numpy_version(min_python):
2535 """
2636 df = (
2737 pd .read_html (
28- "https://numba.readthedocs.io/en/stable/user/installing.html#version-support-information" # noqa
38+ "https://numba.readthedocs.io/en/stable/user/installing.html#version-support-information" , # noqa
39+ storage_options = HEADERS ,
2940 )[0 ]
3041 .dropna ()
3142 .drop (columns = ["Numba.1" , "llvmlite" , "LLVM" , "TBB" ])
@@ -81,12 +92,14 @@ def get_min_scipy_version(min_python, min_numpy):
8192 Determine the SciPy version compatibility
8293 """
8394 colnames = pd .read_html (
84- "https://docs.scipy.org/doc/scipy/dev/toolchain.html#numpy"
95+ "https://docs.scipy.org/doc/scipy/dev/toolchain.html#numpy" ,
96+ storage_options = HEADERS ,
8597 )[1 ].columns
8698 converter = {colname : str for colname in colnames }
8799 df = (
88100 pd .read_html (
89101 "https://docs.scipy.org/doc/scipy/dev/toolchain.html#numpy" ,
102+ storage_options = HEADERS ,
90103 converters = converter ,
91104 )[1 ]
92105 .rename (columns = lambda x : x .replace (" " , "_" ))
0 commit comments