From 7d7ac583c8e8ad0e8db495a3db9a7b8e18ecc645 Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Thu, 19 Jun 2025 20:22:51 +0200 Subject: [PATCH 1/2] docs: fix syntax highlighting --- pyproject.toml | 3 +++ uv.lock | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9d6b3900..3dcec438 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,3 +77,6 @@ ignore_missing_imports = true [tool.pytest.ini_options] asyncio_default_fixture_loop_scope = "function" + +[tool.uv.sources] +openqasm-pygments = { url = "https://github.com/LEQO-Framework/openqasm-pygments/releases/download/patch-annotation-lexing/openqasm_pygments-0.2.1a0-py3-none-any.whl" } diff --git a/uv.lock b/uv.lock index 40d0551f..7ddd0b75 100644 --- a/uv.lock +++ b/uv.lock @@ -561,7 +561,7 @@ dev = [ { name = "cyclonedx-bom", specifier = ">=6.1.1" }, { name = "mypy", specifier = ">=1.14.1" }, { name = "myst-parser", specifier = ">=4.0.0" }, - { name = "openqasm-pygments", specifier = ">=0.1.2" }, + { name = "openqasm-pygments", url = "https://github.com/LEQO-Framework/openqasm-pygments/releases/download/patch-annotation-lexing/openqasm_pygments-0.2.1a0-py3-none-any.whl" }, { name = "pytest", specifier = ">=8.3.4" }, { name = "pytest-asyncio", specifier = ">=0.26.0" }, { name = "pytest-cov", specifier = ">=6.1.1" }, @@ -769,16 +769,18 @@ wheels = [ [[package]] name = "openqasm-pygments" -version = "0.1.2" -source = { registry = "https://pypi.org/simple" } +version = "0.2.1a0" +source = { url = "https://github.com/LEQO-Framework/openqasm-pygments/releases/download/patch-annotation-lexing/openqasm_pygments-0.2.1a0-py3-none-any.whl" } dependencies = [ { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/81/4c/c4722f133b5bbef71bc8043dc1610bb72d1d724630373f046fa477aa9e3e/openqasm-pygments-0.1.2.tar.gz", hash = "sha256:9740ce2eb13adbb1de53a1bb447eeaf5cc212aeb4560e4dbed6015c8f50e5bf9", size = 56016 } wheels = [ - { url = "https://files.pythonhosted.org/packages/37/61/a69266cbbddd686229947052d672154589bcd5cc3fee1573be8909c657da/openqasm_pygments-0.1.2-py3-none-any.whl", hash = "sha256:b224632f8a535ad81609a991ffd82222330a742c6fbd444ed707f8586653ecc0", size = 18387 }, + { url = "https://github.com/LEQO-Framework/openqasm-pygments/releases/download/patch-annotation-lexing/openqasm_pygments-0.2.1a0-py3-none-any.whl", hash = "sha256:10f2ab5ac307291135250b559fd0889f6c91cd125d8bee999bbec49adef86705" }, ] +[package.metadata] +requires-dist = [{ name = "pygments", specifier = "~=2.0" }] + [[package]] name = "openqasm3" version = "1.0.1" From 2da65f4c79b358189725a1f956e6575a9b4c36f3 Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Thu, 19 Jun 2025 20:32:22 +0200 Subject: [PATCH 2/2] Fix type error --- openqasm3_lexer/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openqasm3_lexer/__init__.py b/openqasm3_lexer/__init__.py index b40aa27f..a35b03ca 100644 --- a/openqasm3_lexer/__init__.py +++ b/openqasm3_lexer/__init__.py @@ -1,4 +1,5 @@ -from openqasm_pygments import OpenQASM2Lexer, OpenQASM3Lexer +from openqasm_pygments.qasm2 import OpenQASM2Lexer +from openqasm_pygments.qasm3 import OpenQASM3Lexer from sphinx.application import Sphinx from sphinx.highlighting import lexers