1{ lib
2, pythonOlder
3, buildPythonPackage
4, fetchFromGitHub
5 # Python Inputs
6, fastdtw
7, numpy
8, pandas
9, psutil
10, qiskit-terra
11, qiskit-optimization
12, scikit-learn
13, scipy
14, quandl
15, yfinance
16 # Check Inputs
17, pytestCheckHook
18, ddt
19, pytest-timeout
20, qiskit-aer
21}:
22
23buildPythonPackage rec {
24 pname = "qiskit-finance";
25 version = "0.3.4";
26
27 disabled = pythonOlder "3.6";
28
29 src = fetchFromGitHub {
30 owner = "qiskit";
31 repo = pname;
32 rev = "refs/tags/${version}";
33 hash = "sha256-Ijoqn6nANLsEVKA5nycd1xbW5htJ+TQm6LkiMUWTsSs=";
34 };
35
36 postPatch = ''
37 substituteInPlace requirements.txt --replace "pandas<1.4.0" "pandas"
38 '';
39
40 propagatedBuildInputs = [
41 fastdtw
42 numpy
43 pandas
44 psutil
45 qiskit-terra
46 qiskit-optimization
47 quandl
48 scikit-learn
49 scipy
50 yfinance
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 pytest-timeout
56 ddt
57 qiskit-aer
58 ];
59
60 pythonImportsCheck = [ "qiskit_finance" ];
61 disabledTests = [
62 # Fail due to approximation error, ~1-2%
63 "test_application"
64
65 # Tests fail b/c require internet connection. Stalls tests if enabled.
66 "test_exchangedata"
67 "test_yahoo"
68 "test_wikipedia"
69 ];
70 pytestFlagsArray = [
71 "--durations=10"
72 ];
73
74 meta = with lib; {
75 description = "Software for developing quantum computing programs";
76 homepage = "https://qiskit.org";
77 downloadPage = "https://github.com/QISKit/qiskit-optimization/releases";
78 changelog = "https://qiskit.org/documentation/release_notes.html";
79 license = licenses.asl20;
80 maintainers = with maintainers; [ drewrisinger ];
81 };
82}