Skip to content

Conversation

Abeeujah
Copy link

@Abeeujah Abeeujah commented Sep 20, 2025

Closes #1367

There were two causes of Circular Import Error,

  • int_from_bytes: The root cause is a circular dependency involving starknet_py.common and other starknet_py modules. The traceback states: cannot import name 'int_from_bytes' from partially initialized module 'starknet_py.common'.
  • HEX_PREFIX = "0x": This creates a circular dependency between starknet_py.hash.address and starknet_py.hash.utils when running the module starknet_py/tests/e2e/fixtures/clients.py.
    CasmClassSchema, Felt ...

Introduced changes

Fixing this was moving RevisionField out of common to a separate module.

  • This PR contains breaking changes

… declaration in revisions module to prevent circular imports from occuring
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.26%. Comparing base (345b0ba) to head (a0de442).
⚠️ Report is 208 commits behind head on development.

Files with missing lines Patch % Lines
starknet_py/net/schemas/revision.py 33.33% 12 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           development    #1654       +/-   ##
================================================
- Coverage        96.97%   63.26%   -33.72%     
================================================
  Files               93      120       +27     
  Lines             4766     7091     +2325     
================================================
- Hits              4622     4486      -136     
- Misses             144     2605     +2461     
Files with missing lines Coverage Δ
starknet_py/hash/outside_execution.py 60.00% <100.00%> (ø)
starknet_py/net/models/typed_data.py 100.00% <100.00%> (ø)
starknet_py/net/schemas/common.py 44.59% <ø> (-41.98%) ⬇️
starknet_py/utils/typed_data.py 33.15% <100.00%> (-65.77%) ⬇️
starknet_py/net/schemas/revision.py 33.33% <33.33%> (ø)

... and 71 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Move Revision enum from schemas/common.py
1 participant