Skip to content

[Bug]: register_vendor_version silently overwrites an existing registration #40

Description

@fedonman

Bug Description

register_vendor_version performs no existing-value check and simply overwrites, so the last call in a process wins and nothing reports the clash. Every other registrar guards this: register_waveform, register_sweep_source, register_vendor_operation, register_vendor_block and QProgram.register_vendor all raise ValueError when a different value claims a taken name, on the grounds that replacing another package's registration changes how existing files parse. A version is what require lines are checked against, so two installed packages claiming one namespace resolve silently to whichever imported last.

Minimal Reproducible Example

import qprogram as qp
from qprogram.serialization import registry

qp.register_vendor_version("myvendor", "1.2.3")
qp.register_vendor_version("myvendor", "9.9.9")   # no error
print(registry.get_vendor_version("myvendor"))

Expected Behavior

Re-registering the same version stays a no-op, and a different version under a taken namespace raises ValueError, the way register_waveform does: waveform name 'Dup' is already registered to __main__.Dup; rename the class or unregister first.

Actual Behavior

9.9.9

System Information

qprogram 0.1.0
python   3.14.7 | Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.43
vendors  none

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions