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

Nose with Python 3.10 #154

Closed
skiedude opened this issue Dec 18, 2024 · 3 comments
Closed

Nose with Python 3.10 #154

skiedude opened this issue Dec 18, 2024 · 3 comments

Comments

@skiedude
Copy link

skiedude commented Dec 18, 2024

While looking into the CI failures on linked packs on #153 it appears the python package nose is causing a lot of failures.

While I didn't check all linked packs, of the 4 I checked 2 were failing due to nose on Python 3.10. But I assume every CI testing in Python3.10 using this CI as a base is going to fail for this issue.

https://github.com/StackStorm-Exchange/stackstorm-github/actions/runs/12326010817/job/34406161027#step:6:378
https://github.com/StackStorm-Exchange/stackstorm-terraform/actions/runs/12326013523/job/34406167325#step:6:338

nose uses collections.Callable but in python 3.10 that was moved to collections.abc.Callable which is causing an attribute error AttributeError: module 'collections' has no attribute 'Callable' nose-devs/nose#1122 . Unfortunately nose is also abandoned, so no official fix in this module is going to take place.

pynose https://pypi.org/project/pynose/ looks to be a currently maintained successor. As i'm not familiar with nose at all, I'm not sure if its going to be an easy straight across replacement of package.

However I think a good chunk of the failing CI tests are atleast initially from this issue.

@skiedude
Copy link
Author

skiedude commented Dec 18, 2024

Ok I decided just to try and get it to work with my own fork of the ci repo.

Using this ci fork https://github.com/skiedude/ci/tree/python I had to make a handful of changes to get pynose installed.

I found the following:

  1. all the packages in ci/blob/master/.github/actions/py-dependencies/requirements-pack-tests.txt are being ignored because they don't pin a version ==
  2. I added pynose with a version, which caused it to be installed!
  3. However nose was still being installed. This was a result of the main https://github.com/StackStorm/st2/blob/master/requirements.txt#L36 actually being the location where nose was installed in the CI.
  4. I added a custom step to uninstall nose and force reinstall pynose to get around this temporarily.

With all of the above changes, the CI on stackstorm-github passes on 3.10 (as well as 3.8, 3.9)
StackStorm-Exchange/stackstorm-github#57

Ultimately, updating nose to pynose in the st2/requirements.txt achieves all these work arounds I had to do.

@skiedude
Copy link
Author

And I guess I just have impeccable timing as StackStorm/st2#6291 was just opened 🙂

@nzlosh
Copy link
Contributor

nzlosh commented Dec 19, 2024

As per #6291, there's already been work to move to pytest as the preferred testing framework but thank you for taking the initiative to look into this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants