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.onnx: init at version 1.6.0 #71211

Merged
merged 1 commit into from Jan 13, 2020
Merged

Conversation

acairncross
Copy link
Contributor

Motivation for this change
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.
Notify maintainers

cc @

@jonringer
Copy link
Contributor

oh lol, i was thinking of putting this up as well

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python27Packages.onnx python37Packages.onnx

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
leaf package

[4 built, 1 copied (0.2 MiB), 0.1 MiB DL]
https://github.com/NixOS/nixpkgs/pull/71202
2 package were build:
python27Packages.hcloud python37Packages.hcloud

only thing is that it seems to install some test utilties which I don't think are too important:

[nix-shell:/home/jon/.cache/nix-review/pr-71211]$ tree ./results/python27Packages.onnx/bin/
./results/python27Packages.onnx/bin/
├── backend-test-tools
├── check-model
└── check-node

you can remove these with:

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

@acairncross
Copy link
Contributor Author

Woops, didn't really mean to re-request review!

I've removed the installed executables.

@jonringer
Copy link
Contributor

python2 version seems to be broken

[nix-shell:/home/jon/.cache/nix-review/pr-71211-1]$ nix-shell --pure -p "with import ./nixpkgs {}; pythonPackages.onnx"

[nix-shell:/home/jon/.cache/nix-review/pr-71211-1]$ python
Python 2.7.16 (default, Mar  2 2019, 18:34:01)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/p5257ap9szl0x8zsn5g920b4nrcnviq2-python2.7-onnx-1.6.0/lib/python2.7/site-packages/onnx/__init__.py", line 9, in <module>
    from onnx.external_data_helper import load_external_data_for_model, write_external_data_tensors
  File "/nix/store/p5257ap9szl0x8zsn5g920b4nrcnviq2-python2.7-onnx-1.6.0/lib/python2.7/site-packages/onnx/external_data_helper.py", line 10, in <module>
    from .onnx_pb import TensorProto, ModelProto
  File "/nix/store/p5257ap9szl0x8zsn5g920b4nrcnviq2-python2.7-onnx-1.6.0/lib/python2.7/site-packages/onnx/onnx_pb.py", line 8, in <module>
    from .onnx_ml_pb2 import *  # noqa
  File "/nix/store/p5257ap9szl0x8zsn5g920b4nrcnviq2-python2.7-onnx-1.6.0/lib/python2.7/site-packages/onnx/onnx_ml_pb2.py", line 7, in <module>
    from google.protobuf.internal import enum_type_wrapper
ImportError: No module named google.protobuf.internal

@acairncross
Copy link
Contributor Author

Seems to be a problem with the protobuf installation. In particular because Python 2 doesn't support implicit namespace packages. Chucking __init__.pys into the google and google/protobuf directories of the installation seems to "fix" the problem, although I doubt that's the proper/clean solution (that's certainly not what pip does). What I don't understand is why the pip-installed version doesn't have the same issue. Also I wonder why this hasn't been a (reported) issue for any other Python packages using protobuf.

@jonringer
Copy link
Contributor

pip installed version likely dumps it into the same directory as all the other packages, so it gets to fuse all directory paths into one coherent path. Nixpkgs doesn't get this benefit since it's a series of storepaths.

Seeing as python2 is EOL in 1.5 months, I'm fine with just saying disabled = isPy27 and moving on. @FRidh thoughts?

@jonringer
Copy link
Contributor

please squash the commits:

git reset HEAD^
git add pkgs/
git commit --amend --no-edit
git push <fork> <branch> --force

@acairncross
Copy link
Contributor Author

Done

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.

python2 build fails due to namespace import errors on protobuf

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.

LGTM

[1 built, 0.0 MiB DL]
https://github.com/NixOS/nixpkgs/pull/71211
2 package were built:
python37Packages.onnx python38Packages.onnx

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python37Packages.onnx python38Packages.onnx

@jonringer jonringer merged commit 74a3ff5 into NixOS:master Jan 13, 2020
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