Skip to content

Commit

Permalink
Merge pull request #1 from oqtopus-team/feature/python3.10
Browse files Browse the repository at this point in the history
Compatible with python3.10
  • Loading branch information
snuffkin authored Dec 4, 2024
2 parents 61fca41 + 0fd2645 commit 84f083f
Show file tree
Hide file tree
Showing 7 changed files with 443 additions and 17 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.12']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3

Expand All @@ -27,6 +36,7 @@ jobs:
run: uv run pytest

- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12
3.10
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tranqu"
version = "0.1.0"
version = "0.1.1"
description = "Tranqu: A one-stop framework for transpilers across multiple quantum programming libraries and formats for quantum circuits"
readme = "README.md"
license = "Apache-2.0"
Expand All @@ -14,11 +14,13 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
requires-python = ">=3.12"
requires-python = ">=3.10"
dependencies = [
"qiskit>=1.0.0,<1.3.0",
"qiskit_qasm3_import>=0.5.0",
Expand Down
4 changes: 1 addition & 3 deletions src/tranqu/device_converter/device_converter_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def register_converter(
"""
key = (from_lib, to_lib)
if key in self._converters:
msg = f"Converter already registered for conversion from {from_lib} to {
to_lib
}."
msg = f"Converter already registered for conversion from {from_lib} to {to_lib}." # noqa: E501
raise DeviceConverterAlreadyRegisteredError(msg)

self._converters[key] = converter
4 changes: 1 addition & 3 deletions src/tranqu/program_converter/program_converter_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def register_converter(
"""
key = (from_lib, to_lib)
if key in self._converters:
msg = f"Converter already registered for conversion from {from_lib} to {
to_lib
}."
msg = f"Converter already registered for conversion from {from_lib} to {to_lib}." # noqa: E501
raise ProgramConverterAlreadyRegisteredError(msg)

self._converters[key] = converter
8 changes: 2 additions & 6 deletions src/tranqu/transpiler_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ def _convert_program(self, program: Any, from_lib: str, to_lib: Any) -> Any: #
to_lib,
)
if not (can_convert_to_qiskit and can_convert_to_target):
msg = f"No ProgramConverter path found to convert from {from_lib} to {
to_lib
}"
msg = f"No ProgramConverter path found to convert from {from_lib} to {to_lib}" # noqa: E501
raise ProgramConversionPathNotFoundError(msg)

return self._program_converter_manager.fetch_converter(
Expand Down Expand Up @@ -185,9 +183,7 @@ def _convert_device(
to_lib,
)
if not (can_convert_to_qiskit and can_convert_to_target):
msg = f"No DeviceConverter path found to convert from {from_lib} to {
to_lib
}"
msg = f"No DeviceConverter path found to convert from {from_lib} to {to_lib}" # noqa: E501
raise DeviceConversionPathNotFoundError(msg)

return self._device_converter_manager.fetch_converter("qiskit", to_lib).convert(
Expand Down
Loading

0 comments on commit 84f083f

Please sign in to comment.