Skip to content

Commit

Permalink
housekeeping updates (#16)
Browse files Browse the repository at this point in the history
* housekeeping updates

* fix tool -> bin

* update changelog
  • Loading branch information
ryanhill1 authored Oct 15, 2024
1 parent ddbb16e commit 2c45f23
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 27 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is being listed as code owner means the user
# will be empowered to approve and merge pull request for
# that directory of code.
#
# PyQASM maintainers
* @TheGupta2012
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: Environment
value: |
- **pyqasm version**:
- **PyQASM version**:
- **Python version**:
- **Operating system**:
validations:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Format
on:
pull_request:
branches: ['main']
types: [opened, reopened, ready_for_review, synchronize]
workflow_dispatch:

jobs:
check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: CI
on:
pull_request:
branches: ['main']
types: [opened, reopened, ready_for_review, synchronize]
push:
branches: ['main']
workflow_dispatch:

jobs:
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -35,6 +37,7 @@ jobs:
path: dist/*.whl

test:
if: github.event.pull_request.draft == false
needs: build
runs-on: ubuntu-latest
strategy:
Expand All @@ -56,7 +59,7 @@ jobs:
- name: Install package wheel with extras
run: |
pip install setuptools
tools/install_wheel_extras.sh dist
bin/install_wheel_extras.sh dist
- name: Run tests with coverage
run: |
pip install pytest pytest-cov
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Types of changes:
### Added

### Improved / Modified
- Housekeeping updates involving codeowners, workflows, pyproject, and readme ([#16](https://github.com/qBraid/pyqasm/pull/16))

### Deprecated

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ classifiers = [
'Operating System :: Unix',
'Operating System :: MacOS',
]
dependencies = ["numpy", "openqasm3[parser]==1.0.0"]
dependencies = ["numpy", "openqasm3[parser]>=1.0.0,<2.0.0"]

[project.urls]
source = "https://github.com/qBraid/pyqasm"
tracker = "https://github.com/qBraid/pyqasm/issues"
"Source Code" = "https://github.com/qBraid/pyqasm"
"Bug Tracker" = "https://github.com/qBraid/pyqasm/issues"

[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
lint = ["black", "isort", "pylint", "mypy", "qbraid-cli>=0.8.5"]
docs = ["sphinx>=7.3.7,<8.1.0", "sphinx-autodoc-typehints>=1.24,<2.5", "sphinx-rtd-theme~=2.0.0", "docutils<0.22", "sphinx-copybutton"]
docs = ["sphinx>=7.3.7,<8.1.0", "sphinx-autodoc-typehints>=1.24,<2.5", "sphinx-rtd-theme>=2.0.0,<3.0.0", "docutils<0.22", "sphinx-copybutton"]

[tool.setuptools_scm]
write_to = "pyqasm/_version.py"
Expand Down
22 changes: 12 additions & 10 deletions pyqasm/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# OpenQASM 3 to QIR
# pyqasm

## Supported conversions status table
Source code for OpenQASM 3 program validator and semantic analyzer

| openqasm3.ast Object Type | Supported | Comment |
## Supported Operations

| `openqasm3.ast` Object Type | Supported | Comment |
| -------------------------------| ----------- | ---------------------- |
| QuantumMeasurementStatement || Complete |
| QuantumReset || Complete |
| QuantumBarrier || Complete |
| QuantumGateDefinition || Complete |
| QuantumGate || Complete |
| QuantumGateModifier || Complete (pow, inv) |
| QuantumMeasurementStatement || Completed |
| QuantumReset || Completed |
| QuantumBarrier || Completed |
| QuantumGateDefinition || Completed |
| QuantumGate || Completed |
| QuantumGateModifier || Completed (pow, inv) |
| QubitDeclaration || Completed |
| Clbit Declarations || Completed |
| BinaryExpression || Completed |
Expand All @@ -23,7 +25,7 @@
| SubroutineDefinition || Completed |
| Looping statements(eg. for) || Completed |
| RangeDefinition || Completed |
| QuantumGate || Complete |
| QuantumGate || Completed |
| QuantumGateModifier (ctrl) | 📋 | Planned |
| IODeclaration | 📋 | Planned |
| Pragma | 📋 | Planned |
Expand Down
2 changes: 0 additions & 2 deletions pyqasm/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#
# THERE IS NO WARRANTY for pyqasm, as per Section 15 of the GPL v3.

# pylint: disable=import-outside-toplevel,cyclic-import

"""
Module with analysis functions for QASM3 visitor
Expand Down
4 changes: 2 additions & 2 deletions pyqasm/unroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def unroll(
program (openqasm3.ast.Program or str): The OpenQASM 3 program to convert.
Returns:
Qasm3Module: An object containing unrolled qasm representation along with some useful
metadata and methods
Qasm3Module: An object containing unrolled qasm representation along with
some useful metadata and methods
Raises:
TypeError: If the input is not a valid OpenQASM 3 program.
Expand Down
4 changes: 2 additions & 2 deletions pyqasm/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""
from __future__ import annotations

from typing import TYPE_CHECKING, Union
from typing import TYPE_CHECKING

import openqasm3

Expand All @@ -26,7 +26,7 @@
import openqasm3.ast


def validate(program: Union[openqasm3.ast.Program, str]) -> None:
def validate(program: openqasm3.ast.Program | str) -> None:
"""Validates a given OpenQASM 3 program for semantic correctness.
Args:
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ envdir = .tox/linters
skip_install = true
deps = isort
commands =
isort . {posargs} pyqasm tests
isort . {posargs} pyqasm tests bin

[testenv:pylint]
envdir = .tox/linters
skip_install = true
deps = pylint
commands =
pylint {posargs} pyqasm tests --disable=R0801,E0401,R0917
pylint {posargs} pyqasm tests bin --disable=R0801,E0401,R0917

[testenv:black]
envdir = .tox/linters
skip_install = true
deps = black[jupyter]
deps = black
commands =
black pyqasm tests {posargs}
black pyqasm tests bin {posargs}

[testenv:mypy]
envdir = .tox/linters
Expand All @@ -57,7 +57,7 @@ envdir = .tox/linters
skip_install = true
deps = qbraid-cli>=0.8.2
commands =
qbraid admin headers tests pyqasm --type=gpl -p pyqasm {posargs}
qbraid admin headers pyqasm tests bin --type=gpl -p pyqasm {posargs}

[testenv:linters]
allowlist_externals = qbraid
Expand Down

0 comments on commit 2c45f23

Please sign in to comment.