rsbowen

Results 8 comments of rsbowen

I did a little more work on this, I monkey-patched to get debug prints: ```python def make_debug_print(f): def _new_f(self, fullname, path=None, target=None): rval = f(self, fullname, path, target) print(f"fullname is...

A little progress, I added this to the top of `right.py`: ```python print(f"=== LOADING package_a.right ===") print(f"Current frame: {inspect.currentframe()}") print(f"Stack trace:") for frame_info in inspect.stack(): print(f" {frame_info.filename}:{frame_info.lineno} in {frame_info.function}") #...

To summarize a little, I think the issue is that `_JaxtypingLoader.exec_module()` monkey-patches `importlib._bootstrap_external.cache_from_source` globally during execution, affecting all module compilations that happen during that time, not just the module being...

I'm not totally sure how to fix, maybe a second Loader one down the stack that restores the original `cache_from_source`?

> Ah excellent, good sleuthing! The chain of events makes sense here. Thanks! > Perhaps we could adjust the monkey-patched `_optimized_cache_from_source` to additionally consume a list of valid paths that...

Just brainstorming here, another possibility is something like this: 1) We could run `_JaxtypingFinder` everywhere, even on modules we don't intend to instrument. So `find_spec` never returns `None`, but instead...

In the meantime, a workaround (which is perhaps a little dangerous, and only works if you are sure about where these `pyc` are going to live) is to add this...

Actually a perhaps cleaner/safer one is: ```python import sys sys.dont_write_bytecode = True ```