Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with entry_points when installing editable #55

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

magnunor
Copy link
Contributor

@magnunor magnunor commented Mar 9, 2024

When trying to install HyperSpy + HyperSpy plotting extensions (traitsui and ipywidgets) in editable mode, there is an issue with the entry_points.

To replicate (only tested in Ubuntu 23.10):

  • In a virtual environment in miniforge, first install "stable" HyperSpy (conda install hyperspy).
  • Run in python terminal import hyperspy.api as hs (which works nicely)
  • Then use pip3 install -e . in hyperspy_gui_ipywidgets project folder
  • Run in python terminal import hyperspy.api as hs

This gives this error:

Specifically, it looks is the wrong folder:

FileNotFoundError: [Errno 2] No such file or directory: '/.../hyperspy_gui_ipywidgets/hyperspy-gui-ipywidgets/hyperspy_extension.yaml'

When it should look in (note the underscores): '/.../hyperspy_gui_ipywidgets/hyperspy_gui_ipywidgets/hyperspy_extension.yaml'

One way to fix this is by changing in pyproject.toml:

``python
hyperspy-gui-ipywidgets = "hyperspy_gui_ipywidgets"


to

```python
hyperspy_gui_ipywidgets = "hyperspy_gui_ipywidgets"

However, I am not sure how this will affect other installation methods.


Note: this also affects hyperspy_gui_traitsui in a similar way

@magnunor magnunor added the bug label Mar 9, 2024
Copy link

codecov bot commented Mar 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.01%. Comparing base (a36f81e) to head (de70b84).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #55   +/-   ##
=======================================
  Coverage   80.01%   80.01%           
=======================================
  Files           9        9           
  Lines        1216     1216           
  Branches      113      113           
=======================================
  Hits          973      973           
  Misses        228      228           
  Partials       15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ericpre ericpre merged commit 0626918 into hyperspy:main Mar 10, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants