Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated, unmaintained nose with another solution #61

Closed
mbrukman opened this issue Jan 14, 2022 · 3 comments · Fixed by #66
Closed

Replace deprecated, unmaintained nose with another solution #61

mbrukman opened this issue Jan 14, 2022 · 3 comments · Fixed by #66
Assignees
Milestone

Comments

@mbrukman
Copy link
Collaborator

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):

# Tests running via `nosetests` on Python 3.10 fail with the error:
#
# "AttributeError: module 'collections' has no attribute 'Callable'"
#
# Per https://github.com/nose-devs/nose/issues/1099, nose is no longer
# maintained and so this will not be fixed; we need to migrate to either
# nose2 or pytest, per the discussion on the above issue.
python: [ '3.7', '3.8', '3.9' ]

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.

@mbrukman mbrukman self-assigned this Jan 14, 2022
mbrukman added a commit to mbrukman/ipycache that referenced this issue Jan 14, 2022
As described in [this issue][1] and [our CI config][2], `nose` is deprecated and
unmaintained, and incompatible with Python 3.10 and 3.11, and we need to upgrade
to `nose2` or another solution. We're choosing `nose2` since it's closest to
`nose`, so unless there are critical issues with `nose2` and this codebase, we
should be fine with that approach for now.

Closes rossant#61

[1]: rossant#61
[2]: https://github.com/rossant/ipycache/blob/ca8a1fb2feb05c85997e3e03eb37fdf70eecdbc0/.github/workflows/master.yml#L16-L23
@jakirkham
Copy link

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

@mbrukman
Copy link
Collaborator Author

Thanks, @jakirkham! Will take a look at this later; right now, just trying to do a quick fix in #63 so that we can unblock the license clarification fix.

mbrukman added a commit to mbrukman/ipycache that referenced this issue Jan 16, 2022
This lets us drop the dependency on the deprecated `nose` library and use the
Python standard library `unittest`. Since we don't use any advanced
functionality, and the `unittest` library is sufficient for our use cases, this
means we can remove the dependency on `nose` without introducing a new
dependency on either `nose2` or `pytest`.

Closes rossant#61
@mbrukman
Copy link
Collaborator Author

@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.

mbrukman added a commit to mbrukman/ipycache that referenced this issue Jan 16, 2022
This lets us drop the dependency on the deprecated `nose` library and use the
Python standard library `unittest`. Since we don't use any advanced
functionality, and the `unittest` library is sufficient for our use cases, this
means we can remove the dependency on `nose` without introducing a new
dependency on either `nose2` or `pytest`.

Closes rossant#61
mbrukman added a commit to mbrukman/ipycache that referenced this issue Jan 16, 2022
This lets us drop the dependency on the deprecated `nose` library and use the
Python standard library `unittest`. Since we don't use any advanced
functionality, and the `unittest` library is sufficient for our use cases, this
means we can remove the dependency on `nose` without introducing a new
dependency on either `nose2` or `pytest`.

Drop test dependency on `nose` since we no longer need it.

Change the test runner command from `nosetests` to `python -m unittest`.

Closes rossant#61
mbrukman added a commit to mbrukman/ipycache that referenced this issue Jan 16, 2022
This lets us drop the dependency on the deprecated `nose` library and use the
Python standard library `unittest`. Since we don't use any advanced
functionality, and the `unittest` library is sufficient for our use cases, this
means we can remove the dependency on `nose` without introducing a new
dependency on either `nose2` or `pytest`.

Drop test dependency on `nose` since we no longer need it.

Change the test runner command from `nosetests` to `python -m unittest`.

Closes rossant#61
@mbrukman mbrukman added this to the Release 0.1.5 milestone Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants