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

python3.pkgs.nose: Fix nosetests distutils command #332225

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Aug 4, 2024

Description of changes

For some reason, entry-points were not installed breaking setup.py nosetests. Since this is a dead project and I only need it to migrate away from it, let’s write the entry points manually.

Additionally, it was using inspect.getargspec, which was removed in Python 3.6.1. Let’s apply an umerged upstream patch to use inspect.signature from Python 3.3 instead. I have removed the fallback branches from the patch since we do not need to support Python < 3.3.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

For some reason, entry-points were not installed breaking `setup.py nosetests`.
Since this is a dead project and I only need it to migrate away from it,
let’s write the entry points manually.

Additionally, it was using `inspect.getargspec`, which was removed in Python 3.6.1.
Let’s apply an umerged upstream patch to use `inspect.signature` from Python 3.3 instead.
I have removed the fallback branches from the patch since we do not need to support Python < 3.3.
@emilazy
Copy link
Member

emilazy commented Aug 4, 2024

The compatibility patch looks fine, but is there a reason you need setup.py nosetests specifically rather than just running nosetests directly? #331159 is going to break setup.py test next staging cycle, and we’re working on getting rid of nose anyway, so I’m not sure if we want to put much effort into fixing it up. That said, it shouldn’t hurt anything, so if you need it to migrate that’s fine by me. There’s a nose2pytest package now that you may find useful.

@jtojnar
Copy link
Member Author

jtojnar commented Aug 4, 2024

I am trying to port mypaint to pytest as per #331159 and noticed it still uses nose for doctests so I decided to tackle that first.

MyPaint uses slightly peculiar project structure (including SWIG-generated Python bindings for libmypaint) and for some reason, running nosetests directly is not able to find some _mypaintlib.

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

Successfully merging this pull request may close these issues.

2 participants