Commit 5a027f0
committed
Allow setup.py/pip to run query commands without importing numpy.
pip downloads and queries packages before building them. If you are
running in a clean environment (e.g. a virtualenv) then numpy may not be
installed, and the query command (egg_info) could fail saying that numpy
cannot be imported. Solution is to check whether command is a query
and only import numpy if it is not. Idea taken from similar commit in
netcdf-python:
Unidata/netcdf4-python@18f21a2
Should allow pip to install basemap from a requirements.txt file.
Bonus, add requirements for numpy>=1.2.1 and matplotlib>=1.0.0,
both taken from the basemap docs.1 parent ee6a2f7 commit 5a027f0
1 file changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
8 | 23 | | |
9 | 24 | | |
10 | 25 | | |
| |||
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
65 | | - | |
| 80 | + | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
| |||
130 | 145 | | |
131 | 146 | | |
132 | 147 | | |
| 148 | + | |
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
| |||
0 commit comments