Open hakonanes opened 1 month ago
- Include this example repository somewhere in the HyperSpy organization?
Maybe more simple to add branches for different configuration / layout and list these in the readme?
Yes, that is a better solution.
If #3446 goes through, I can make a PR to https://github.com/hyperspy/hyperspy_sample_extension which after review can be pushed as a branch.
Edit: With a separate PR to update the README pointing to this branch.
Describe the bug
Hi all,
The derived path to the signal extension file
hyperspy_extension.yaml
is not compatible with an extension package using a src-layout in an editable install (pip install -e .
).The reason is that the name and not the value of the entry point is used when creating the path. The following
https://github.com/hyperspy/hyperspy/blob/e20d095930c77c1fdb892afd68ca2c456ec76a79/hyperspy/extensions.py#L65
should use
_external_extension.value
instead.This way, a project that wants to tell HyperSpy where to find the
hyperspy_extension.yaml
file this waycan do so (name = "value").
An example src-layout:
To fix this, I intend to make changes here:
RELEASE_next_patch
To Reproduce
Fetch the example repository with src-layout and pyproject.toml
Create environment, print contents of pyproject.toml, and install dependencies and package (in editable mode)
Attempt to print known signal types and notice how HyperSpy looks for the incorrect path to
hyperspy_extension.yaml
Expected behavior
Python environment:
Additional context
If not installing in editable mode, the path is correct (because the expected path is correct due to everything within src/ is found in site-packages):