Yueh-Shun Li 76e2a397c2 treewide: pytestFlagsArray -> pytestFlags and join flag and option argument
This treewide change targets Python packages
that specifies pytest flags with pytestFlagsArray,
and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.

Use the __structuredAttrs-agnostic argument pytestFlags
instead of the deprecated pytestFlagsArray.

For flags with option arguments,
join each flag and their option argument into a single command-line argument
following POSIX Utility Argument Syntax[1]
for easier overriding (remove/replace).

Examples:

* [ "-W" "ignore:message:WarningClass" ] ->
  [ "-Wignore:message:WarningClass" ]

* [ "--reruns" "3" ] ->
  [ "--reruns=3" ]

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
2025-06-16 01:02:16 +08:00

89 lines
1.7 KiB
Nix

{
lib,
pythonOlder,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# Python Inputs
fastdtw,
numpy,
pandas,
psutil,
qiskit-terra,
qiskit-optimization,
scikit-learn,
scipy,
quandl,
yfinance,
# Check Inputs
pytestCheckHook,
ddt,
pytest-timeout,
qiskit-aer,
}:
buildPythonPackage rec {
pname = "qiskit-finance";
version = "0.4.1";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "qiskit";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-zYhYhojCzlENzgYSenwewjeVHUBX2X6eQbbzc9znBsk=";
};
postPatch = ''
substituteInPlace requirements.txt --replace "pandas<1.4.0" "pandas"
'';
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
fastdtw
numpy
pandas
psutil
qiskit-terra
qiskit-optimization
quandl
scikit-learn
scipy
yfinance
];
nativeCheckInputs = [
pytestCheckHook
pytest-timeout
ddt
qiskit-aer
];
pythonImportsCheck = [ "qiskit_finance" ];
disabledTests = [
# Fail due to approximation error, ~1-2%
"test_application"
# Tests fail b/c require internet connection. Stalls tests if enabled.
"test_exchangedata"
"test_yahoo"
"test_wikipedia"
];
pytestFlags = [ "--durations=10" ];
meta = with lib; {
description = "Software for developing quantum computing programs";
homepage = "https://qiskit.org";
downloadPage = "https://github.com/QISKit/qiskit-optimization/releases";
changelog = "https://qiskit.org/documentation/release_notes.html";
license = licenses.asl20;
maintainers = with maintainers; [ drewrisinger ];
};
}