Skip to content

[Bug]: Editable install seems broken #27005

Closed as not planned
Closed as not planned

Description

@timhoffm

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

Activity

  1. jklymak commented on Oct 5, 2023

    @jklymak
    Member

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

  2. timhoffm commented on Oct 5, 2023

    @timhoffm
    MemberAuthor

    🐑 (muscle memory)

    Thanks @jklymak

  3. ksunden commented on Oct 5, 2023

    @ksunden
    Member

    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....)

  4. timhoffm commented on Oct 5, 2023

    @timhoffm
    MemberAuthor

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

  5. QuLogic commented on Oct 5, 2023

    @QuLogic
    Member

    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?

  6. QuLogic commented on Oct 5, 2023

    @QuLogic
    Member

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

  7. timhoffm commented on Oct 5, 2023

    @timhoffm
    MemberAuthor

    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

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