rossant / ipycache

Defines a %%cache cell magic in the IPython notebook to cache results of long-lasting computations in a persistent pickle file
BSD 3-Clause "New" or "Revised" License
138 stars 35 forks source link

Replace deprecated, unmaintained `nose` with another solution #61

Closed mbrukman closed 2 years ago

mbrukman commented 2 years ago

As noted in our GitHub Actions config, we had to exclude Python 3.10 and 3.11 due to nose incompatibility that will not be fixed, so we need to migrate to another option (nose2 or pytest):

https://github.com/rossant/ipycache/blob/ca8a1fb2feb05c85997e3e03eb37fdf70eecdbc0/.github/workflows/master.yml#L16-L23

However, nosetests appears to have been removed in the GitHub Actions images for Ubuntu and macOS, as evidenced by this failure with Python 3.8 on ubuntu-18.04:

Run nosetests
/home/runner/work/_temp/1b158be5-bebc-467e-a8c7-2491044116ae.sh: line 1: nosetests: command not found
Error: Process completed with exit code 127.

We see similar failures with Python (3.8, 3.9) on Ubuntu (18.04, 20.04) and macOS (10.15, 11).

Although we can probably quick-fix this with pip install nose or adding it to test_requirements.txt, we might as well use this opportunity to instead migrate to a newer tool to enable us to test with newer Python versions as well.

jakirkham commented 2 years ago

pytest is also used by a lot of projects. Maybe another option to consider. This doc on migrating from nose may help

mbrukman commented 2 years ago

Thanks, @jakirkham! Will take a look at this later; right now, just trying to do a quick fix in https://github.com/rossant/ipycache/issues/63 so that we can unblock the license clarification fix.

mbrukman commented 2 years ago

@jakirkham — I looked at the tests, and it seemed much easier to port them to Python standard library unittest (which I'm very familiar with) than to rewrite using either nose2 or pytest. This also lets us remove an extra test dependency, which will (hopefully) speed up our automated testing pipeline as well. I'll submit a PR shortly to fix this.