Migrate from poetry to uv#108
Open
PhilReinhold wants to merge 3 commits into
Open
Conversation
Convert pyproject.toml to PEP 621 with hatchling backend and a [dependency-groups] dev group. Replace poetry.lock with uv.lock, update CI workflows to use astral-sh/setup-uv, drop the install-poetry Makefile target, and switch the README install command to `uv sync`.
The uv migration pulls in newer mypy (1.4 -> 1.20) and openqasm3/openpulse (0.5 -> 1.0). The newer AST tightens several signatures (List[QuantumStatement] where lists were previously List[Statement|Pragma], IndexedIdentifier|Identifier where Expression was accepted, etc.) and stricter mypy inference flags a few existing issues. Add casts/asserts to bridge the AST narrowing, fix ProgramState.body propagation to the AST, give MergeCalStatementsPass a covariant Sequence parameter, and fix FrameVar passing the FrameType class instead of an instance to OQFunctionCall.
Two new branches dropped coverage to 99.83%: - _get_type's None-type guard was a defensive check for mypy; replace with a cast since all OQPyExpression subclasses that participate in arithmetic set .type during init. - Add a regression test for indexing a ComplexVar-backed ArrayVar, which exercises the new ComplexVar branch in ArrayVar.__getitem__.
Collaborator
Author
|
Note: this MR also touches src/ to fix newly-surfaced mypy errors The poetry → uv switch isn't purely a packaging change — it forced a fresh dependency resolution, which pulled in two upgrades that have stricter type
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert pyproject.toml to PEP 621 with hatchling backend and a [dependency-groups] dev group. Replace poetry.lock with uv.lock, update CI workflows to use astral-sh/setup-uv, drop the install-poetry Makefile target, and switch the README install command to
uv sync.