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

@acairncross acairncross commented Oct 15, 2019

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 @

@acairncross acairncross requested a review from FRidh as a code owner Oct 15, 2019
@acairncross acairncross force-pushed the acairncross:onnx branch from 7426d96 to a02668e Oct 15, 2019
@acairncross acairncross changed the title onnx: init at version 1.6.0 pythonPackages.onnx: init at version 1.6.0 Oct 15, 2019
@jonringer
Copy link
Contributor

@jonringer jonringer commented Oct 16, 2019

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

@jonringer
Copy link
Contributor

@jonringer jonringer commented Oct 16, 2019

@GrahamcOfBorg build python27Packages.onnx python37Packages.onnx

Copy link
Contributor

@jonringer jonringer left a comment

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 acairncross force-pushed the acairncross:onnx branch from a02668e to 3c9cfeb Oct 16, 2019
@acairncross acairncross force-pushed the acairncross:onnx branch from 3c9cfeb to 8cf534e Oct 16, 2019
@acairncross acairncross requested a review from jonringer Oct 16, 2019
@acairncross
Copy link
Contributor Author

@acairncross acairncross commented Oct 16, 2019

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

I've removed the installed executables.

@jonringer
Copy link
Contributor

@jonringer jonringer commented Oct 16, 2019

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

@acairncross acairncross commented Oct 16, 2019

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

@jonringer jonringer commented Oct 16, 2019

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

@jonringer jonringer commented Jan 13, 2020

please squash the commits:

git reset HEAD^
git add pkgs/
git commit --amend --no-edit
git push <fork> <branch> --force
@acairncross acairncross force-pushed the acairncross:onnx branch from fdd6304 to 3a461bb Jan 13, 2020
@acairncross
Copy link
Contributor Author

@acairncross acairncross commented Jan 13, 2020

Done

Copy link
Contributor

@jonringer jonringer left a comment

python2 build fails due to namespace import errors on protobuf

@acairncross acairncross force-pushed the acairncross:onnx branch from 3a461bb to 74d5c7a Jan 13, 2020
Copy link
Contributor

@jonringer jonringer left a comment

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

@jonringer jonringer commented Jan 13, 2020

@GrahamcOfBorg build python37Packages.onnx python38Packages.onnx

@jonringer jonringer merged commit 74a3ff5 into NixOS:master Jan 13, 2020
3 checks passed
3 checks passed
python37Packages.onnx, python38Packages.onnx on aarch64-linux Success
Details
python37Packages.onnx, python38Packages.onnx on x86_64-darwin Success
Details
python37Packages.onnx, python38Packages.onnx on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.