Skip to content

mypy error: Skipping analyzing "permit": module is installed, but missing library stubs or py.typed marker [import-untyped] #116

Description

@coactive-jeffrey

When using mypy to type check Python code that uses the permit library, I see the following error:

$ mypy .
mymodule.py:9: error: Skipping analyzing "permit": module is installed, but missing library stubs or py.typed marker  [import-untyped]
mymodule.py:9: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 10 source files)
error: Recipe `types` failed on line 58 with exit code 1

Creating PEP 561 compatible packages:

If you would like to publish a library package to a package repository yourself (e.g. on PyPI) for either internal or external use in type checking, packages that supply type information via type comments or annotations in the code should put a py.typed file in their package directory.

Environment

$ python --version
Python 3.12.10
$ mypy --version
mypy 1.15.0 (compiled: yes)
$ pip list | grep permit
permit                    2.7.2

Activity

  1. danyi1212 commented on Apr 29, 2025

    @danyi1212
    Contributor

    Hey @coactive-jeffrey, thank you for reporting that!

    Thank you for reporting that, I'll take try it out and keep you posted about it 🌟

  2. Tarcio0211 commented on Aug 15, 2026

    @Tarcio0211
    Contributor

    Hi! I'd like to work on this issue. I've looked into it and the fix is straightforward: adding a py.typed file to the package and updating the package_data in setup.py. Can I be assigned to this issue?

  3. linear-code commented on Aug 23, 2026

    @linear-code
  4. zeevmoney commented on Sep 28, 2026

    @zeevmoney
    Member

    Thanks @coactive-jeffrey for the report, and thanks @Tarcio0211 for #125. This is fixed on main in #126 and ships in permit 3.0.0. The package now includes a PEP 561 py.typed marker, so mypy analyzes permit instead of skipping it with import-untyped.

    We didn't ship the marker on its own: that would have turned one import error into many false errors on valid code, because the generated models used positional Field defaults, the sync client was typed as coroutines, and methods that accept dicts were annotated as model-only. #126 fixes all three, types the SDK models as the pydantic v1 models they are at runtime on both pydantic majors, and adds a CI check that runs mypy --strict on a sample consumer and requires zero errors.

    Once you're on 3.0.0, you can drop any ignore_missing_imports / # type: ignore[import-untyped] you added for permit. Please reopen if anything still looks off with your checker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions