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.phik: init at 0.9.8 #71248

Merged
merged 1 commit into from Oct 21, 2019
Merged

pythonPackages.phik: init at 0.9.8 #71248

merged 1 commit into from Oct 21, 2019

Conversation

melsigl
Copy link
Member

@melsigl melsigl commented Oct 16, 2019

Motivation for this change

Phi_K is a new and practical correlation coefficient based on several refinements to Pearson’s hypothesis test of independence of two variables.

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 nix-review --run "nix-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.

meta = with lib; {
description = "Phi_K is a new and practical correlation coefficient based on several refinements to Pearson’s hypothesis test of independence of two variables.";
homepage = https://phik.readthedocs.io/en/latest/;
maintainers = with lib.maintainers; [ melsigl ];
Copy link
Contributor

Choose a reason for hiding this comment

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

You should probably specify the license: license = lib.licenses.asl20;

Copy link
Member

Choose a reason for hiding this comment

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

Or license = licenses.asl20 because of the with lib; above.

meta = with lib; {
description = "Phi_K is a new and practical correlation coefficient based on several refinements to Pearson’s hypothesis test of independence of two variables.";
homepage = https://phik.readthedocs.io/en/latest/;
maintainers = with lib.maintainers; [ melsigl ];
Copy link
Member

Choose a reason for hiding this comment

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

Or license = licenses.asl20 because of the with lib; above.

pkgs/development/python-modules/phik/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Show resolved Hide resolved
};

propagatedBuildInputs = [
nbconvert
Copy link
Contributor

Choose a reason for hiding this comment

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

These can probably be made buildInputs instead of propagatedBuildInputs. Really I don't think they should be needed at all, since they're seem to be just for the tests which aren't being run, but I think there is a mistake in the setup.py (I think this line shouldn't exist: https://github.com/KaveIO/PhiK/blob/v0.9.8/setup.py#L47) which makes them necessary. Maybe also add jupyter_client and pytest as buildInputs.

Maybe someone more experienced has opinions on whether the 'mistake' I mentioned should be patched out/fixed upstream, or if it's fine as is?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, #71248 (comment) works so put them (nbconvert and pytest-pylint) in checkInputs, not buildInputs. I'm still convinced the setup.py is mistaken, but it shouldn't matter too much.

pkgs/development/python-modules/phik/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/phik/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/phik/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/phik/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Show resolved Hide resolved
phases = [ "unpackPhase" "installPhase" ];

meta = with lib; {
description = "Phi_K is a new and practical correlation coefficient based on several refinements to Pearson’s hypothesis test of independence of two variables.";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is quite a long description so should probably be the longDescription, and the description can just be "Phi_K correlation analyzer library"

pytest-pylint
];

buildInputs = [
Copy link
Contributor

Choose a reason for hiding this comment

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

I got a bit muddled in my comment that suggested making these buildInputs - these two should be checkInputs actually.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be indeed buildInputs.

@melsigl melsigl force-pushed the master branch 2 times, most recently from 8cdef48 to a3b53db Compare October 17, 2019 21:17
Copy link
Contributor

@acairncross acairncross left a comment

Choose a reason for hiding this comment

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

Looks great!

@acairncross
Copy link
Contributor

Actually, one more thing: the bin directory of the result contains a script called phik_trial which seems to be the way to run the tests, but I don't know how to get it to work and we don't really want it installed anyway (ideally it could be run in the checkPhase or something). You could add a

postInstall = ''
  rm -r $out/bin
'';

to remove it.

@risicle
Copy link
Contributor

risicle commented Oct 20, 2019

nix-review is happy, macos 10.13.

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.

nix-review passes on NixOS
diff LGTM
outputs LGTM

[2 built (4 failed), 1 copied (0.0 MiB), 0.0 MiB DL]
error: build of '/nix/store/n3yxi36yqgp6inwdd11rw7072axfqibd-env.drv' failed
https://github.com/NixOS/nixpkgs/pull/71248
1 package failed to build:
python38Packages.phik

1 package were build:
python37Packages.phik
[nix-shell:/home/jon/.cache/nix-review/pr-71248]$ python
Python 3.7.4 (default, Jul  8 2019, 18:31:06)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import phik
>>>

@jonringer jonringer merged commit 91d5b3f into NixOS:master Oct 21, 2019
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

5 participants