Skip to content

The probeinterface.testing module loads probe.json.schema, which doesn’t ship with the wheel #321

Closed
@musicinmybrain

Description

@musicinmybrain

The new module probeinterface.testing, which ships as part of the probeinterface wheel, loads probe.json.schema at import time, but this only works using relative paths in a git checkout; probe.json.schema doesn’t ship in the wheel at all.

Separately, probeinterface.testing imports jsonschema, which isn’t a regular dependency, only a test extra dependency. I guess that’s “more OK:”

$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install probeinterface
$ python3 -c 'import probeinterface.testing'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import probeinterface.testing
  File "/home/ben/tmp/_e/lib64/python3.13/site-packages/probeinterface/testing.py", line 5, in <module>
    import jsonschema
ModuleNotFoundError: No module named 'jsonschema'
(_e) $ pip install probeinterface[test]
(_e) $ $ python3 -c 'import probeinterface.testing'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import probeinterface.testing
  File "/home/ben/tmp/_e/lib64/python3.13/site-packages/probeinterface/testing.py", line 8, in <module>
    schema = json.load(open(json_schema_file, "r"))
                       ~~~~^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/ben/tmp/_e/lib64/python3.13/resources/probe.json.schema'

I’m not quite sure what would make this “nicer” in the most straighforward way. If it’s feasible to move probeinterface.testing back out of probeinterface and into tests/, that would probably be best. Where it is, it looks like a public API, and that really doesn’t seem to be the intent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions