From a90d78e7d53abc03c64d0708344811cb65ea0f22 Mon Sep 17 00:00:00 2001 From: Caleb Johnson Date: Thu, 10 Oct 2024 11:45:00 -0500 Subject: [PATCH] Add support for py39 (#83) * Add support for py39 * Update source to support py39. Pin a min version for jax/scipy. * Ruff: target python 3.9 * Tell other linters we are on python 3.9 * We do type checking on python 3.10, so set mypy to use it This fixes an issue with checking types for jax * Add python 3.9 to the CI matrix --------- Co-authored-by: Jim Garrison --- .github/workflows/test_latest_versions.yml | 2 +- pyproject.toml | 13 +++++++------ qiskit_addon_sqd/configuration_recovery.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_latest_versions.yml b/.github/workflows/test_latest_versions.yml index cfda3d6..3f4347b 100644 --- a/.github/workflows/test_latest_versions.yml +++ b/.github/workflows/test_latest_versions.yml @@ -20,7 +20,7 @@ jobs: max-parallel: 4 matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] include: - os: macos-latest python-version: "3.12" diff --git a/pyproject.toml b/pyproject.toml index 849f4ac..3871aad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -21,15 +22,15 @@ classifiers = [ ] -requires-python = ">=3.10" +requires-python = ">=3.9" dependencies = [ "qiskit>=1.2", "numpy>=1.26", "pyscf>=2.5", - "jaxlib>=0.4.31", - "jax>=0.4.31", - "scipy>=1.14.1", + "jaxlib>=0.4.30", + "jax>=0.4.30", + "scipy>=1.13.1", ] [project.optional-dependencies] @@ -103,7 +104,7 @@ warn_unused_configs = true ignore_missing_imports = true [tool.pylint.main] -py-version = "3.10" +py-version = "3.9" [tool.pylint."messages control"] disable = ["all"] @@ -126,7 +127,7 @@ testpaths = ["./qiskit_addon_sqd/", "./test/"] [tool.ruff] line-length = 100 src = ["qiskit_addon_sqd", "test"] -target-version = "py310" +target-version = "py39" [tool.ruff.lint] select = [ diff --git a/qiskit_addon_sqd/configuration_recovery.py b/qiskit_addon_sqd/configuration_recovery.py index c3716b2..af97dd3 100644 --- a/qiskit_addon_sqd/configuration_recovery.py +++ b/qiskit_addon_sqd/configuration_recovery.py @@ -108,7 +108,7 @@ def recover_configurations( # First, we need to flip the orbitals such that corrected_dict: defaultdict[str, float] = defaultdict(float) - for bitstring, freq in zip(bitstring_matrix, probabilities, strict=False): + for bitstring, freq in zip(bitstring_matrix, probabilities): bs_corrected = _bipartite_bitstring_correcting( bitstring, avg_occupancies,