patrick-kidger / patrick-kidger/jaxtyping

internal `_typeguard` not picked up by `install_import_hook`

Open
#274 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
1.9k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Hi Patrick! With the recent shipping of typeguard in jaxtyping as of this recent commit, I'm getting ModuleNotFoundError: No module named 'typeguard' in the context of

with install_import_hook("...", "typeguard.typechecked"):
    ...

Am I doing things right here? If it was desired to pick up the internally shipped typeguard, then maybe doing some sort of check here to see if there's a typeguard version in the env already (and use jaxtyping._typeguard if not) would be useful.

What do you think?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at jaxtyping/_import_hook.py around line 95 and reproduce the ModuleNotFoundError from install_import_hook("...", "typeguard.typechecked"). Trace how the hook resolves typeguard versus jaxtyping._typeguard, then verify the chosen behavior in the environment where typeguard is not separately installed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.