quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

Implement and enforce explicit re-export for cirq modules #6722

Closed ashiq-firoz closed 2 weeks ago

ashiq-firoz commented 2 weeks ago

I have updated mypy.ini inside dev_tools and also made modifications in all init.py files to match

from foo import bar as bar

Ref: #6717

ashiq-firoz commented 2 weeks ago

I have made a push now, please review the pull request @pavoljuhas

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.83%. Comparing base (9edb957) to head (7f98fd3). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6722 +/- ## ========================================== - Coverage 97.83% 97.83% -0.01% ========================================== Files 1077 1077 Lines 92487 92485 -2 ========================================== - Hits 90485 90483 -2 Misses 2002 2002 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pavoljuhas commented 2 weeks ago

@ashiq-firoz - I have updated your PR so that the no_implicit_reexport mypy rule is checked only for the cirq modules and not for imported dependencies. I have also cleaned up unnecessary re-exports of sub-modules, which are automatically added to their parent namespace. PTAL and let me know if you have comments / suggestions.

If this passes the CI, I feel it should be good to go.