Skip to content

bug: KeyError: 'instance-attribute' since latest release #26

@klieret

Description

@klieret

Description of the bug

Since the latest release, I get a KeyError: 'instance-attribute'

To Reproduce

I have trouble localizing to boil this down to a MRE, but I see here that there's some few changes that involve instance-attribute, so perhaps not needed?

It's trying to read this file, but I failed to bisect where it trips.

Full traceback

Full traceback
 File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/mkdocstrings_handlers/python/handler.py", line 234, in collect
    loader.load(
    ~~~~~~~~~~~^
        module_name,
        ^^^^^^^^^^^^
        try_relative_path=False,
        ^^^^^^^^^^^^^^^^^^^^^^^^
        find_stubs_package=options.find_stubs_package,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/_griffe/loader.py", line 186, in load
    return self._post_load(top_module, obj_path)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/_griffe/loader.py", line 201, in _post_load
    self.extensions.call("on_package_loaded", pkg=module, loader=self)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/_griffe/extensions/base.py", line 313, in call
    getattr(extension, event)(**kwargs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/extension.py", line 42, in on_package_loaded
    static.process_module(pkg, processed=self.processed, schema=self.schema)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/static.py", line 183, in process_module
    process_module(submodule, processed=processed, schema=schema)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/static.py", line 183, in process_module
    process_module(submodule, processed=processed, schema=schema)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/static.py", line 180, in process_module
    process_class(cls, processed=processed, schema=schema)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/static.py", line 159, in process_class
    process_attribute(member, cls, processed=processed)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/griffe_pydantic/static.py", line 102, in process_attribute
    attr.labels.remove("instance-attribute")
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'instance-attribute'
error: Command '['mkdocs', 'build', '--clean', '--config-file', 'mkdocs.yml']' returned non-zero exit status 1.

Expected behavior

Environment information

- __System__: macOS-15.1.1-arm64-arm-64bit-Mach-O
- __Python__: cpython 3.13.0 (/opt/miniconda3/envs/swea13/bin/python)
- __Environment variables__:
- __Installed packages__:
  - `griffe-pydantic` v1.1.1

also happens on github actions/linux

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions