Skip to content

Alternative dev install instructions #7319

Closed

Description

@anntzer

I missed #7229 but after discussing with @NelleV I would like to suggest another approach for working on the dev version of matplotlib, that I have always used myself.

I personally think that editable installs are pretty bad because you get the worst of both worlds: you mess up your everyday-use install (or you have to work in a {v,conda}env -- if anything I think suggesting setting up such an environment should come first, not as "you may want to consider ..."), and you still need to remember to build extensions every once in a while. (See extensive discussion in #7229.)

Instead, you can simply run python setup.py build_ext --inplace and then do whatever you want prefixed with PYTHONPATH=/path/to/mpl/lib.

I will readily acknowledge that there is one flaw with this approach: until recently, you could not work on the mpl_toolkits namespace package by setting PYTHONPATH, because the -nspkg.pth approach used by setuptools for namespace packages meant that PYTHONPATH would be ignored (see e.g. https://mail.python.org/pipermail/distutils-sig/2014-March/024050.html). Fortunately, this issue has been solved recently by setuptools 28.3.0 (https://github.com/pypa/setuptools/blob/master/CHANGES.rst#v2830): for Python3.3+, setuptools just relies on PEP420 support, which does respect PYTHONPATH.

attn @NelleV @tacaswell

Activity

  1. jniediek commented on Nov 11, 2016

    @jniediek

    Instead, you can simply run python setup.py build_ext --inplace and then do whatever you want prefixed with PYTHONPATH=/path/to/mpl/lib.

    Thank you @anntzer, this approach is a solution to problems I have been annoyed by for some time (e.g. #3959).

    Maybe this is the wrong place, but let me point out that currently http://matplotlib.org/devel/index.html (Developer's Guide) does not mention that an installation/compilation is required before you can actually do something with your local fork.

    I suggest adding your approach to the Developer's Guide, since it's easy and, more importantly, easily revertible.

    @NelleV @tacaswell

  2. tacaswell commented on Nov 11, 2016

    @tacaswell
    Member

    I agree that using environments should be more strongly encouraged, but I am nervous about encouraging direct use of PYTHONPATH.

    @jniediek The installation instructions http://matplotlib.org/users/installing.html#installing-from-source have all of those details. Would an explicit link to that help?

  3. jniediek commented on Nov 16, 2016

    @jniediek

    @tacaswell I think a link like the one suggested by you would not only help, but even make the process of setting matplotlib up for development understandable for some people who would be stuck otherwise.

  4. added this to the milestone on Nov 16, 2016
  5. tacaswell commented on Nov 16, 2016

    @tacaswell
    Member

    The specific task for this issue is to:

    It would be also good to note that to contribute to the documentation (either the example or the rst) this is not required, but if that makes it awkward don't worry about it.

  6. jniediek commented on Nov 16, 2016

    @jniediek

    Thanks for quick reply. Should I attempt at making these changes? And was your last sentence incomplete?

  7. tacaswell commented on Nov 16, 2016

    @tacaswell
    Member

    @jniediek Please do and yes

  8. patniharshit commented on Feb 17, 2017

    @patniharshit
    Contributor

    Since jniedlek hasn't responded back so i would like to do this.

  9. tacaswell commented on Feb 17, 2017

    @tacaswell
    Member
  10. jniediek commented on Feb 18, 2017

    @jniediek
  11. patniharshit commented on Feb 18, 2017

    @patniharshit
    Contributor

    Where to write it? In matplotlib/doc/devel/contributing.rst and then linking it in matplotlib/doc/devel/index.rst ?

  12. story645 commented on Apr 28, 2017

    @story645
    Member

    Sure! Explain it as part of why you need to retrieved the code. And that's already linked in index.rst

  13. modified the milestones: , on May 3, 2017
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

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesDocumentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions