From 293a5455f31039a590cca0b844d134736fedae46 Mon Sep 17 00:00:00 2001 From: Sandro Date: Tue, 26 Apr 2022 03:48:36 +0200 Subject: [PATCH] python310Packages.ffcv: fix build (#170158) * python310Packages.ffcv: fix pkg-config usage Package does not use the pkgconfig python packages but ships its own method which execs pkg-config * python310Packages.onnx: ignore failing test * python310Packages.pytorch-pfn-extras: fix build * python310Packages.pytorch-pfn-extras: move comment out of multi line string Co-authored-by: Samuel Ainsworth * Update pkgs/development/python-modules/pytorch-pfn-extras/default.nix Co-authored-by: Sandro Co-authored-by: Samuel Ainsworth --- .../python-modules/ffcv/default.nix | 4 ++-- .../python-modules/onnx/default.nix | 5 +++++ .../pytorch-pfn-extras/default.nix | 20 +++++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/ffcv/default.nix b/pkgs/development/python-modules/ffcv/default.nix index 809a9ca696d8..08f80d198e4e 100644 --- a/pkgs/development/python-modules/ffcv/default.nix +++ b/pkgs/development/python-modules/ffcv/default.nix @@ -5,7 +5,7 @@ , numba , opencv4 , pandas -, pkgconfig +, pkg-config , pytorch-pfn-extras , terminaltables , tqdm @@ -35,7 +35,7 @@ buildPythonPackage rec { --replace "'webdataset'," "" ''; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ libjpeg ]; propagatedBuildInputs = [ opencv4 numba pandas pytorch-pfn-extras terminaltables tqdm ]; diff --git a/pkgs/development/python-modules/onnx/default.nix b/pkgs/development/python-modules/onnx/default.nix index 2846042e8d45..377521bb2f87 100644 --- a/pkgs/development/python-modules/onnx/default.nix +++ b/pkgs/development/python-modules/onnx/default.nix @@ -55,6 +55,11 @@ buildPythonPackage rec { export MAX_JOBS=$NIX_BUILD_CORES ''; + disabledTestPaths = [ + # Unexpected output fields from running code: {'stderr'} + "onnx/examples/np_array_tensorproto.ipynb" + ]; + # The executables are just utility scripts that aren't too important postInstall = '' rm -r $out/bin diff --git a/pkgs/development/python-modules/pytorch-pfn-extras/default.nix b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix index 3c239d970402..c30f3bd5120d 100644 --- a/pkgs/development/python-modules/pytorch-pfn-extras/default.nix +++ b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix @@ -3,8 +3,10 @@ , lib , numpy , onnx +, packaging , pytestCheckHook , pytorch +, torchvision , typing-extensions }: @@ -19,9 +21,14 @@ buildPythonPackage rec { sha256 = "sha256-gB575ZKXZRAy5K5CkBtfG6KG1yQ9WDREIobsy43CEOc="; }; - propagatedBuildInputs = [ numpy pytorch typing-extensions ]; + propagatedBuildInputs = [ numpy packaging pytorch typing-extensions ]; - checkInputs = [ onnx pytestCheckHook ]; + checkInputs = [ onnx pytestCheckHook torchvision ]; + + # ignore all pytest warnings + preCheck = '' + rm pytest.ini + ''; pythonImportsCheck = [ "pytorch_pfn_extras" ]; @@ -29,6 +36,15 @@ buildPythonPackage rec { # Requires optuna which is currently (2022-02-16) marked as broken. "tests/pytorch_pfn_extras_tests/test_config_types.py" + # requires onnxruntime which was removed because of poor maintainability + # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058 + "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py" + + # RuntimeError: No Op registered for Gradient with domain_version of 9 + "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py" + # Requires CUDA access which is not possible in the nix environment. "tests/pytorch_pfn_extras_tests/cuda_tests/test_allocator.py" "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_batchnorm.py"