Bug Description
_Parser collects every require line into self._required_vendors and then never reads it, so a file whose body uses dummy.acquire parses fine with no require dummy 0.1 line, as long as something in the process already imported the extension. The format spec says every vendor operation in the body must have a matching require declaration. Whether the file loads therefore depends on ambient import state, and it will fail for the next reader: auto-activation only runs off a require line, so without one the extension is never imported on demand and the same file raises unknown vendor operation dummy.'acquire'. A check of the vendors actually used against _required_vendors after the body is parsed would close it.
Minimal Reproducible Example
import sys; sys.path.insert(0, "tests")
import qprogram as qp
import _dummy_vendor
_dummy_vendor.activate()
qp.loads("""#!QProgram 1.0
body:
dummy.acquire "readout_q0" "weights" name="m0"
""")
Expected Behavior
ParseError naming the vendor whose require line is missing.
Actual Behavior
No error. The program loads, and `dumps()` then writes the file back with a `require dummy 0.1` line that was never in the input.
.qp Text
#!QProgram 1.0
body:
dummy.acquire "readout_q0" "weights" name="m0"
System Information
qprogram 0.1.0
python 3.14.3 | Linux-7.0.0-30-generic-x86_64-with-glibc2.43
vendors none
Bug Description
_Parsercollects everyrequireline intoself._required_vendorsand then never reads it, so a file whose body usesdummy.acquireparses fine with norequire dummy 0.1line, as long as something in the process already imported the extension. The format spec says every vendor operation in the body must have a matchingrequiredeclaration. Whether the file loads therefore depends on ambient import state, and it will fail for the next reader: auto-activation only runs off arequireline, so without one the extension is never imported on demand and the same file raisesunknown vendor operation dummy.'acquire'. A check of the vendors actually used against_required_vendorsafter the body is parsed would close it.Minimal Reproducible Example
Expected Behavior
ParseError naming the vendor whose
requireline is missing.Actual Behavior
.qp Text
System Information
qprogram 0.1.0 python 3.14.3 | Linux-7.0.0-30-generic-x86_64-with-glibc2.43 vendors none