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.grandalf: init at 0.6 #54403

Merged
merged 1 commit into from Jan 22, 2019
Merged

Conversation

CMCDragonkai
Copy link
Member

Motivation for this change

Required for #49438. This library deals with graphs.

This package has tests, however the tests are not part of the source distribution, so we just need the test dependencies to satisfy the setup.py but we cannot run any tests.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

This issue with pytestrunner being a requirement for the setup script has been discussed by another maintainer here #53599 (comment)

The concensus that came from is we should patch pytestrunner out of setup_requires and into test_require.

If we were to do doCheck = false the checkInputs wouldn't then be added to nativeBuildInputs thusly breaking the build.

Furthermore, you should switch to using fetchFromGitHub to get the tests.

@CMCDragonkai
Copy link
Member Author

@worldofpeace There are so many python packages that just stick pytestrunner into the setup_requires without conditional requirement. Are we suggesting to patch all of them? Or should we tell the pytestrunner author to change their README to always choose conditional requirement.

@worldofpeace
Copy link
Contributor

@worldofpeace There are so many python packages that just stick pytestrunner into the setup_requires without conditional requirement. Are we suggesting to patch all of them?

Certain people, including me, are willing to take things to the point of impracticality 😄

Or should we tell the pytestrunner author to change their README to always choose conditional requirement.

Yes, I feel like this should be done in addition to patching this for now.
We may eventually, to push its adoption, pr the change to people who aren't already doing this.

@CMCDragonkai
Copy link
Member Author

So this is done, and the tests work. I have 2 weird things that I'm confused about here though.

  1. Using fetchFromGithub doesn't appear to change anything unless I change the sha256 hash. Also the sha256 hash is ALOT shorter than the sha256 hashes required by other code. In fact it's 52 characters instead of 64 characters.
  2. The tests don't run automatically and I need to use a custom checkPhase. Is this is because it wasn't configured by the setup.py? And I don't really see what is the point of the pytest-runner package, is it even being used here?

@worldofpeace
Copy link
Contributor

Using fetchFromGithub doesn't appear to change anything unless I change the sha256 hash. Also the sha256 hash is ALOT shorter than the sha256 hashes required by other code. In fact it's 52 characters instead of 64 characters.

That is because it is base32 encoded instead of base16.

The tests don't run automatically and I need to use a custom checkPhase. Is this is because it wasn't configured by the setup.py? And I don't really see what is the point of the pytest-runner package, is it even being used here?

I think it allows you to invoke tests like setup.py pytest and I think most people alias pytest to test which is what we do default in buildPython*. Your checkPhase is fine either way.

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build pythonPackages.grandalf python3Packages.grandalf

@worldofpeace worldofpeace merged commit 5476f59 into NixOS:master Jan 22, 2019
@worldofpeace
Copy link
Contributor

Thanks 😄
On to the next one.

@CMCDragonkai
Copy link
Member Author

Just want to point out that this package is dual licensed under GPL2 and EPL1: https://github.com/bdcht/grandalf/blob/master/LICENSE. So this package should have both licenses added to the license attribute in the meta.

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

4 participants