Skip to content

Update requirements and resolve version incompatibilities - #1927

Open
mhucka wants to merge 9 commits into
quantumlib:mainfrom
mhucka:update-python-packages
Open

Update requirements and resolve version incompatibilities#1927
mhucka wants to merge 9 commits into
quantumlib:mainfrom
mhucka:update-python-packages

Conversation

@mhucka

@mhucka mhucka commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Cloning the repository and doing a uv sync produced an environment where some tests failed locally. I suspect some third-party transitive dependencies may have changed recently. Resolving the failures required constraining two package versions in pyproject.toml. Following the addition of the constraints and refreshing uv.lock, a minor incompatibility arose involving a Matplotlib colormap function used in a notebook.

mhucka added 5 commits August 7, 2026 23:40
In Lark version 1.3.1, `common.py` introduced a runtime `TypeError`:

1. Line 21 defines `_LexerArgType` as a string forward reference:

   ```python
   _LexerArgType: 'TypeAlias' = 'Union[Literal[...], Type[Lexer]]'
   ```

2. Line 37 inside class `LexerConf` evaluates `lexer_type: _LexerArgType | None`

3. Because the module does not use from `__future__ import annotations`,
   Python evaluates `'Union[...]' | None` at module import time, raising
   an exception:

   ```python
   TypeError: unsupported operand type(s) for |: 'str' and 'NoneType'
   ```

4. During pytest test collection, lark is imported by rfc3987_syntax,
   which is imported by jsonschema, which is imported by nbformat, and
   this import would fail with the error above.
This is the result of running `uv sync` after the changes to
`pyproject.toml`.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

mhucka added 3 commits August 7, 2026 18:32
In Matplotlib 3.10+, `Axes.legend()` strictly enforces that handles and
labels must both be passed positionally or both as keyword arguments. In
Cell 12 of resource_estimation.ipynb, an array of integers (`handles =
np.arange(...))` was passed positionally alongside `labels=labels` as a
keyword argument, triggering `TypeError: When passing handles and
labels, they must both be passed positionally or both as keywords`.
@mhucka
mhucka marked this pull request as ready for review August 8, 2026 02:58
@mhucka
mhucka requested review from NoureldinYosri, mpharrigan, tanujkhattar and wjhuggins and removed request for mpharrigan August 8, 2026 02:59
Belongs in a separate PR.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request performs various cleanups and dependency updates, including fixing a relative link in the GitHub problem matchers documentation, pinning dash and lark versions in pyproject.toml to prevent import-time errors, removing unused imports across several modules, and updating a Jupyter Notebook to use matplotlib.colormaps instead of the deprecated matplotlib.cm.get_cmap. The reviewer pointed out critical syntax errors in the Jupyter Notebook's JSON structure where certain lines are missing opening double quotes, which would render the notebook file unparseable.

Comment thread qualtran/surface_code/flasq/examples/ising_notebook.ipynb
Comment thread qualtran/surface_code/flasq/examples/ising_notebook.ipynb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant