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

pythonPackages.dill: enable tests #78215

Merged
merged 1 commit into from Feb 18, 2020
Merged

Conversation

drewrisinger
Copy link
Contributor

Motivation for this change

Tests in pythonPackages.dill were previously disabled. This enables most of the tests. Some tests were disabled, mostly because I tried to track down the errors and didn't have time to figure them out. Seems to maybe be some pathing/import issues from Nix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jonringer
Copy link
Contributor

honestly, looking at the test suite, the original comment is pretty accurate. The test suite doesn't:

  • use a normal test runner like nose, pytest, or unittest
  • ran in imperative manner
  • few other things as well

I would recommend AGAINST using a test suite for this package, and would probably go so far as to say you shouldn't use this package in production because of it's odd import behavior. For example, the imports begin to create cycles:

ImportError while importing test module '/build/dill-0.3.1.1/tests/test_module.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/blf6jxfx5g36gp0yadm0ykr8h6fmif39-python3.7-dill-0.3.1.1/lib/python3.7/site-packages/dill/__diff.py:226: in _imp
    mod = __import__(*args, **kwds)
tests/test_module.py:11: in <module>
    import test_mixins as module
/nix/store/blf6jxfx5g36gp0yadm0ykr8h6fmif39-python3.7-dill-0.3.1.1/lib/python3.7/site-packages/dill/__diff.py:226: in _imp
    mod = __import__(*args, **kwds)
E   ModuleNotFoundError: No module named 'test_mixins'

@drewrisinger
Copy link
Contributor Author

drewrisinger commented Jan 22, 2020 via email

@jonringer
Copy link
Contributor

hard to say, really hurts this is also an upstream issue.

@jonringer
Copy link
Contributor

if you really want the qiskit package, you could just try to do the version before they made dill required. If you're fine with it being out-of-date of course.

@drewrisinger
Copy link
Contributor Author

@jonringer @FRidh can you approve or reject? Strictly speaking, this PR at least runs SOME tests, even if the tests are messy.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

pkgs/development/python-modules/dill/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/dill/default.nix Outdated Show resolved Hide resolved
@drewrisinger
Copy link
Contributor Author

Incorporated all suggestions. Builds locally.

@drewrisinger
Copy link
Contributor Author

@GrahamcOfBorg build python3Packages.dill python2Packages.dill

@drewrisinger
Copy link
Contributor Author

otherwise LGTM

Thanks for your help!

@drewrisinger
Copy link
Contributor Author

@GrahamcOfBorg build python3Packages.dill

@drewrisinger
Copy link
Contributor Author

Maybe also disable python2 version? looks like build isn't working?

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python3Packages.dill
@GrahamcOfBorg build python38Packages.dill
@GrahamcOfBorg build python2Packages.dill

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please squash commits as well

Disable a few failing tests, see comments for what's failing.
@drewrisinger
Copy link
Contributor Author

@jonringer done

@FRidh FRidh merged commit 29b98e4 into NixOS:master Feb 18, 2020
@drewrisinger drewrisinger deleted the dr-pr-dill-tests branch February 18, 2020 19:11
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.

None yet

3 participants