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