matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

six 1.16 is not permitted

iamthad opened this issue · comments

six version 1.16 was released 2021-05-05: https://github.com/benjaminp/six/releases/tag/1.16.0

The basemap package does not permit this version:

six >= 1.10, < 1.16

Is there a reason this version is incompatible, or can the requirements.txt be updated to allow it?

As far as I know, there should be no incompatibilities. I normally set upper pins just as a precaution, i.e. to be sure that a possible broken release in the dependencies is not propagated to the library (when installing).

In this case with six, I just forgot to increase the upper pin at some point, but it should be safe to increase it (six is quite reliable, e.g. it defines python_requires properly).

I was reviewing a bit further, and in fact six is only used inside the basemap.cm module to import iteritems:

Later, this iteritems is used to loop over the contents of the colormap dictionaries stored in the same file. Based on how small these dictionaries are, I think that it could be possible to simply use dict.items below and remove the dependency on six:

for key,val in iteritems(data):

@iamthad After some minor refactoring of matplotlib.cm, the six module is not required anymore as a dependency. Therefore, in the next patch release basemap will not be limiting other packages that try to install the newer six version.