Skip to content

Commit

Permalink
Implement and enforce explicit re-export for cirq modules (#6722)
Browse files Browse the repository at this point in the history
* Enable and enforce the `no_implicit_reexport` mypy rule for cirq modules
* Update `__init__.py` files so they explicitly re-export public symbols, but
  do not re-export local symbols or submodules already in parent namespace
* Fix few instances of imports from incorrect modules

Fixes #6717
---------

Co-authored-by: Pavol Juhas <juhas@google.com>
  • Loading branch information
ashiq-firoz and pavoljuhas authored Sep 11, 2024
1 parent 9edb957 commit 2adc218
Show file tree
Hide file tree
Showing 81 changed files with 2,014 additions and 1,616 deletions.
10 changes: 6 additions & 4 deletions cirq-aqt/cirq_aqt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

"""Types and methods related to the AQT ion trap device"""

from cirq_aqt._version import __version__

from cirq_aqt.aqt_sampler import AQTSampler, AQTSamplerLocalSimulator
from cirq_aqt.aqt_device import AQTSimulator
from cirq_aqt._version import __version__ as __version__
from cirq_aqt.aqt_sampler import (
AQTSampler as AQTSampler,
AQTSamplerLocalSimulator as AQTSamplerLocalSimulator,
)
from cirq_aqt.aqt_device import AQTSimulator as AQTSimulator
2 changes: 1 addition & 1 deletion cirq-aqt/cirq_aqt/json_test_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# cirq/protocols/json_serialization_test.py which checks for coverage of
# public classes and tests the correctness of repr and json results

from cirq_aqt.json_test_data.spec import TestSpec
from cirq_aqt.json_test_data.spec import TestSpec as TestSpec
Loading

0 comments on commit 2adc218

Please sign in to comment.