Skip to content

[Bug]: Editable install seems broken #27005

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

Closed
timhoffm opened this issue Oct 5, 2023 · 7 comments
Closed

[Bug]: Editable install seems broken #27005

timhoffm opened this issue Oct 5, 2023 · 7 comments

Comments

@timhoffm
Copy link
Member

timhoffm commented Oct 5, 2023

Bug summary

Possibly realted to the Port of the build system to Meson #26621. Ping @QuLogic

Code for reproduction

# standard installation procedure according to:
# https://matplotlib.org/stable/devel/development_setup.html#create-a-dedicated-environment
conda env create -f environment.yml
conda activate mpl-dev
python -m pip install -e .
python -c "import matplotlib; print(matplotlib.__file__)"

Note: A non-editable install python -m pip install . works.

Actual outcome

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1138, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1078, in _find_spec
  File "/home/tim/anaconda3/envs/mpl-dev/lib/python3.11/site-packages/_matplotlib_editable_loader.py", line 271, in find_spec
    tree = self.rebuild()
           ^^^^^^^^^^^^^^
  File "/home/tim/anaconda3/envs/mpl-dev/lib/python3.11/site-packages/_matplotlib_editable_loader.py", line 312, in rebuild
    subprocess.run(self._build_cmd, cwd=self._build_path, env=env, stdout=stdout, check=True)
  File "/home/tim/anaconda3/envs/mpl-dev/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/tim/anaconda3/envs/mpl-dev/bin/ninja']' returned non-zero exit status 1.```

Matplotlib Version

main branch

Python version

3.11.6

Installation

git checkout

@jklymak
Copy link
Member

jklymak commented Oct 5, 2023

@timhoffm You need the dev version of the install docs: https://matplotlib.org/devdocs/devel/development_setup.html

@timhoffm
Copy link
Member Author

timhoffm commented Oct 5, 2023

🐑 (muscle memory)

Thanks @jklymak

@timhoffm timhoffm closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@ksunden
Copy link
Member

ksunden commented Oct 5, 2023

yes, downside of meson is that you need --no-build-isolation for editable installs, upside is that it will recompile on import, so you need to do it less often (though bisecting across the build system change may get interesting....)

@timhoffm
Copy link
Member Author

timhoffm commented Oct 5, 2023

Is it (easily) possible for us to detect a missing --no-build-isolation editable install and warn on that?

@QuLogic
Copy link
Member

QuLogic commented Oct 5, 2023

We could guess based on the build directory location, but a dev could set an arbitrary build directory, so I think maybe that would be a good question for meson-python?

@QuLogic
Copy link
Member

QuLogic commented Oct 5, 2023

Also, other packages have used a helper script of a sort, like spin, which we might consider.

@timhoffm
Copy link
Member Author

timhoffm commented Oct 5, 2023

so I think maybe that would be a good question for meson-python?

I've now asked at mesonbuild/meson-python#512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants