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.uproot: init at 2.8.23. #39120

Merged
merged 2 commits into from May 16, 2018
Merged

pythonPackages.uproot: init at 2.8.23. #39120

merged 2 commits into from May 16, 2018

Conversation

ktf
Copy link
Contributor

@ktf ktf commented Apr 18, 2018

Motivation for this change

Package uproot is missing from the distribution.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

@@ -1976,6 +1976,11 @@
github = "kristoff3r";
name = "Kristoffer Søholm";
};
ktf = {
Copy link
Member

Choose a reason for hiding this comment

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

separate commit

{lib, fetchFromGitHub, buildPythonPackage, numpy }:

buildPythonPackage rec {
name = "uproot-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

The name attribute is added by buildPython* when pname is added, and should therefore be removed.


meta = with lib; {
homepage = "https://github.com/scikit-hep/uproot";
description = "ROOT I/O in pure Python and Numpy.";
Copy link
Member

Choose a reason for hiding this comment

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

no dot at the end

@FRidh
Copy link
Member

FRidh commented Apr 18, 2018

@GrahamcOfBorg build python3.pkgs.uproot

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: python3.pkgs.uproot

Partial log (click to expand)

Cannot nix-instantiate `python3.pkgs.uproot' because:
error: attribute 'uproot' in selection path 'python3.pkgs.uproot' not found

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: python3.pkgs.uproot

Partial log (click to expand)

Cannot nix-instantiate `python3.pkgs.uproot' because:
�[31;1merror:�[0m attribute 'uproot' in selection path 'python3.pkgs.uproot' not found

@ktf
Copy link
Contributor Author

ktf commented Apr 18, 2018

I think I've addressed all the comments. Can you please check again?

@FRidh
Copy link
Member

FRidh commented Apr 19, 2018

The expression needs to be called from python-packages.nix.

@ktf
Copy link
Contributor Author

ktf commented Apr 19, 2018

done. This is my first real contribution, sorry for being sloppy...

@FRidh
Copy link
Member

FRidh commented Apr 19, 2018

@GrahamcOfBorg build python3.pkgs.uproot

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python3.pkgs.uproot

Partial log (click to expand)

Installing collected packages: uproot
Successfully installed uproot-2.8.16
/build/source
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/nq9lpyzs5zzg5hy3i60v20xsn60mhr6z-python3.6-uproot-2.8.16
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/nq9lpyzs5zzg5hy3i60v20xsn60mhr6z-python3.6-uproot-2.8.16/lib
patching script interpreter paths in /nix/store/nq9lpyzs5zzg5hy3i60v20xsn60mhr6z-python3.6-uproot-2.8.16
checking for references to /build in /nix/store/nq9lpyzs5zzg5hy3i60v20xsn60mhr6z-python3.6-uproot-2.8.16...
/nix/store/nq9lpyzs5zzg5hy3i60v20xsn60mhr6z-python3.6-uproot-2.8.16

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: python3.pkgs.uproot

Partial log (click to expand)

Processing ./uproot-2.8.16-py3-none-any.whl
Requirement already satisfied: numpy in /nix/store/8jcsbs0m9hklh01mmh2ydnhw1mrgsy6i-python3.6-numpy-1.14.2/lib/python3.6/site-packages (from uproot==2.8.16)
Installing collected packages: uproot
Successfully installed uproot-2.8.16
/private/tmp/nix-build-python3.6-uproot-2.8.16.drv-0/source
post-installation fixup
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/0k4xajqzgiy4rahzi5bz69dsg1mq9xv2-python3.6-uproot-2.8.16/lib
patching script interpreter paths in /nix/store/0k4xajqzgiy4rahzi5bz69dsg1mq9xv2-python3.6-uproot-2.8.16
/nix/store/0k4xajqzgiy4rahzi5bz69dsg1mq9xv2-python3.6-uproot-2.8.16

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python3.pkgs.uproot

Partial log (click to expand)

Installing collected packages: uproot
Successfully installed uproot-2.8.16
/build/source
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/l7q8azscxx9y6j3x2rwmd07f3dzz4x1m-python3.6-uproot-2.8.16
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/l7q8azscxx9y6j3x2rwmd07f3dzz4x1m-python3.6-uproot-2.8.16/lib
patching script interpreter paths in /nix/store/l7q8azscxx9y6j3x2rwmd07f3dzz4x1m-python3.6-uproot-2.8.16
checking for references to /build in /nix/store/l7q8azscxx9y6j3x2rwmd07f3dzz4x1m-python3.6-uproot-2.8.16...
/nix/store/l7q8azscxx9y6j3x2rwmd07f3dzz4x1m-python3.6-uproot-2.8.16

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Did you intentionally not include the dependencies listed here?

sha256 = "07f6h7zcvjc4ynqydp12cbq8c6bb8964s1i65cc25py4mg46f4my";
};

# Why does it propagate packages that are used for testing?
Copy link
Member

Choose a reason for hiding this comment

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

numpy is listed in install_requires, you're sure it isn't a runtime dependency?

Choose a reason for hiding this comment

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

You can't do anything sensible in uproot without Numpy. It's an absolute requirement. I hope the setup.py reflects that.

Many of the other libraries that uproot might use are optional, particularly compression codecs that aren't found in all ROOT files.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, setup.py reflects this. But the comment

Why does it propagate packages that are used for testing?

doesn't make sense in that case.

buildPythonPackage rec {
pname = "uproot";
version = "2.8.16";
src = fetchFromGitHub {
Copy link
Member

Choose a reason for hiding this comment

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

Please use fetchPypi instead: https://pypi.org/project/uproot/. This allows easier automatic updating.

doCheck = false;

meta = with lib; {
homepage = "https://github.com/scikit-hep/uproot";
Copy link
Member

Choose a reason for hiding this comment

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

no quotes

numpy
];

#Checks are failing due to missing TTY, which won't exist.
Copy link
Member

Choose a reason for hiding this comment

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

The tests run just fine for me. Can you please check again?

@ktf
Copy link
Contributor Author

ktf commented Apr 26, 2018

I've done the requested changes.

@dotlambda I've tried adding lz4 and lama, however they seem not to be picked up when building. I am using an overlay with the following to test:

uproot = import ../nixpkgs/pkgs/development/python-modules/uproot {
     inherit (self) lib;
     inherit (super.python27.pkgs) fetchPypi;
     inherit (super.python27.pkgs) buildPythonPackage numpy lz4;
     inherit (super) lzma;
};

and I of course added lz4 and lzma to the propagatedBuildInputs. Am I doing something trivially wrong?

@jpivarski
Copy link

If it's Python 3, there might not be an lzma package because that's in the standard library now.

@ktf
Copy link
Contributor Author

ktf commented Apr 26, 2018

@jpivarski in my test it's python2.7. I suspect it's something nix related, actually.

buildPythonPackage rec {
pname = "uproot";
version = "2.8.18";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

drop this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean the name one? If I do I get an error. Am I using a too old version of buildPythonPackage?

Copy link
Member

Choose a reason for hiding this comment

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

buildPython* has been setting name automatically for quite some time. Which error are you getting?

@dotlambda
Copy link
Member

By looking at the code, e.g. https://github.com/scikit-hep/uproot/blob/47b981e6ce0b5913a763d379eae1c0337a898a01/tests/test_compression.py#L34-L41, it should just work when adding the lz4 (and lzma in the case of python 2) python packages to propagatedBuildInputs.

meta = with lib; {
homepage = https://github.com/scikit-hep/uproot;
description = "ROOT I/O in pure Python and Numpy";
license = with licenses; [ bsd3 ];
Copy link
Member

Choose a reason for hiding this comment

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

just licenses.bsd3

@ktf
Copy link
Contributor Author

ktf commented May 15, 2018

I think I've addressed the comments. lz4 / lzma does not work (I get an import error) but that could be something to followup upstream and I'd rather add in a subsequent PR.

@dotlambda
Copy link
Member

@ktf Now what's left to do is naming your second commit (and your PR) pythonPackages.uproot: init at <version>.

@GrahamcOfBorg build python2.pkgs.uproot python3.pkgs.uproot

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python2.pkgs.uproot, python3.pkgs.uproot

Partial log (click to expand)

test_issue74 (tests.test_issues.TestIssues) ... ok
test_issue76 (tests.test_issues.TestIssues) ... ok
test_issue79 (tests.test_issues.TestIssues) ... ok

----------------------------------------------------------------------
Ran 74 tests in 7.619s

OK
/nix/store/pff88w2kvarhm3ysj796g7i7m0cy2l2c-python2.7-uproot-2.8.23
/nix/store/bbf4pavmbjm0ghzsdf7311mqkgbzgyd8-python3.6-uproot-2.8.23

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python2.pkgs.uproot, python3.pkgs.uproot

Partial log (click to expand)

test_irregular_array (tests.test_cache.TestCache) ... ok
test_regular_array (tests.test_cache.TestCache) ... ok
test_strings_array (tests.test_cache.TestCache) ... ok

----------------------------------------------------------------------
Ran 74 tests in 41.814s

OK
/nix/store/h8f1f3vclgm2i3773byd07im6brdw1g4-python2.7-uproot-2.8.23
/nix/store/2an977hpilsm2bh1qvwnh75lqyj1389j-python3.6-uproot-2.8.23

@ktf ktf changed the title Add uproot python package pythonPackages.uproot: init at 2.8.23. May 15, 2018
@ktf
Copy link
Contributor Author

ktf commented May 16, 2018

@dotlambda done.

@dotlambda
Copy link
Member

Thanks a lot!

@dotlambda dotlambda merged commit 40edf5e into NixOS:master May 16, 2018
@ktf ktf deleted the add-uproot branch May 16, 2018 09:15
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