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
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ permissions:
jobs:
build-sdist:
name: 🐍 Packaging
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12

build-wheel:
name: 🐍 Packaging
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:
jobs:
change-detection:
name: 🔍 Change
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12

python-tests:
name: 🐍 Test
Expand All @@ -36,15 +36,15 @@ jobs:
macos-15-intel,
windows-2025,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12
with:
runs-on: ${{ matrix.runs-on }}

python-coverage:
name: 🐍 Coverage
needs: [change-detection, python-tests]
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12
permissions:
contents: read
id-token: write
Expand All @@ -53,7 +53,7 @@ jobs:
name: 🐍 Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12
with:
enable-ty: true
enable-mypy: false
Expand All @@ -62,13 +62,13 @@ jobs:
name: 🚀 CD
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cd)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12

build-wheel:
name: 🚀 CD
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cd)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12

# this job does nothing and is only used for branch protection
required-checks-pass:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
fail-fast: false
matrix:
runs-on: [ubuntu-24.04, macos-15, windows-2025]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12
with:
runs-on: ${{ matrix.runs-on }}

create-issue-on-failure:
name: Create issue on failure
needs: qiskit-upstream-tests
if: ${{ always() }}
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@d6314c45667c131055a0389afc110e8dedc6da3f # v1.17.11
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@c54be38945ae206affae9925ecd9c346f54c71b7 # v1.17.12
with:
tests-result: ${{ needs.qiskit-upstream-tests.result }}
permissions:
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ repos:

## Check the pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2026.02.15
rev: 2026.02.21
hooks:
- id: validate-pyproject
priority: 0

## Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.1
rev: 0.36.2
hooks:
- id: check-github-workflows
priority: 0
Expand All @@ -56,7 +56,7 @@ repos:

## Check for spelling
- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.43.4
rev: v1.43.5
hooks:
- id: typos
priority: 0
Expand All @@ -78,7 +78,7 @@ repos:

## Ensure uv lock file is up-to-date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.10.2
rev: 0.10.4
hooks:
- id: uv-lock
priority: 0
Expand Down Expand Up @@ -114,7 +114,7 @@ repos:

## Python linting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
rev: v0.15.2
hooks:
- id: ruff-format
priority: 1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dev = [
{include-group = "test"},
"nox>=2025.11.12",
"prek>=0.2.27",
"ty==0.0.17",
"ty==0.0.18",
]

[project.scripts]
Expand Down
14 changes: 7 additions & 7 deletions src/mqt/bench/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from __future__ import annotations

from datetime import date
import datetime
from enum import Enum
from importlib import metadata
from io import TextIOBase
Expand Down Expand Up @@ -78,11 +78,11 @@ def generate_header(
" pip install mqt.bench\n\n"
f"and try again. (Original error: {exc})"
)
raise MQTBenchExporterError(msg) from None
raise MQTBenchExporterError(msg) from exc

lines: list[str] = []
lines.extend((
f"// Benchmark created by MQT Bench on {date.today()}",
f"// Benchmark created by MQT Bench on {datetime.datetime.now(tz=datetime.timezone.utc).date()}",
"// For more info: https://mqt-bench.app/",
f"// MQT Bench version: {version}",
f"// Qiskit version: {__qiskit_version__}",
Expand Down Expand Up @@ -156,7 +156,7 @@ def write_circuit(
(dump2 if fmt is OutputFormat.QASM2 else dump3)(qc, destination)
except Exception as exc: # pragma: no cover - unforeseen I/O
msg = f"Failed to write QASM stream. (Original error: {exc})"
raise MQTBenchExporterError(msg) from None
raise MQTBenchExporterError(msg) from exc
return

if fmt is OutputFormat.QPY:
Expand All @@ -167,7 +167,7 @@ def write_circuit(
dump_qpy(_attach_metadata(qc, header), destination)
except Exception as exc:
msg = f"Failed to write QPY stream. (Original error: {exc})"
raise MQTBenchExporterError(msg) from None
raise MQTBenchExporterError(msg) from exc
return

msg = f"Unsupported output format {fmt}. Supported formats are {[m.value for m in OutputFormat]}."
Expand All @@ -180,15 +180,15 @@ def write_circuit(
(dump2 if fmt is OutputFormat.QASM2 else dump3)(qc, f)
except Exception as exc:
msg = f"Failed to write {fmt.value.upper()} file to {destination}. (Original error: {exc})"
raise MQTBenchExporterError(msg) from None
raise MQTBenchExporterError(msg) from exc

elif fmt is OutputFormat.QPY:
try:
with destination.open("wb") as f:
dump_qpy(_attach_metadata(qc, header), f)
except Exception as exc:
msg = f"Failed to write QPY file to {destination}. (Original error: {exc})"
raise MQTBenchExporterError(msg) from None
raise MQTBenchExporterError(msg) from exc

else:
msg = f"Unsupported output format {fmt}. Supported formats are {[m.value for m in OutputFormat]}."
Expand Down
8 changes: 5 additions & 3 deletions tests/test_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from __future__ import annotations

import builtins
import datetime
import functools
import io
import re
from datetime import date
from enum import Enum
from importlib import metadata
from pathlib import Path
Expand Down Expand Up @@ -668,7 +668,7 @@ def test_generate_header_minimal(monkeypatch: pytest.MonkeyPatch) -> None:
hdr = generate_header(OutputFormat.QASM3, BenchmarkLevel.INDEP)
lines = hdr.splitlines()
# first line has today's date
assert lines[0] == f"// Benchmark created by MQT Bench on {date.today()}"
assert lines[0] == f"// Benchmark created by MQT Bench on {datetime.datetime.now(tz=datetime.timezone.utc).date()}"
# contains the fixed info lines
assert "// For more info: https://mqt-bench.app/" in hdr
assert "// MQT Bench version: 9.9.9" in hdr
Expand Down Expand Up @@ -756,7 +756,9 @@ def test_write_circuit_qpy(tmp_path: Path) -> None:
assert isinstance(circ, QuantumCircuit)

header = circ.metadata["mqt_bench"]
assert header.startswith(f"// Benchmark created by MQT Bench on {date.today()}")
assert header.startswith(
f"// Benchmark created by MQT Bench on {datetime.datetime.now(tz=datetime.timezone.utc).date()}"
)
assert "// MQT Bench version:" in header
assert "// Output format: qpy" in header

Expand Down
Loading
Loading