python3Packages.retworkx: 0.8.0 -> 0.9.0

Also fixes retworkx Darwin build.

Fixes linker error for retworkx that required libiconv.
Error log:
error: linking with `/nix/store/47vpv5i10dwfg1cf5wca1k40f982g5fm-clang-wrapper-7.1.0/bin/cc` failed: exit code: 1
    ...
    ld: library not found for -liconv
    clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Also fix tests running on build, that didn't get converted when switched
to the new way of running Cargo builds for python packages.
This commit is contained in:
Drew Risinger 2021-06-01 18:06:33 -04:00
parent b6e6f1dddd
commit 35b9c063c2

View file

@ -1,18 +1,23 @@
{ lib { lib
, stdenv
, buildPythonPackage , buildPythonPackage
, pythonOlder , pythonOlder
, rustPlatform , rustPlatform
, fetchFromGitHub , fetchFromGitHub
, libiconv
# Check inputs # Check inputs
, pytestCheckHook , pytestCheckHook
, fixtures
, graphviz
, matplotlib
, networkx , networkx
, numpy , numpy
, pydot
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "retworkx"; pname = "retworkx";
version = "0.8.0"; version = "0.9.0";
format = "pyproject"; format = "pyproject";
disabled = pythonOlder "3.6"; disabled = pythonOlder "3.6";
@ -20,22 +25,29 @@ buildPythonPackage rec {
owner = "Qiskit"; owner = "Qiskit";
repo = "retworkx"; repo = "retworkx";
rev = version; rev = version;
sha256 = "0plpri6a3d6f1000kmcah9066vq2i37d14bdf8sm96493fhpqhrd"; hash = "sha256-1W7DexS+ECAPsxyZAF36xcEguFkjUMX9lDBylNVPqyk=";
}; };
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
inherit src; inherit src;
name = "${pname}-${version}"; name = "${pname}-${version}";
hash = "sha256-+k779gmge8wDdoZrWn9ND47kUqt7pqe75Zuj2Byfefo="; hash = "sha256-y5l7jqrlk3ONHefZPS31IvcaO9ttXWLM7fIUmNVwbco=";
}; };
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ]; nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage) buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
doCheck = false;
doInstallCheck = true;
installCheckInputs = [ pytestCheckHook networkx numpy ]; pythonImportsCheck = [ "retworkx" ];
checkInputs = [
pytestCheckHook
fixtures
graphviz
matplotlib
networkx
numpy
pydot
];
preCheck = '' preCheck = ''
export TESTDIR=$(mktemp -d) export TESTDIR=$(mktemp -d)