13
13
"bs4" : "4.8.2" ,
14
14
"blosc" : "1.20.1" ,
15
15
"bottleneck" : "1.3.1" ,
16
+ "brotli" : "0.7.0" ,
16
17
"fastparquet" : "0.4.0" ,
17
18
"fsspec" : "0.7.4" ,
18
19
"html5lib" : "1.1" ,
34
35
"pyxlsb" : "1.0.6" ,
35
36
"s3fs" : "0.4.0" ,
36
37
"scipy" : "1.4.1" ,
38
+ "snappy" : "0.6.0" ,
37
39
"sqlalchemy" : "1.4.0" ,
38
40
"tables" : "3.6.1" ,
39
41
"tabulate" : "0.8.7" ,
50
52
INSTALL_MAPPING = {
51
53
"bs4" : "beautifulsoup4" ,
52
54
"bottleneck" : "Bottleneck" ,
55
+ "brotli" : "brotlipy" ,
56
+ "jinja2" : "Jinja2" ,
53
57
"lxml.etree" : "lxml" ,
54
58
"odf" : "odfpy" ,
55
59
"pandas_gbq" : "pandas-gbq" ,
56
- "tables " : "pytables " ,
60
+ "snappy " : "python-snappy " ,
57
61
"sqlalchemy" : "SQLAlchemy" ,
58
- "jinja2 " : "Jinja2 " ,
62
+ "tables " : "pytables " ,
59
63
}
60
64
61
65
@@ -66,6 +70,13 @@ def get_version(module: types.ModuleType) -> str:
66
70
version = getattr (module , "__VERSION__" , None )
67
71
68
72
if version is None :
73
+ if module .__name__ == "brotli" :
74
+ # brotli doesn't contain attributes to confirm it's version
75
+ return ""
76
+ if module .__name__ == "snappy" :
77
+ # snappy doesn't contain attributes to confirm it's version
78
+ # See https://github.com/andrix/python-snappy/pull/119
79
+ return ""
69
80
raise ImportError (f"Can't determine version for { module .__name__ } " )
70
81
if module .__name__ == "psycopg2" :
71
82
# psycopg2 appends " (dt dec pq3 ext lo64)" to it's version
@@ -141,7 +152,7 @@ def import_optional_dependency(
141
152
minimum_version = min_version if min_version is not None else VERSIONS .get (parent )
142
153
if minimum_version :
143
154
version = get_version (module_to_get )
144
- if Version (version ) < Version (minimum_version ):
155
+ if version and Version (version ) < Version (minimum_version ):
145
156
msg = (
146
157
f"Pandas requires version '{ minimum_version } ' or newer of '{ parent } ' "
147
158
f"(version '{ version } ' currently installed)."
0 commit comments