Skip to content

Fix entry-point discovery and support deferred (PEP 563) annotations - #354

Open
audivir wants to merge 3 commits into
prkumar:masterfrom
audivir:fix/entry-point-group-filter-and-deferred-annotations
Open

Fix entry-point discovery and support deferred (PEP 563) annotations#354
audivir wants to merge 3 commits into
prkumar:masterfrom
audivir:fix/entry-point-group-filter-and-deferred-annotations

Conversation

@audivir

@audivir audivir commented Aug 17, 2026

Copy link
Copy Markdown

I found two separate bugs while building a third-party converter plugin:

First, entry-point discovery was completely broken for all third-party plugins. It turns out that during the migration from pkg_resources to importlib.metadata, the code started using entry_points(name=group_name) instead of group=group_name. Because name filters a different field, anything under uplink.plugins.* was being silently ignored.

Second, get_arg_spec wasn't handling deferred annotations (PEP 563). If from __future__ import annotations was used, inspect.signature returned strings instead of actual objects, which broke the matching for Body(type=Model) and return types. This fixes #181.

Changes

  • Fixed the filter in uplink/_extras.py to use group= instead of name=.
  • Updated uplink/utils.py to use eval_str=True in inspect.signature (which is supported since we're on Python 3.10+).
  • Added regression tests for both issues.

Testing

  • Ran uv run pytest tests/ (all 411 passed).
  • Verified manually with a real third-party converter: auto-discovery now works without explicit imports, and annotations work whether or not from __future__ import annotations is present.

Fixes #181.

@audivir audivir closed this Aug 17, 2026
@audivir audivir reopened this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Support __future__ annotations (PEP 563)

1 participant