python3Packages.qiskit-aqua: 0.7.5 -> 0.8.1

This commit is contained in:
Drew Risinger 2020-11-04 12:45:41 -05:00 committed by Jonathan Ringer
parent cf115f9320
commit 18899e6aef

View File

@ -2,8 +2,6 @@
, pythonOlder , pythonOlder
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
# , cplex
, cvxpy , cvxpy
, dlx , dlx
, docplex , docplex
@ -18,6 +16,15 @@
, quandl , quandl
, scikitlearn , scikitlearn
, yfinance , yfinance
# Optional inputs
, withTorch ? false
, pytorch
, withPyscf ? false
, pyscf ? null
, withScikitQuant ? false
, scikit-quant ? null
, withCplex ? false
, cplex ? null
# Check Inputs # Check Inputs
, ddt , ddt
, pytestCheckHook , pytestCheckHook
@ -26,30 +33,20 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "qiskit-aqua"; pname = "qiskit-aqua";
version = "0.7.5"; version = "0.8.1";
disabled = pythonOlder "3.5"; disabled = pythonOlder "3.6";
# Pypi's tarball doesn't contain tests # Pypi's tarball doesn't contain tests
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Qiskit"; owner = "Qiskit";
repo = "qiskit-aqua"; repo = "qiskit-aqua";
rev = version; rev = version;
sha256 = "19sdv7lnc4b1c86rd1dv7pjpi8cmrpzbv7nav0fb899ki8ldqdwq"; sha256 = "11qyya3vyq50wpzrzzl8v46yx5p72rhpqhybwn47qgazxgg82r1b";
}; };
# TODO: remove in next release
patches = [
(fetchpatch {
name = "qiskit-aqua-fix-test-issue-1214.patch";
url = "https://github.com/Qiskit/qiskit-aqua/commit/284a4323192ac85787b22cbe5f344996fae16f7d.patch";
sha256 = "0zl8hqa2fq9ng793x4dhh0ny67nnbjcd8l1cdsaaab4ca1y0xcfr";
})
];
# Optional packages: pyscf (see below NOTE) & pytorch. Can install via pip/nix if needed. # Optional packages: pyscf (see below NOTE) & pytorch. Can install via pip/nix if needed.
propagatedBuildInputs = [ propagatedBuildInputs = [
# cplex
cvxpy cvxpy
docplex docplex
dlx # Python Dancing Links package dlx # Python Dancing Links package
@ -63,7 +60,10 @@ buildPythonPackage rec {
quandl quandl
scikitlearn scikitlearn
yfinance yfinance
]; ] ++ lib.optionals (withTorch) [ pytorch ]
++ lib.optionals (withPyscf) [ pyscf ]
++ lib.optionals (withScikitQuant) [ scikit-quant ]
++ lib.optionals (withCplex) [ cplex ];
# *** NOTE *** # *** NOTE ***
# We make pyscf optional in this package, due to difficulties packaging it in Nix (test failures, complicated flags, etc). # We make pyscf optional in this package, due to difficulties packaging it in Nix (test failures, complicated flags, etc).
@ -97,8 +97,11 @@ buildPythonPackage rec {
postInstall = "rm -rf $out/${python.sitePackages}/docs"; # Remove docs dir b/c it can cause conflicts. postInstall = "rm -rf $out/${python.sitePackages}/docs"; # Remove docs dir b/c it can cause conflicts.
checkInputs = [ ddt qiskit-aer pytestCheckHook ]; checkInputs = [
dontUseSetuptoolsCheck = true; pytestCheckHook
ddt
qiskit-aer
];
pythonImportsCheck = [ pythonImportsCheck = [
"qiskit.aqua" "qiskit.aqua"
"qiskit.aqua.algorithms" "qiskit.aqua.algorithms"
@ -107,11 +110,11 @@ buildPythonPackage rec {
"qiskit.ml" "qiskit.ml"
"qiskit.optimization" "qiskit.optimization"
]; ];
pytestFlagsArray = [ pytestFlagsArray = lib.optionals (!withPyscf) [
# Disabled b/c missing pyscf
"--ignore=test/chemistry/test_qeom_ee.py" "--ignore=test/chemistry/test_qeom_ee.py"
"--ignore=test/chemistry/test_qeom_vqe.py" "--ignore=test/chemistry/test_qeom_vqe.py"
"--ignore=test/chemistry/test_vqe_uccsd_adapt.py" "--ignore=test/chemistry/test_vqe_uccsd_adapt.py"
"--ignore=test/chemistry/test_bopes_sampler.py"
]; ];
disabledTests = [ disabledTests = [
# Disabled due to missing pyscf # Disabled due to missing pyscf
@ -123,8 +126,10 @@ buildPythonPackage rec {
# Disabling slow tests > 10 seconds # Disabling slow tests > 10 seconds
"TestVQE" "TestVQE"
"TestOOVQE"
"TestVQC" "TestVQC"
"TestQSVM" "TestQSVM"
"TestOptimizerAQGD"
"test_graph_partition_vqe" "test_graph_partition_vqe"
"TestLookupRotation" "TestLookupRotation"
"_vqe" "_vqe"
@ -151,6 +156,7 @@ buildPythonPackage rec {
"test_confidence_intervals_00001" "test_confidence_intervals_00001"
"test_eoh" "test_eoh"
"test_qasm_5" "test_qasm_5"
"test_uccsd_hf"
]; ];
meta = with lib; { meta = with lib; {