Skip to content

Dev install troubleshooting #19962

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

Merged
merged 3 commits into from
Apr 18, 2021

Conversation

story645
Copy link
Member

Don't really know where to put this, but I just spent like half an hour and a lot of install/uninstall/banging my head against a wall trying to figure out why pytest and numpy were conflicting in weird ways until I remembered that in conda you have to usually explicitly install pytest. Figure there are a couple of other really common things that mostly don't go out of date that might be worth including.


Troubleshooting
===============
* pytest - If the test runner is failing, verify that the pytest you are using is installed in your environment using the ``which pytest`` and ``which python`` commands. If the paths are not the same, install pytest in your environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please line-wrap this to 80 characters.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installed the rewrap extension, dunno why my wraps are wonky

@tacaswell
Copy link
Member

Might also be worth changing the "how to run the tests" docs to use python -m pytest which avoids exactly this situation?

@jklymak
Copy link
Member

jklymak commented Apr 15, 2021

Ha, I just had this problem until it twigged that I had to install pytest "locally".

It would not hurt to add this to https://matplotlib.org/stable/devel/dependencies.html as well since it really needs to be installed in your development environment

@story645
Copy link
Member Author

There's also a dependency section in this doc, so uh @timhoffm is there a plan to consolidate?

@story645 story645 force-pushed the story645-install-troubleshooting branch from def249f to 5a4ad91 Compare April 15, 2021 02:13
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth moving the testing and docs dependencies sections to this site.

Note also that there is #17096, which should help preventing dependency errors in dev setups based on conda.

@@ -37,7 +37,7 @@ Running the tests

In the root directory of your development repository run::

pytest
python -m pytest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another pytest call some lines down.

Comment on lines 137 to 141
Troubleshooting
===============
* pytest - If the test runner is failing, verify that the pytest you are using
is installed in your environment using the ``which pytest`` and ``which python``
commands. If the paths are not the same, install pytest in your environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have doubts about troubleshooting / FAQ sections. My impression is that they get cluttered with the next best thing someone comes across and accumulate lots of clutter between relevant information.

In this specific case:

  • do we need this at all, if we suggest python -m pytest?
  • If so, this should move to testing.rst. While it's a dependency error, users won't know that. It will happen in the context of running tests, so that's the first place to look at in the docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about having a troubleshooting section in the wiki, and linking to it from the docs? Would be easier to maintain, but still provide info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly agree with @timhoffm here: we should just use python -mpytest everywhere and perhaps just document "always use python -mpytest, not pytest", not end up with neverending faq entries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to -m pytest and dropped the troubleshooting

Don't really know where to put this, but I just spent like half an hour and a lot of install/uninstall/banging my head against a wall trying to figure out why pytest and numpy were conflicting in weird ways until I remembered that in conda you have to usually explicitly install pytest. Figure there are a couple of other really common things that mostly don't go out of date that might be worth including.
@story645 story645 force-pushed the story645-install-troubleshooting branch from 5a4ad91 to 6c46b59 Compare April 18, 2021 20:36
@timhoffm timhoffm added this to the v3.4.2 milestone Apr 18, 2021
@timhoffm timhoffm merged commit bf9ae97 into matplotlib:master Apr 18, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 18, 2021
timhoffm added a commit that referenced this pull request Apr 18, 2021
…962-on-v3.4.x

Backport PR #19962 on branch v3.4.x (Dev install troubleshooting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants