Pandas version advanced starting in Jan 2021: numpy is now incompatible

I am very much a TravisCI beginner. That said, I maintain python package mplfinance and run a TravisCI test suite for every Pull Request for Py36, 37 and 38. Beginning in January 2021, the Py37 tests began failing consistently with the error:

ERROR: pandas 1.2.0 has requirement numpy>=1.16.5, but you'll have numpy 1.16.4 which is incompatible.

Here’s the thing: For each PR, we run a script that individually checks out and installs the package first from the PR, and then from the version currently in the repository, and does some comparison of the two versions. This works fine for py36 and py38, and before January worked fine for Py37. Here is an example of it working fine for Py37 prior to January:

https://travis-ci.org/github/matplotlib/mplfinance/jobs/751128518

In the above link you can see the following

Collecting pandas
  Using cached pandas-1.1.5-cp37-cp37m-manylinux1_x86_64.whl (9.5 MB)
Collecting python-dateutil>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting cycler>=0.10
  Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Requirement already satisfied: numpy>=1.15 in /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages (from matplotlib->mplfinance==0.12.7a4) (1.16.4)

Notice that in installs pandas 1.1.5 and numpy 1.16.4

Beginning in January this is what I see:

Example:
https://travis-ci.org/github/matplotlib/mplfinance/jobs/753110408

Collecting pandas
  Using cached pandas-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (9.9 MB)
Collecting kiwisolver>=1.0.1
  Using cached kiwisolver-1.3.1-cp37-cp37m-manylinux1_x86_64.whl (1.1 MB)
Collecting pillow>=6.2.0
  Using cached Pillow-8.1.0-cp37-cp37m-manylinux1_x86_64.whl (2.2 MB)
Requirement already satisfied: numpy>=1.15 in /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages (from matplotlib->mplfinance==0.12.7a5) (1.16.4)

Now it is installing pandas 1.2.0, and initially it seems satisfied with numpy 1.16.4, but then later in the file I see

ERROR: pandas 1.2.0 has requirement numpy>=1.16.5, but you'll have numpy 1.16.4 which is incompatible.
  • Does anyone have any ideas what I can do about this?

Much appreciated. Thank you.

@native-api
Thanks for the suggestion.

  • “–upgrade-strategy eager” had no effect.
  • " --use-feature=2020-resolver" fails now for both py36 and py37 (my problem was only py37). The failure is now from pip: no such option: --use-feature.
  • How I can make py36 and py37 on TravisCI run the newer version of pip?

I guess you need numpy in the list of requirements.

Upgrade it, duh!

@native-api
duh! … thanks.
added pip install --upgrade pip to the script, and all is well.