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
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:

steps:
- id: classify
uses: qiboteam/workflows/actions/docs/version@v2
uses: qiboteam/workflows/actions/docs/version@uv
Comment thread
RoyStegeman marked this conversation as resolved.

deploy-docs:
needs: [version]
uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2
uses: qiboteam/workflows/.github/workflows/latest-stable.yml@uv
with:
python-version: "3.11"
trigger-label: "${{needs.version.outputs.version}}"
project: qibolab
poetry-extras: --with docs --all-extras
uv-extras: --no-dev --group docs --all-extras
15 changes: 4 additions & 11 deletions .github/workflows/selfhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,15 @@ jobs:
run: |
rm -rf _work/*
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
Comment thread
RoyStegeman marked this conversation as resolved.
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
with:
python-version: "3.11"
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install qibolab main
run: |
python -m venv testenv
source testenv/bin/activate
poetry install --no-interaction --all-extras --with tests
run: uv sync --all-extras --group tests
- name: Execute on ${{ matrix.platform }}
run: |
source testenv/bin/activate
source .venv/bin/activate
export platform=${{ matrix.platform }}
git clone https://github.com/qiboteam/qibolab_platforms_qrc
queues=`cat qibolab_platforms_qrc/queues.json`
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13"]
uses: qiboteam/workflows/.github/workflows/test.yml@v2
uses: qiboteam/workflows/.github/workflows/test.yml@uv
Comment thread
RoyStegeman marked this conversation as resolved.
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
doctests: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version != '3.11'}}
poetry-extras: "--with docs,tests,analysis --all-extras"
uv-extras: "--no-dev --group docs --group tests --group analysis --all-extras"
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13"]
uses: qiboteam/workflows/.github/workflows/wheels.yml@v2
uses: qiboteam/workflows/.github/workflows/wheels.yml@uv
Comment thread
RoyStegeman marked this conversation as resolved.
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
publish: ${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
poetry-extras: "--with docs,tests,analysis --all-extras"
uv-extras: "--no-dev --group docs --group tests --group analysis --all-extras"
secrets: inherit
8 changes: 8 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
#
autodoc_member_order = "bysource"

# Do not reconstruct annotations from source/type comments. This can add
# Pydantic's internal types to Qibolab classes, while those types may not be
# defined in files where Qibolab is used, causing subsequently built models
# to be incomplete.
# NOTE: In Sphinx 10 this will default, and thus once that becomes the dependency this
# line can be removed.
autodoc_use_type_comments = False


# app setup hook

Expand Down
6 changes: 3 additions & 3 deletions doc/source/getting-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Then, to install the package

pip install .

- otherwise, to modify the source code, it is possible to install using ``poetry`` or ``pip``
- otherwise, to modify the source code, it is possible to install using ``uv`` or ``pip``

.. code-block:: bash

poetry install # recommended
pip install -e . # not recommended
uv sync # recommended
pip install -e . # not recommended

_______________________

Expand Down
122 changes: 57 additions & 65 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,79 +1,70 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
[project]
name = "qibolab"
version = "0.2.17"
description = "Quantum hardware module and drivers for Qibo"
authors = ["The Qibo team"]
license = "Apache License 2.0"
authors = [{name = "The Qibo team"}]
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
homepage = "https://qibo.science/"
repository = "https://github.com/qiboteam/qibolab/"
documentation = "https://qibo.science/docs/qibolab/stable"
keywords = []
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Physics",
]
packages = [{ include = "qibolab", from = "src" }]
include = ["src/*.lark"]

[tool.poetry.dependencies]
python = ">=3.11,<3.14"
numpy = "^2.0.0"
scipy = "^1.13.0"
pydantic = "^2.4.0"
qibo = { version = "^0.3.0", optional = true }
qutip = { version = "^5.0.2", optional = true }
dynamiqs = { version = "^0.3.4", optional = true }
pyserial = { version = "^3.5", optional = true }

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pudb = "^2025.1"
ipython = "^8.12.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^8.2"
furo = "^2025.7.19"
sphinxcontrib-bibtex = "^2.5.0"
nbsphinx = "^0.9.1"
ipython = "^8.12.0"
sphinx-copybutton = "^0.5.1"
# extras
qcodes = "^0.52.0"
qcodes_contrib_drivers = "^0.23.0"
qutip = "^5.0.2"

[tool.poetry.group.tests]
optional = true
requires-python = ">=3.11,<3.14"
dependencies = [
"numpy>=2.0.0,<3.0.0",
"scipy>=1.13.0,<2.0.0",
"pydantic>=2.4.0,<3.0.0",
]

[tool.poetry.group.tests.dependencies]
pytest = ">=7.2.2"
pytest-cov = "^4.0.0"
pytest-env = ">=0.8.1"
pytest-mock = ">=3.10.0"
qcodes = "^0.52.0"
qcodes_contrib_drivers = "^0.23.0"
requests = "^2.32.0"
[project.urls]
Homepage = "https://qibo.science/"
Repository = "https://github.com/qiboteam/qibolab/"
Documentation = "https://qibo.science/docs/qibolab/stable"

[tool.poetry.group.analysis]
optional = true
[project.optional-dependencies]
backend = ["qibo>=0.3.0,<0.4.0"]
emulator = ["qutip>=5.0.2,<6.0.0", "dynamiqs>=0.3.4,<0.4.0"]
qrng = ["pyserial>=3.5.0,<4.0.0"]

[tool.poetry.group.analysis.dependencies]
ruff = "^0.16.0"
[dependency-groups]
dev = [
"pudb>=2025.1,<2026.0",
"ipython>=8.12.0,<9.0.0",
]
docs = [
"sphinx>=9.0,<10.0",
"furo>=2025.7.19,<2026.0.0",
"recommonmark>=0.7.1,<0.8.0",
Comment thread
RoyStegeman marked this conversation as resolved.
"sphinxcontrib-bibtex>=2.5.0,<3.0.0",
"sphinx-markdown-tables>=0.0.17,<0.0.18",
"nbsphinx>=0.9.1,<0.10.0",
"ipython>=8.12.0,<9.0.0",
"sphinx-copybutton>=0.5.1,<0.6.0",
# extras
"qcodes>=0.52.0,<0.53.0",
"qcodes_contrib_drivers>=0.23.0,<0.24.0",
"qutip>=5.0.2,<6.0.0",
]
tests = [
"pytest>=7.2.2",
"pytest-cov>=4.0.0,<5.0.0",
"pytest-env>=0.8.1",
"pytest-mock>=3.10.0",
"qcodes>=0.52.0,<0.53.0",
"qcodes_contrib_drivers>=0.23.0,<0.24.0",
"requests>=2.32.0,<3.0.0",
]
analysis = [
"ruff>=0.16.0,<0.17.0",
]

[tool.poetry.extras]
backend = ["qibo"]
emulator = ["qutip", "dynamiqs"]
qrng = ["pyserial"]
[build-system]
requires = ["uv_build>=0.12.9,<0.13.0"]
build-backend = "uv_build"

[tool.poe.tasks]
test = "pytest"
Expand All @@ -86,7 +77,8 @@ lint-warnings = """
types = "true"
docs = "make -C doc html"
docs-clean = "make -C doc clean"
test-docs = "make -C doc doctest"
# make sure doctest run is independent by avoid using a saved/cached environment
Comment thread
RoyStegeman marked this conversation as resolved.
test-docs = "make -C doc doctest SPHINXOPTS='--fresh-env'"

[tool.pytest.ini_options]
testpaths = ['tests/']
Expand Down
5 changes: 4 additions & 1 deletion src/qibolab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ def __getattr__(name: str) -> Any:

return MetaBackend

return globals()[name]
try:
return globals()[name]
except KeyError:
raise AttributeError(f"Module {__name__} has no attribute {name}.")
Comment thread
RoyStegeman marked this conversation as resolved.
Loading
Loading