diff --git a/pkgs/development/python-modules/pyquil/default.nix b/pkgs/development/python-modules/pyquil/default.nix index 00351c5dc516..72ba19f8a2e8 100644 --- a/pkgs/development/python-modules/pyquil/default.nix +++ b/pkgs/development/python-modules/pyquil/default.nix @@ -12,7 +12,9 @@ , pytest-httpx , pytest-mock , pytestCheckHook +, pythonAtLeast , pythonOlder +, pythonRelaxDepsHook , qcs-api-client , respx , retry @@ -24,7 +26,7 @@ buildPythonPackage rec { pname = "pyquil"; - version = "3.3.2"; + version = "3.3.3"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -32,12 +34,17 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "rigetti"; repo = pname; - rev = "v${version}"; - hash = "sha256-Ur7dRxmnaAWXHk7c6NC3lBw59RRgh9vwAHFW00fViD4="; + rev = "refs/tags/v${version}"; + hash = "sha256-jA6nYQSfdxd9FCTMQlYTe/EbV39vV0h9F9Fgf1M0+SY="; }; + pythonRelaxDeps = [ + "lark" + ]; + nativeBuildInputs = [ poetry-core + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -55,21 +62,18 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ + pytestCheckHook + ]; + + checkInputs = [ pytest-asyncio pytest-freezegun pytest-httpx pytest-mock - pytestCheckHook respx ipython ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'lark = "^0.11.1"' 'lark = "*"' \ - --replace 'qcs-api-client = ">=0.8.1,<0.21.0"' 'qcs-api-client = "*"' - ''; - disabledTestPaths = [ # Tests require network access "test/e2e/" @@ -85,6 +89,8 @@ buildPythonPackage rec { "test/unit/test_reference_wavefunction.py" # Out-dated "test/unit/test_qpu_client.py" + "test/unit/test_qvm_client.py" + "test/unit/test_reference_density.py" ]; disabledTests = [ @@ -102,6 +108,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python library for creating Quantum Instruction Language (Quil) programs"; homepage = "https://github.com/rigetti/pyquil"; + changelog = "https://github.com/rigetti/pyquil/blob/v${version}/CHANGELOG.md"; license = licenses.asl20; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/qcs-api-client/default.nix b/pkgs/development/python-modules/qcs-api-client/default.nix index 74b688c232f4..48b0e0ac7e04 100644 --- a/pkgs/development/python-modules/qcs-api-client/default.nix +++ b/pkgs/development/python-modules/qcs-api-client/default.nix @@ -11,7 +11,9 @@ , pytest-asyncio , pytestCheckHook , python-dateutil +, pythonAtLeast , pythonOlder +, pythonRelaxDepsHook , respx , retrying , rfc3339 @@ -20,7 +22,7 @@ buildPythonPackage rec { pname = "qcs-api-client"; - version = "0.21.2"; + version = "0.21.3"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -29,11 +31,26 @@ buildPythonPackage rec { owner = "rigetti"; repo = "qcs-api-client-python"; rev = "refs/tags/v${version}"; - hash = "sha256-gQow1bNRPhUm4zRu2T5FpcgOTcS2F1TQIz8WP1K0Xww="; + hash = "sha256-GEsCyqawLX6fTICjAOOREsO5FsmV6U/5+sDOW1v+VKE="; }; + patches = [ + # Switch to poetry-core, https://github.com/rigetti/qcs-api-client-python/pull/2 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/rigetti/qcs-api-client-python/commit/32f0b3c7070a65f4edf5b2552648d88435469e44.patch"; + hash = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ="; + }) + ]; + + pythonRelaxDeps = [ + "attrs" + "httpx" + ]; + nativeBuildInputs = [ poetry-core + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -54,32 +71,8 @@ buildPythonPackage rec { respx ]; - patches = [ - # Switch to poetry-core, https://github.com/rigetti/qcs-api-client-python/pull/2 - (fetchpatch { - name = "switch-to-poetry-core.patch"; - url = "https://github.com/rigetti/qcs-api-client-python/commit/32f0b3c7070a65f4edf5b2552648d88435469e44.patch"; - hash = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ="; - }) - ]; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'attrs = "^20.1.0"' 'attrs = "*"' \ - --replace 'httpx = "^0.15.0"' 'httpx = "*"' \ - --replace 'iso8601 = "^0.1.13"' 'iso8601 = "*"' \ - --replace 'pydantic = "^1.7.2"' 'pydantic = "*"' \ - --replace 'pyjwt = "^1.7.1"' 'pyjwt = "*"' - ''; - - disabledTestPaths = [ - # Test is outdated - "tests/test_client/test_additional_properties.py" - "tests/test_client/test_auth.py" - "tests/test_client/test_client.py" - "tests/test_client/test_datetime.py" - "tests/test_imports.py" - ]; + # Tests are failing on Python 3.11, Fatal Python error: Aborted + doCheck = !(pythonAtLeast "3.11"); pythonImportsCheck = [ "qcs_api_client" @@ -88,6 +81,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python library for accessing the Rigetti QCS API"; homepage = "https://qcs-api-client-python.readthedocs.io/"; + changelog = "https://github.com/rigetti/qcs-api-client-python/releases/tag/v${version}"; license = licenses.asl20; maintainers = with maintainers; [ fab ]; };