Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
CIBW_ARCHS_LINUX: x86_64
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BEFORE_BUILD: bash {project}/bin/cibw/pre_build.sh {project}
CIBW_TEST_EXTRAS: "test,cli"
CIBW_TEST_EXTRAS: "test,cli,pulse"
CIBW_TEST_COMMAND: bash {project}/bin/cibw/test_wheel.sh {project}
CIBW_BUILD_VERBOSITY: 1

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Types of changes:
## Unreleased

### Added
- Added the `pulse` extra dependency to the `pyproject.toml` file, which includes the `openpulse` package. This allows users to install pulse-related functionality when needed. ([#195](https://github.com/qBraid/pyqasm/pull/195))

### Improved / Modified

Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ PyQASM requires Python 3.10 or greater, and can be installed with pip as follows
pip install pyqasm
```

### Optional Dependencies
Comment thread
TheGupta2012 marked this conversation as resolved.

PyQASM provides an optional extra called pyqasm[pulse] that adds pulse/calibration features.

```bash
pip install pyqasm[pulse]
```

PyQASM also offers optional extras for command-line interface (CLI) functionality and for program visualization.

To install the CLI tools:
```bash
pip install pyqasm[cli]
```

To install the visualization tools:
```bash
pip install pyqasm[visualization]
```

### Install from source

You can also install from source by cloning this repository and running a pip install command
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test = ["pytest", "pytest-cov", "pytest-mpl", "matplotlib"]
lint = ["black", "isort>=6.0.0", "pylint", "mypy", "qbraid-cli>=0.10.2"]
docs = ["sphinx>=7.3.7,<8.3.0", "sphinx-autodoc-typehints>=1.24,<3.2", "sphinx-rtd-theme>=2.0.0,<4.0.0", "docutils<0.22", "sphinx-copybutton"]
visualization = ["matplotlib"]
pulse = ["openpulse[parser]>=1.0.1"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good, can you also add a test to make sure that whenever we install pyqasm with the pulse extra, the openpulse library can be correctly imported? It will be good to create a tests/pulse directory which will eventually contain all the tests. Something like test_import.py should suffice for now.


[tool.setuptools.package-data]
pyqasm = ["py.typed", "*.pyx"]
Expand Down
22 changes: 22 additions & 0 deletions tests/pulse/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 qBraid
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for pulse functionality."""

import pytest


def test_openpulse_import():
"""Tests that openpulse can be imported if pyqasm[pulse] is installed."""
pytest.importorskip("openpulse")
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description = Run pytests and generate coverage report.
extras =
test
cli
pulse
commands =
pytest tests --cov=pyqasm --cov-config=pyproject.toml --cov-report=term --cov-report=xml {posargs}

Expand Down