Cargo 1.84.0 seems to have changed the output format of cargo vendor again, once again invalidating fetchCargoTarball FOD hashes. It's time to fix this once and for all, switching across the board to fetchCargoVendor, which is not dependent on cargo vendor's output format. It should be possible to reproduce this diff. To generate it, I first ran: xargs sed -i 's/fetchCargoTarball/fetchCargoVendor/g' The following manually identified list of files were given as standard input: pkgs/applications/graphics/drawpile/default.nix pkgs/applications/graphics/gnome-decoder/default.nix pkgs/applications/graphics/gnome-obfuscate/default.nix pkgs/applications/misc/openbangla-keyboard/default.nix pkgs/applications/version-management/git-cinnabar/default.nix pkgs/applications/version-management/mercurial/default.nix pkgs/applications/version-management/silver-platter/default.nix pkgs/applications/virtualization/krunvm/default.nix pkgs/development/libraries/librsvg/default.nix pkgs/development/python-modules/aardwolf/default.nix pkgs/development/python-modules/adblock/default.nix pkgs/development/python-modules/ahocorasick-rs/default.nix pkgs/development/python-modules/bcrypt/default.nix pkgs/development/python-modules/biliass/default.nix pkgs/development/python-modules/chromadb/default.nix pkgs/development/python-modules/clarabel/default.nix pkgs/development/python-modules/cmsis-pack-manager/default.nix pkgs/development/python-modules/copykitten/default.nix pkgs/development/python-modules/cramjam/default.nix pkgs/development/python-modules/cryptg/default.nix pkgs/development/python-modules/cryptography/default.nix pkgs/development/python-modules/css-inline/default.nix pkgs/development/python-modules/deebot-client/default.nix pkgs/development/python-modules/deltalake/default.nix pkgs/development/python-modules/etebase/default.nix pkgs/development/python-modules/evtx/default.nix pkgs/development/python-modules/fastcrc/default.nix pkgs/development/python-modules/flaxlib/default.nix pkgs/development/python-modules/gb-io/default.nix pkgs/development/python-modules/glean-sdk/default.nix pkgs/development/python-modules/hf-transfer/default.nix pkgs/development/python-modules/jh2/default.nix pkgs/development/python-modules/johnnycanencrypt/default.nix pkgs/development/python-modules/kurbopy/default.nix pkgs/development/python-modules/libcst/default.nix pkgs/development/python-modules/lzallright/default.nix pkgs/development/python-modules/netifaces2/default.nix pkgs/development/python-modules/nlpo3/default.nix pkgs/development/python-modules/nutils-poly/default.nix pkgs/development/python-modules/nutpie/default.nix pkgs/development/python-modules/orjson/default.nix pkgs/development/python-modules/pdoc-pyo3-sample-library/default.nix pkgs/development/python-modules/pendulum/default.nix pkgs/development/python-modules/primp/default.nix pkgs/development/python-modules/py-sr25519-bindings/default.nix pkgs/development/python-modules/pycddl/default.nix pkgs/development/python-modules/pydantic-core/default.nix pkgs/development/python-modules/pyperscan/default.nix pkgs/development/python-modules/pysequoia/default.nix pkgs/development/python-modules/python-bidi/default.nix pkgs/development/python-modules/python-kadmin-rs/default.nix pkgs/development/python-modules/qiskit-terra/default.nix pkgs/development/python-modules/regress/default.nix pkgs/development/python-modules/rpds-py/default.nix pkgs/development/python-modules/rtoml/default.nix pkgs/development/python-modules/rustworkx/default.nix pkgs/development/python-modules/safetensors/default.nix pkgs/development/python-modules/skytemple-rust/default.nix pkgs/development/python-modules/sourmash/default.nix pkgs/development/python-modules/spacy-alignments/default.nix pkgs/development/python-modules/sudachipy/default.nix pkgs/development/python-modules/test-results-parser/default.nix pkgs/development/python-modules/tiktoken/default.nix pkgs/development/python-modules/tokenizers/default.nix pkgs/development/python-modules/tree-sitter-make/default.nix pkgs/development/python-modules/whenever/default.nix pkgs/development/python-modules/y-py/default.nix pkgs/development/python-modules/zxcvbn-rs-py/default.nix pkgs/development/r-modules/default.nix pkgs/games/ddnet/default.nix pkgs/servers/matrix-synapse/plugins/rendezvous.nix pkgs/tools/filesystems/ceph/default.nix pkgs/tools/filesystems/ceph/old-python-packages/cryptography.nix Then I ran: xargs -n 1 nix-update --version=skip With this list of attributes corresponding to the changed files given as standard input: drawpile gnome-decoder gnome-obfuscate ibus-engines.openbangla-keyboard git-cinnabar mercurial silver-platter krunvm librsvg python3Packages.aardwolf python3Packages.adblock python3Packages.ahocorasick-rs python3Packages.bcrypt python3Packages.biliass python3Packages.chromadb python3Packages.clarabel python3Packages.cmsis-pack-manager python3Packages.copykitten python3Packages.cramjam python3Packages.cryptg python3Packages.cryptography python3Packages.css-inline python3Packages.deebot-client python3Packages.deltalake python3Packages.etebase python3Packages.evtx python3Packages.fastcrc python3Packages.flaxlib python3Packages.gb-io python3Packages.glean-sdk python3Packages.hf-transfer python3Packages.jh2 python3Packages.johnnycanencrypt python3Packages.kurbopy python3Packages.libcst python3Packages.lzallright python3Packages.netifaces2 python3Packages.nlpo3 python3Packages.nutils-poly python3Packages.nutpie python3Packages.orjson python3Packages.pdoc-pyo3-sample-library python3Packages.pendulum python3Packages.primp python3Packages.py-sr25519-bindings python3Packages.pycddl python3Packages.pydantic-core python3Packages.pyperscan python3Packages.pysequoia python3Packages.python-bidi python3Packages.python-kadmin-rs python3Packages.qiskit-terra python3Packages.regress python3Packages.rpds-py python3Packages.rtoml python3Packages.rustworkx python3Packages.safetensors python3Packages.skytemple-rust python3Packages.sourmash python3Packages.spacy-alignments python3Packages.sudachipy python3Packages.test-results-parser python3Packages.tiktoken python3Packages.tokenizers python3Packages.tree-sitter-make python3Packages.whenever python3Packages.y-py python3Packages.zxcvbn-rs-py rPackages.gifski rPackages.timeless ddnet matrix-synapse-plugins.matrix-http-rendezvous-synapse ceph.python.pkgs.bcrypt ceph.python.pkgs.cryptography The list of files for the first command and the list of attributes for the second command are in the same order, so it should be easy enough to check their correspondence by putting them side by side. It might be possible to parallelize the nix-update operations using xargs' -P option. I haven't tested it. I also manually removed the now-outdated comment in pkgs/development/libraries/librsvg/default.nix.
228 lines
6.3 KiB
Nix
228 lines
6.3 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
pythonAtLeast,
|
|
pythonOlder,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
cargo,
|
|
rustPlatform,
|
|
rustc,
|
|
libiconv,
|
|
# Python requirements
|
|
dill,
|
|
numpy,
|
|
networkx,
|
|
ply,
|
|
psutil,
|
|
python-constraint,
|
|
python-dateutil,
|
|
rustworkx,
|
|
scipy,
|
|
scikit-quant ? null,
|
|
setuptools-rust,
|
|
stevedore,
|
|
symengine,
|
|
sympy,
|
|
tweedledum,
|
|
withVisualization ? false,
|
|
# Python visualization requirements, optional
|
|
ipywidgets,
|
|
matplotlib,
|
|
pillow,
|
|
pydot,
|
|
pygments,
|
|
pylatexenc,
|
|
seaborn,
|
|
# Crosstalk-adaptive layout pass
|
|
withCrosstalkPass ? false,
|
|
z3-solver,
|
|
# test requirements
|
|
ddt,
|
|
hypothesis,
|
|
nbformat,
|
|
nbconvert,
|
|
pytestCheckHook,
|
|
python,
|
|
}:
|
|
|
|
let
|
|
visualizationPackages = [
|
|
ipywidgets
|
|
matplotlib
|
|
pillow
|
|
pydot
|
|
pygments
|
|
pylatexenc
|
|
seaborn
|
|
];
|
|
crosstalkPackages = [ z3-solver ];
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
pname = "qiskit-terra";
|
|
version = "0.25.1";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7" || pythonAtLeast "3.11";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "qiskit";
|
|
repo = pname;
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-4/LVKDNxKsRztCtU/mMfKMVHHJqfadZXmxeOlnlz9Tc=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
setuptools-rust
|
|
rustc
|
|
cargo
|
|
rustPlatform.cargoSetupHook
|
|
];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-nTYrNH3h1kAwwPx7OMw6eI61vYy8iFhm4eWDTGhWxt4=";
|
|
};
|
|
|
|
propagatedBuildInputs =
|
|
[
|
|
dill
|
|
numpy
|
|
networkx
|
|
ply
|
|
psutil
|
|
python-constraint
|
|
python-dateutil
|
|
rustworkx
|
|
scipy
|
|
scikit-quant
|
|
stevedore
|
|
symengine
|
|
sympy
|
|
tweedledum
|
|
]
|
|
++ lib.optionals withVisualization visualizationPackages
|
|
++ lib.optionals withCrosstalkPass crosstalkPackages;
|
|
|
|
# *** Tests ***
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
ddt
|
|
hypothesis
|
|
nbformat
|
|
nbconvert
|
|
] ++ lib.optionals (!withVisualization) visualizationPackages;
|
|
|
|
pythonImportsCheck = [
|
|
"qiskit"
|
|
"qiskit.pulse"
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
"test/randomized/test_transpiler_equivalence.py" # collection requires qiskit-aer, which would cause circular dependency
|
|
# These tests are nondeterministic and can randomly fail.
|
|
# We ignore them here for deterministic building.
|
|
"test/randomized/"
|
|
# These tests consistently fail on GitHub Actions build
|
|
"test/python/quantum_info/operators/test_random.py"
|
|
# Too many floating point arithmetic errors
|
|
"test/visual/mpl/circuit/test_circuit_matplotlib_drawer.py"
|
|
];
|
|
pytestFlagsArray = [ "--durations=10" ];
|
|
disabledTests =
|
|
[
|
|
"TestUnitarySynthesisPlugin" # use unittest mocks for transpiler.run(), seems incompatible somehow w/ pytest infrastructure
|
|
# matplotlib tests seems to fail non-deterministically
|
|
"TestMatplotlibDrawer"
|
|
"TestGraphMatplotlibDrawer"
|
|
"test_copy" # assertNotIn doesn't seem to work as expected w/ pytest vs unittest
|
|
|
|
"test_bound_pass_manager" # AssertionError: 0 != 2
|
|
"test_complex_parameter_bound_to_real" # qiskit.circuit.exceptions.CircuitError: "Invalid param type <class 'complex'> for gate rx."
|
|
"test_expressions_of_parameter_with_constant" # Floating point arithmetic error
|
|
"test_handle_measurement" # AssertionError: The two circuits are not equal
|
|
|
|
# Flaky tests
|
|
"test_pulse_limits" # Fails on GitHub Actions, probably due to minor floating point arithmetic error.
|
|
"test_cx_equivalence" # Fails due to flaky test
|
|
"test_two_qubit_synthesis_not_pulse_optimal" # test of random circuit, seems to randomly fail depending on seed
|
|
"test_qv_natural" # fails due to sign error. Not sure why
|
|
]
|
|
++ lib.optionals (lib.versionAtLeast matplotlib.version "3.4.0") [ "test_plot_circuit_layout" ]
|
|
# Disabling slow tests for build constraints
|
|
++ [
|
|
"test_all_examples"
|
|
"test_controlled_random_unitary"
|
|
"test_controlled_standard_gates_1"
|
|
"test_jupyter_jobs_pbars"
|
|
"test_lookahead_swap_higher_depth_width_is_better"
|
|
"test_move_measurements"
|
|
"test_job_monitor"
|
|
"test_wait_for_final_state"
|
|
"test_multi_controlled_y_rotation_matrix_basic_mode"
|
|
"test_two_qubit_weyl_decomposition_abc"
|
|
"test_isometry"
|
|
"test_parallel"
|
|
"test_random_state"
|
|
"test_random_clifford_valid"
|
|
"test_to_matrix"
|
|
"test_block_collection_reduces_1q_gate"
|
|
"test_multi_controlled_rotation_gate_matrices"
|
|
"test_block_collection_runs_for_non_cx_bases"
|
|
"test_with_two_qubit_reduction"
|
|
"test_basic_aer_qasm"
|
|
"test_hhl"
|
|
"test_H2_hamiltonian"
|
|
"test_max_evals_grouped_2"
|
|
"test_qaoa_qc_mixer_4"
|
|
"test_abelian_grouper_random_2"
|
|
"test_pauli_two_design"
|
|
"test_shor_factoring"
|
|
"test_sample_counts_memory_ghz"
|
|
"test_two_qubit_weyl_decomposition_ab0"
|
|
"test_sample_counts_memory_superposition"
|
|
"test_piecewise_polynomial_function"
|
|
"test_piecewise_chebyshev_mutability"
|
|
"test_bit_conditional_no_cregbundle"
|
|
"test_gradient_wrapper2"
|
|
"test_two_qubit_weyl_decomposition_abmb"
|
|
"test_two_qubit_weyl_decomposition_abb"
|
|
"test_vqe_qasm"
|
|
"test_dag_from_networkx"
|
|
"test_defaults_to_dict_46"
|
|
];
|
|
|
|
# Moves tests to $PACKAGEDIR/test. They can't be run from /build because of finding
|
|
# cythonized modules and expecting to find some resource files in the test directory.
|
|
preCheck = ''
|
|
export PACKAGEDIR=$out/${python.sitePackages}
|
|
echo "Moving Qiskit test files to package directory"
|
|
cp -r $TMP/$sourceRoot/test $PACKAGEDIR
|
|
cp -r $TMP/$sourceRoot/examples $PACKAGEDIR
|
|
|
|
# run pytest from Nix's $out path
|
|
pushd $PACKAGEDIR
|
|
'';
|
|
postCheck = ''
|
|
rm -r test
|
|
rm -r examples
|
|
popd
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Provides the foundations for Qiskit";
|
|
longDescription = ''
|
|
Allows the user to write quantum circuits easily, and takes care of the constraints of real hardware.
|
|
'';
|
|
homepage = "https://qiskit.org/terra";
|
|
downloadPage = "https://github.com/QISKit/qiskit-terra/releases";
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
};
|
|
}
|