Skip to content

[Feature]: Auto-activation finds a vendor only through its entry point, with no import fallback #15

Description

@fedonman

Feature Summary

loads() resolves a require line only through the qprogram.vendors entry-point group, so a vendor extension that is installed and importable but ships no entry point is never found and the file fails to load.

Motivation / Use Case

loads() resolves a require line only through the qprogram.vendors entry-point group, so a vendor extension that is installed and importable but ships no entry point is never found and the file fails to load. try_activate_vendor looks the name up in the memoized entry-point scan and returns False when nothing claims it, with no fallback to importing a module. On the current tree that is the intended rule: the serialization guide and the parser's own error message both say an extension without the entry point has to be imported by hand. So the open question is whether an import fallback is worth adding, not whether something is broken.

Proposed Solution

Either loads() also tries importing a module named for the vendor when no entry point claims it, or the entry point stays the only route and that stays the documented rule.

import sys

sys.path.insert(0, "tests")
import qprogram as qp

# tests/_dummy_vendor.py is importable, but declares no qprogram.vendors entry point
qp.loads("#!QProgram 1.0\n\nrequire dummy 0.1\n\nbody:\n  sync\n")

Surfaces It Touches

Vendor activation and the require line's contract.

Activity

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

    vendorTouches the vendor extension protocol

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions