Fix #122: Remote mode fails on Windows ARM64 (win_arm64) — cryptograp...#166
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Review Summary by QodoFix Windows ARM64 remote mode by pinning cryptography to <=46.0.3
WalkthroughsDescription• Tightened cryptography upper bound from <=46.0.6 to <=46.0.3 - Restores Windows ARM64 wheel availability for remote mode • Added test to prevent silent drift of cryptography version pin - Validates upper bound remains at <=46.0.3 for win_arm64 support Diagramflowchart LR
A["cryptography <=46.0.6"] -->|"tighten bound"| B["cryptography <=46.0.3"]
B -->|"restores"| C["win_arm64 wheels available"]
C -->|"enables"| D["Remote mode on Windows ARM64"]
E["New test"] -->|"validates"| B
File Changes1. pyproject.toml
|
Code Review by Qodo
1. Overlong f-string assertion message
|
| # Only 46.0.0–46.0.3 ship pre-built win_arm64 wheels; versions above | ||
| # 46.0.3 force a source build that fails on ARM64. | ||
| assert "<=46.0.3" in crypto_spec, ( | ||
| f"cryptography upper bound must be <=46.0.3 for win_arm64 support, got: {crypto_spec!r}" |
There was a problem hiding this comment.
1. Overlong f-string assertion message 📘 Rule violation ⚙ Maintainability
The new assertion message f-string exceeds the 100-character Ruff line-length convention. This will cause formatting/lint noise or CI failures where Ruff is enforced.
Agent Prompt
## Issue description
A newly added f-string assertion message exceeds the 100-character line length expected by Ruff formatting.
## Issue Context
The repository requires Ruff-compatible formatting with 100-char lines.
## Fix Focus Areas
- tests/test_main.py[20-22]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| class TestCryptographyPin: | ||
| """Ensure the cryptography upper-bound stays within the win_arm64 wheel range.""" | ||
|
|
||
| def test_cryptography_upper_bound_has_arm64_wheels(self): |
There was a problem hiding this comment.
2. New test missing type hints 📘 Rule violation ⚙ Maintainability
The newly added test method has no parameter/return type annotations. This violates the requirement that all new/modified functions include type hints.
Agent Prompt
## Issue description
A new test method was added without type hints on its signature.
## Issue Context
Compliance requires type hints for all new/modified functions (parameters and return type).
## Fix Focus Areas
- tests/test_main.py[13-13]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # This pin must stay in `dependencies` (not just [tool.uv]) so it is respected | ||
| # when installing from PyPI via pip or uvx, not only during local uv sync. | ||
| "cryptography>=46.0.0,<=46.0.6", | ||
| "cryptography>=46.0.0,<=46.0.3", |
There was a problem hiding this comment.
3. Lockfile still pins 46.0.6 🐞 Bug ☼ Reliability
pyproject.toml now caps cryptography at <=46.0.3, but uv.lock still locks cryptography==46.0.6 (and even records <=46.0.6 in windows-mcp metadata). This can cause `uv sync` to continue resolving 46.0.6 (or fail due to constraint mismatch), so the win_arm64 install path may remain broken for developers using the committed lockfile.
Agent Prompt
### Issue description
`pyproject.toml` now requires `cryptography<=46.0.3`, but `uv.lock` still pins `cryptography==46.0.6` and records the old `<=46.0.6` metadata. This mismatch can prevent `uv sync` from producing an environment that actually honors the new bound.
### Issue Context
The PR’s goal is to avoid wheel-less cryptography versions on win_arm64. Developers using `uv sync` rely on `uv.lock`, so it must be updated to reflect the new constraint.
### Fix Focus Areas
- uv.lock[249-256]
- uv.lock[1911-1950]
### What to do
1. Run the project’s lock regeneration (e.g., `uv lock` / `uv sync` with lock update) so cryptography resolves within `<=46.0.3`.
2. Commit the resulting `uv.lock` changes.
3. (Optional) Add/adjust a test to also assert the lockfile doesn’t contradict `pyproject.toml` for this constraint.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Thanks |
Closes #122
Motivation
cryptographyversions 46.0.4–46.0.6 dropped pre-builtwin_arm64wheels, causing the extension to attempt a source build (requiringcffi/Rust toolchain) even in remote mode where no local Python crypto is needed. Pinning the upper bound to<=46.0.3restores the last release that ships awin_arm64wheel on PyPI.Changes
pyproject.tomlcryptographyupper bound from<=46.0.6to<=46.0.3. The existing comment already documents why this pin lives independenciesrather than[tool.uv]; this change aligns the version ceiling with that documented rationale.tests/test_main.pypathlib.Pathandtomllib(stdlib, Python 3.11+).TestCryptographyPinwithtest_cryptography_upper_bound_has_arm64_wheels: readspyproject.tomldirectly, locates thecryptographyspecifier inproject.dependencies, and asserts<=46.0.3is present. This prevents the bound from silently drifting upward into a wheel-less release during future dependency bumps.Testing
The new test guards the pin mechanically:
Manual verification: on a Windows 11 ARM64 machine (Snapdragon X Elite),
uv syncnow resolves tocryptography==46.0.3and downloads the pre-builtcryptography-46.0.3-cp311-cp311-win_arm64.whlwithout invoking the Rust/CFFI toolchain.This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.