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

python3Packages.qiskit: 0.25.0 -> 0.26.2 #121606

Merged
merged 8 commits into from
Jun 3, 2021
28 changes: 20 additions & 8 deletions pkgs/development/python-modules/qiskit-aer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
# C Inputs
, blas
, catch2
Expand All @@ -27,7 +28,7 @@

buildPythonPackage rec {
pname = "qiskit-aer";
version = "0.8.0";
version = "0.8.2";
format = "pyproject";

disabled = pythonOlder "3.6";
Expand All @@ -36,13 +37,30 @@ buildPythonPackage rec {
owner = "Qiskit";
repo = "qiskit-aer";
rev = version;
hash = "sha256-CWF3ehLs0HBXnYH11r+2CQwIcxddAfQm3ulAf1agl/o=";
hash = "sha256-7NWM7qpMQ3vA6p0dhEPnkBjsPMdhceYTYcAD4tsClf0=";
};

patches = [
(fetchpatch {
# https://github.com/Qiskit/qiskit-aer/pull/1250
name = "qiskit-aer-pr-1250-native-cmake_dl_libs.patch";
url = "https://github.com/Qiskit/qiskit-aer/commit/2bf04ade3e5411776817706cf82cc67a3b3866f6.patch";
sha256 = "0ldwzxxfgaad7ifpci03zfdaj0kqj0p3h94qgshrd2953mf27p6z";
})
];
# Remove need for cmake python package
# pybind11 shouldn't be an install requirement, just build requirement.
postPatch = ''
substituteInPlace setup.py \
--replace "'cmake!=3.17,!=3.17.0'," "" \
--replace "'pybind11>=2.6'" ""
'';

nativeBuildInputs = [
cmake
ninja
scikit-build
pybind11
];

buildInputs = [
Expand All @@ -58,14 +76,8 @@ buildPythonPackage rec {
cvxpy
cython # generates some cython files at runtime that need to be cython-ized
numpy
pybind11
];

# tries to install pypi cmake package, not needed
postPatch = ''
substituteInPlace setup.py --replace "'cmake!=3.17,!=3.17.0'," ""
'';

# Disable using conan for build
preBuild = ''
export DISABLE_CONAN=1
Expand Down
12 changes: 4 additions & 8 deletions pkgs/development/python-modules/qiskit-aqua/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
, networkx
, numpy
, psutil
, python
, qiskit-ignis
, qiskit-terra
, quandl
Expand All @@ -34,7 +33,7 @@

buildPythonPackage rec {
pname = "qiskit-aqua";
version = "0.9.0";
version = "0.9.1";

disabled = pythonOlder "3.6";

Expand All @@ -43,7 +42,7 @@ buildPythonPackage rec {
owner = "Qiskit";
repo = "qiskit-aqua";
rev = version;
hash = "sha256-knue9uJih72UQHsvfXZ9AA94mol4ERa9Lo/GMcp+2hA=";
hash = "sha256-fptyqPrkUgl3UjtlEmDYORdX/SsONxWozQGEs/EahmU=";
};

# Optional packages: pyscf (see below NOTE) & pytorch. Can install via pip/nix if needed.
Expand Down Expand Up @@ -97,8 +96,6 @@ buildPythonPackage rec {
>> qiskit/optimization/__init__.py
'';

postInstall = "rm -rf $out/${python.sitePackages}/docs"; # Remove docs dir b/c it can cause conflicts.

checkInputs = [
pytestCheckHook
ddt
Expand All @@ -123,9 +120,6 @@ buildPythonPackage rec {
"--ignore=test/chemistry/test_bopes_sampler.py"
];
disabledTests = [
# Disabled due to missing pyscf
"test_validate" # test/chemistry/test_inputparser.py

# Online tests
"test_exchangedata"
"test_yahoo"
Expand Down Expand Up @@ -163,6 +157,8 @@ buildPythonPackage rec {
"test_eoh"
"test_qasm_5"
"test_uccsd_hf"
] ++ lib.optionals (!withPyscf) [
"test_validate" # test/chemistry/test_inputparser.py
];

meta = with lib; {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ let
in
buildPythonPackage rec {
pname = "qiskit-ibmq-provider";
version = "0.12.2";
version = "0.13.1";

disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = "Qiskit";
repo = pname;
rev = version;
sha256 = "0yil363mqssq0453nrwxgkjivzk3a4jgbnaf21bp7lwfcl2jdhqm";
hash = "sha256-DlHlXncttzGo4uVoh2aQ7urW6krN3ej2sJ/EwuxeF2I=";
};

propagatedBuildInputs = [
Expand Down Expand Up @@ -83,7 +83,9 @@ buildPythonPackage rec {

# Skip tests that rely on internet access (mostly to IBM Quantum Experience cloud).
# Options defined in qiskit.terra.test.testing_options.py::get_test_options
QISKIT_TESTS = "skip_online";
preCheck = ''
export QISKIT_TESTS=skip_online
'';

meta = with lib; {
description = "Qiskit provider for accessing the quantum devices and simulators at IBMQ";
Expand Down
16 changes: 6 additions & 10 deletions pkgs/development/python-modules/qiskit-ignis/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ lib
, stdenv
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
, python
, numpy
, qiskit-terra
, scikit-learn
Expand Down Expand Up @@ -35,12 +35,6 @@ buildPythonPackage rec {
hash = "sha256-L5fwCMsN03ojiDvKIyqsGfUnwej1P7bpyHlL6mu7nh0=";
};

# hacky, fix https://github.com/Qiskit/qiskit-ignis/issues/532.
# TODO: remove on qiskit-ignis v0.5.2
postPatch = ''
substituteInPlace qiskit/ignis/mitigation/expval/base_meas_mitigator.py --replace "plt.axes" "'plt.axes'"
'';

propagatedBuildInputs = [
numpy
qiskit-terra
Expand All @@ -49,12 +43,13 @@ buildPythonPackage rec {
] ++ lib.optionals (withCvx) [ cvxpy ]
++ lib.optionals (withVisualization) [ matplotlib ]
++ lib.optionals (withJit) [ numba ];
postInstall = "rm -rf $out/${python.sitePackages}/docs"; # this dir can create conflicts

# Tests
pythonImportsCheck = [ "qiskit.ignis" ];
dontUseSetuptoolsCheck = true;
preCheck = "export HOME=$TMPDIR";
preCheck = ''
export HOME=$TMPDIR
'';
checkInputs = [
pytestCheckHook
ddt
Expand All @@ -63,7 +58,8 @@ buildPythonPackage rec {
];
disabledTests = [
"test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds
"test_qv_fitter" # execution hangs, ran for several minutes
] ++ lib.optionals stdenv.isAarch64 [
"test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues.
];

meta = with lib; {
Expand Down
15 changes: 11 additions & 4 deletions pkgs/development/python-modules/qiskit-terra/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, stdenv
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
Expand Down Expand Up @@ -56,15 +57,15 @@ in

buildPythonPackage rec {
pname = "qiskit-terra";
version = "0.17.0";
version = "0.17.4";

disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = "Qiskit";
repo = pname;
rev = version;
hash = "sha256-LbNbaHAWAVG5YLc9juuwcOlrREBW6OjEl7VPtACfl3I=";
hash = "sha256-JyNuke+XPqjLVZbvPud9Y7k0+EmvETVKcOYcDldBiVo=";
};

nativeBuildInputs = [ cython ];
Expand Down Expand Up @@ -106,11 +107,17 @@ buildPythonPackage rec {
"test/python/classical_function_compiler/"
];
disabledTests = [
# Not working on matplotlib >= 3.4.0, checks images match.
"test_plot_circuit_layout"

# Flaky tests
"test_cx_equivalence"
"test_pulse_limits"
"test_1q_random"
] ++ lib.optionals (!withClassicalFunctionCompiler) [
"TestPhaseOracle"
] ++ lib.optionals stdenv.isAarch64 [
"test_circuit_init" # failed on aarch64, https://gist.github.com/r-rmcgibbo/c2e173d43ced4f6954811004f6b5b842
]
# Disabling slow tests for build constraints
++ [
Expand Down Expand Up @@ -155,8 +162,8 @@ buildPythonPackage rec {
pushd $PACKAGEDIR
'';
postCheck = ''
rm -rf test
rm -rf examples
rm -r test
rm -r examples
popd
'';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/qiskit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
buildPythonPackage rec {
pname = "qiskit";
# NOTE: This version denotes a specific set of subpackages. See https://qiskit.org/documentation/release_notes.html#version-history
version = "0.25.0";
version = "0.26.2";

disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = "qiskit";
repo = "qiskit";
rev = version;
hash = "sha256-pJM6d3AyFs9AexvQXG+8QQ4zwpFisJC16iBFR9gNSk0=";
hash = "sha256-QYWKKS7e/uCt5puWV4jA9Emp7M4Cyv2RUCxilbChWhw=";
};

propagatedBuildInputs = [
Expand Down
28 changes: 20 additions & 8 deletions pkgs/development/python-modules/retworkx/default.nix
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
{ lib
, stdenv
, buildPythonPackage
, pythonOlder
, rustPlatform
, fetchFromGitHub

, libiconv
# Check inputs
, pytestCheckHook
, fixtures
, graphviz
, matplotlib
, networkx
, numpy
, pydot
}:

buildPythonPackage rec {
pname = "retworkx";
version = "0.8.0";
version = "0.9.0";
format = "pyproject";
disabled = pythonOlder "3.6";

src = fetchFromGitHub {
owner = "Qiskit";
repo = "retworkx";
rev = version;
sha256 = "0plpri6a3d6f1000kmcah9066vq2i37d14bdf8sm96493fhpqhrd";
hash = "sha256-1W7DexS+ECAPsxyZAF36xcEguFkjUMX9lDBylNVPqyk=";
};

cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-+k779gmge8wDdoZrWn9ND47kUqt7pqe75Zuj2Byfefo=";
hash = "sha256-y5l7jqrlk3ONHefZPS31IvcaO9ttXWLM7fIUmNVwbco=";
};

nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];

# Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
doCheck = false;
doInstallCheck = true;
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];

installCheckInputs = [ pytestCheckHook networkx numpy ];
pythonImportsCheck = [ "retworkx" ];
checkInputs = [
pytestCheckHook
fixtures
graphviz
matplotlib
networkx
numpy
pydot
];

preCheck = ''
export TESTDIR=$(mktemp -d)
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/yfinance/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

buildPythonPackage rec {
pname = "yfinance";
version = "0.1.56";
version = "0.1.59";

# GitHub source releases aren't tagged
src = fetchPypi {
inherit pname version;
sha256 = "a6d4c7b939fdd48d983556501f5b387e20aaef86afc8e6ba6f91a49a7e22d2dd";
sha256 = "fe4dc46807eceadc6604bf51ece7297b752dc5402a38a87385094fbfc7565fa0";
};

propagatedBuildInputs = [
Expand Down