Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -48,10 +48,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -80,11 +80,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']
os: [ "macos-latest", "ubuntu-latest", "windows-latest" ]
exclude:
- os: "macos-latest"
python-version: 3.9
python-version: '3.10'
env:
LOG_LEVEL: DEBUG
STREAM_LOG: True
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
python-version: [ '3.10' ]
os: [ "ubuntu-latest" ]
environment: ["ibm-cloud-production" ]
environment: ${{ matrix.environment }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id-token: write
strategy:
matrix:
python-version: [3.9]
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9.12'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-qiskit-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
python-version: [ '3.10' ]
os: [ "ubuntu-latest" ]
environment: ["ibm-cloud-production", "ibm-cloud-staging" ]
environment: ${{ matrix.environment }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
python-version: [ '3.10' ]
os: [ "ubuntu-latest" ]
environment: ["ibm-cloud-production", "ibm-cloud-staging" ]
environment: ${{ matrix.environment }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
python-version: [ '3.10' ]
os: [ "ubuntu-latest" ]
environment: [ "ibm-cloud-production", "ibm-cloud-staging" ]
environment: ${{ matrix.environment }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests-terra-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ classifiers=[
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -80,7 +79,7 @@ classifiers=[

keywords = ["qiskit", "sdk", "quantum", "api", "runtime", "ibm"]

requires-python=">=3.9"
requires-python=">=3.10"

dependencies = [
"requests>=2.19",
Expand Down
9 changes: 0 additions & 9 deletions qiskit_ibm_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,3 @@
"""The environment variable name that is used to set the level for the IBM Quantum logger."""
QISKIT_IBM_RUNTIME_LOG_FILE = "QISKIT_IBM_RUNTIME_LOG_FILE"
"""The environment variable name that is used to set the file for the IBM Quantum logger."""

if sys.version_info < (3, 10):
warnings.warn(
"Using qiskit-ibm-runtime with Python 3.9 is deprecated as of the 0.41.0 release. "
"Support for running qiskit-ibm-runtime with Python 3.9 will be removed in a future "
"release.",
DeprecationWarning,
stacklevel=2,
)
64 changes: 0 additions & 64 deletions qiskit_ibm_runtime/qiskit_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,33 +1138,6 @@ def jobs(

return [self._decode_job(job) for job in job_responses]

def delete_job(self, job_id: str) -> None:
"""(DEPRECATED) Delete a runtime job.

Note that this operation cannot be reversed.

Args:
job_id: ID of the job to delete.

Raises:
RuntimeJobNotFound: The job doesn't exist.
IBMRuntimeError: Method is not supported.
"""

warnings.warn(
"The delete_job() method is deprecated and will be removed in a future release. "
"The new IBM Quantum Platform does not support deleting jobs.",
DeprecationWarning,
stacklevel=2,
)

try:
self._active_api_client.job_delete(job_id)
except RequestsApiError as ex:
if ex.status_code == 404:
raise RuntimeJobNotFound(f"Job not found: {ex.message}") from None
raise IBMRuntimeError(f"Failed to delete job: {ex}") from None

def usage(self) -> Dict[str, Any]:
"""Return usage information for the current active instance.

Expand Down Expand Up @@ -1218,43 +1191,6 @@ def _decode_job(self, raw_data: Dict) -> RuntimeJobV2:
private=raw_data.get("private", False),
)

def check_pending_jobs(self) -> None:
"""(DEPRECATED) Check the number of pending jobs and wait for the oldest pending job if
the maximum number of pending jobs has been reached.
"""

warnings.warn(
"The check_pending_jobs() method is deprecated and will be removed in a future release. "
"The new IBM Quantum Platform does not support this functionality.",
DeprecationWarning,
stacklevel=2,
)

try:
usage = self.usage().get("byInstance")[0]
pending_jobs = usage.get("pendingJobs")
max_pending_jobs = usage.get("maxPendingJobs")
if pending_jobs >= max_pending_jobs:
oldest_running = self.jobs(limit=1, descending=False, pending=True)
if oldest_running:
logger.warning(
"The pending jobs limit has been reached. "
"Waiting for job %s to finish before submitting the next one.",
oldest_running[0],
)
try:
oldest_running[0].wait_for_final_state(timeout=300)

except Exception as ex: # pylint: disable=broad-except
logger.debug(
"An error occurred while waiting for job %s to finish: %s",
oldest_running[0].job_id(),
ex,
)

except Exception as ex: # pylint: disable=broad-except
logger.warning("Unable to retrieve open plan pending jobs details. %s", ex)

def least_busy(
self,
min_num_qubits: Optional[int] = None,
Expand Down
2 changes: 2 additions & 0 deletions release-notes/unreleased/2439.other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The deprecated methods ``check_pending_jobs()`` and ``delete_job()`` methods along with
support for python 3.9 have been removed.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source = qiskit_ibm_runtime

[mypy]
python_version = 3.8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh

python_version = 3.10
namespace_packages = True
ignore_missing_imports = True
warn_redundant_casts = True
Expand Down
2 changes: 0 additions & 2 deletions test/ibm_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ def tearDown(self) -> None:
for job in self.to_cancel[service.channel]:
with suppress(Exception):
job.cancel()
with suppress(Exception):
service.delete_job(job.job_id())


class IBMIntegrationJobTestCase(IBMIntegrationTestCase):
Expand Down
34 changes: 1 addition & 33 deletions test/integration/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@
import random
import time

from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager

from qiskit_ibm_runtime.exceptions import (
RuntimeInvalidStateError,
RuntimeJobNotFound,
)

from ..ibm_test_case import IBMIntegrationJobTestCase
from ..decorators import run_integration_test, production_only
from ..serialization import (
SerializableClass,
)
from ..utils import cancel_job_safe, wait_for_status, get_real_device, bell
from ..utils import cancel_job_safe, wait_for_status


class TestIntegrationJob(IBMIntegrationJobTestCase):
Expand Down Expand Up @@ -87,35 +84,6 @@ def test_cancel_job_done(self, service):
with self.assertRaises(RuntimeInvalidStateError):
job.cancel()

@run_integration_test
def test_delete_job(self, service):
"""Test deleting a job."""
self.skipTest("Deleting jobs not supported on IBM Quantum Platform.")
sub_tests = ["DONE"]
for status in sub_tests:
with self.subTest(status=status):
job = self._run_program(service)
wait_for_status(job, status)
service.delete_job(job.job_id())
with self.assertRaises(RuntimeJobNotFound):
service.job(job.job_id())

@run_integration_test
@production_only
def test_delete_job_queued(self, service):
"""Test deleting a queued job."""
self.skipTest("Deleting jobs not supported on IBM Quantum Platform.")
real_device_name = get_real_device(service)
real_device = service.backend(real_device_name)
pm = generate_preset_pass_manager(optimization_level=1, target=real_device.target)
isa_circuit = pm.run([bell()])
_ = self._run_program(service, circuits=isa_circuit, backend=real_device_name)
job = self._run_program(service, circuits=isa_circuit, backend=real_device_name)
wait_for_status(job, "QUEUED")
service.delete_job(job.job_id())
with self.assertRaises(RuntimeJobNotFound):
service.job(job.job_id())

@run_integration_test
def test_job_status(self, service):
"""Test job status."""
Expand Down
11 changes: 0 additions & 11 deletions test/unit/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from qiskit_ibm_runtime.constants import API_TO_JOB_ERROR_MESSAGE
from qiskit_ibm_runtime.exceptions import (
RuntimeJobFailureError,
RuntimeJobNotFound,
RuntimeJobMaxTimeoutError,
RuntimeInvalidStateError,
)
Expand Down Expand Up @@ -145,13 +144,3 @@ def test_wait_for_final_state(self, service):
with mock_wait_for_final_state(service, job):
job.wait_for_final_state()
self.assertEqual("DONE", job.status())

@run_cloud_fake
def test_delete_job(self, service):
"""Test deleting a job."""
params = {"param1": "foo"}
job = run_program(service=service, inputs=params)
self.assertTrue(job.job_id())
service.delete_job(job.job_id())
with self.assertRaises(RuntimeJobNotFound):
service.job(job.job_id())