iqm-finland / KQCircuits

KLayout Python library for integrated quantum circuit design.
GNU General Public License v3.0
134 stars 72 forks source link

Use `importlib.util` for better support #39

Closed nikosavola closed 1 year ago

nikosavola commented 1 year ago

Fix user reported bug for certain environments by being more specific in imports

Closes #38

github-actions[bot] commented 1 year ago

Test results

       6 files  ±0         6 suites  ±0   3m 26s :stopwatch: -31s    261 tests ±0     261 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  1 566 runs  ±0  1 566 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit a6aa73e5. ± Comparison against base commit 49daec4e.

caspar-iqm commented 1 year ago

I think this change is technically required indeed. Even though I never got an error on this, the Pycharm code checker flags this issue on python 3.10.5.

I could imagine the following dynamic behavior: if importlib.util has ever been imported somewhere, it probably exists in the scope of importlib for the remainder of the python session.