Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add conda environment.yml for developers#17096

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:masterfromtimhoffm:dev-environment
Sep 22, 2021

Conversation

timhoffm
Copy link
Member

@timhoffmtimhoffm commentedApr 11, 2020
edited
Loading

PR Summary

This should make it much easier to set up a development environment. Essentially one should be up and running with

git clone https://github.com/matplotlib/matplotlib.gitcd matplotlibconda env create -f environment-dev.ymlconda activate mpl-devpip install -ve .

This must still be added to the docs.

I've copied the dependencies together from the requirements files andhttps://matplotlib.org/devdocs/users/installing.html#dependencies. Not sure what to do about the optional dependencies ffmpeg, ImageMagick, LaTeX and fontconfig.

@timhoffm
Copy link
MemberAuthor

😢 This creates an inconsistent environment with pytest-5.4.1 and pytest-rerunfailures-8.0. pytest-5.4 compatibility was only provided via pytest-rerunfailures-9.0, which is not yet in conda forge. Hope this is a one-time thing (combination of pytest breaking change and plugins not updating on conda-forge). If this happens more often we'd need to install some things via pip.

Waiting for now if there is an update on conda-forge. Alternatively, we could also pin pytest<5.4.

@timhoffm
Copy link
MemberAuthor

For now, I'm pinning to pytest<5.4. pytest-rerunfailures 9.0 has been out for 3 weeks, but the conda-forge package hasn't been updated yet. So I'm not betting this will be updated in the next couple of days.

@timhoffm
Copy link
MemberAuthor

Removed pytest pinning as pytest-rerunfailures 9.0 is now available from conda-forge

@rcomer
Copy link
Member

I had a go with this as suggested at#6418 (comment). Following the instructions in the OP I created the environment and successfully ran most of the tests. However I did get several failures like this:

Traceback (most recent call last):  File "[git-path]/matplotlib/lib/matplotlib/backends/backend_gtk3.py", line 24, in <module>    gi.require_version("Gtk", "3.0")  File "[conda-path]/envs/mpl-dev/lib/python3.7/site-packages/gi/__init__.py", line 130, in require_version    (namespace, version))ValueError: Namespace Gtk not available for version 3.0

and

  File "[git-path]/matplotlib/lib/matplotlib/backends/_backend_tk.py", line 22, in <module>    from . import _tkaggImportError: [git-path]/matplotlib/lib/matplotlib/backends/_tkagg.cpython-37m-x86_64-linux-gnu.so: undefined symbol: MPL_matplotlib_backends__tkagg_ARRAY_API

Also a problem creating a webagg server as well as a couple of image comparison failures, though these aren't obviously to do with the environment.

@timhoffm
Copy link
MemberAuthor

Can you try addinggtk3 to the dependencies inenvironment.yml?

@rcomer
Copy link
Member

rcomer commentedJan 5, 2021
edited
Loading

Addedgtk3 to the yml file, and I'm now down to just 6 failures:

FAILED lib/matplotlib/tests/test_backend_pgf.py::test_mixedmode[pdf] - matplo...FAILED lib/matplotlib/tests/test_backends_interactive.py::test_interactive_backend[toolbar2-tkagg]FAILED lib/matplotlib/tests/test_backends_interactive.py::test_interactive_backend[toolmanager-tkagg]FAILED lib/matplotlib/tests/test_backends_interactive.py::test_interactive_thread_safety[tkagg]FAILED lib/matplotlib/tests/test_backends_interactive.py::test_webagg - Faile...FAILED lib/matplotlib/tests/test_polar.py::test_polar_theta_limits[pdf] - mat...

The image comparison failures are very small and don't look different by eye. Could the fact that they are both pdfs point to something like the ImageMagick version? I don't have the authority to update that.

@tacaswell
Copy link
Member

for the pdf tests we have the pdf under version control and then convert them both to png to compare. Because this can be a slow process we cache the results in~/.cache/matplotlib/test_cache. It is possible that we are not including enough version information in the hashed names and due to a version difference from the first time you ran it may be the source of the problems. Can you try clearing that folder and trying again?

The tk failure is worrying, can you try agit clean -xfd and reinstalling?

What is the error you are getting with webagg?

@rcomer
Copy link
Member

Thanks@tacaswell, I deleted thetest_cache directory, then didgit clean -xfd in my working copy before creating a new environment. Unfortunately I get the same image comparison andtkagg failures.

Thewebagg failure is inconsistent: the first and (this) third time, I got
The webagg server could not be started because an available port could not be found

the second time, it looks like a server was spun up, but then
E urllib.error.HTTPError: HTTP Error 403: OK
which is caught and then
E Failed: Failed to connect to the webagg server.

@jklymak
Copy link
Member

All the pdf tests fail for me (on a mac). I assume it is just different versions of Ghostscript, and just ignore the errors.

I'm not sure it practical to give users a setup that will passevery test onevery machine. I think the spirit of this is to get the users most of the way there with the minimum of steps.

rcomer reacted with thumbs up emoji

@rcomer
Copy link
Member

I think the spirit of this is to get the users most of the way there with the minimum of steps.

It certainly does that very nicely.

@rcomer
Copy link
Member

I tried building the docs.

There are a couple of gallery examples that requirescipy:

sphinxcontrib-svg2pdfconverter is also required, but doesn't seem to be available throughconda-forge.

I addedscipy to the yml, and installedsphinxcontrib-svg2pdfconverter withpip, and all seems well.

greglucas reacted with thumbs up emoji

@rcomer
Copy link
Member

I just noticed that theinstallation guide specifies not using Tk 8.6.0 or 8.6.1. My environments have 8.6. Given that Tk is part of the standard library, how do you choose the version on that?

@greglucas
Copy link
Contributor

I think this is really helpful for getting a clean environment to start from! Here are some additional things I found to add to the sections.

Standard dependencies (This enables me to install without downloading any additional dependencies from pip):
fonttools>=4.22.0,setuptool_scm

Documentation:
scipy,pydata-sphinx-theme,sphinx-gallery>=0.9
The sphinx-gallery one is tough because we are currently pulling the version from their git repo. Depending on how they bump their version on the next release this will need to be updated (probably >=0.10)

Additionally, I needed thesphinxcontrib-svg2pdfconverter, which apparently isn't available through conda, so I think we need an additional pip area in the file

  - pip  - pip:    - sphinxcontrib-svg2pdfconverter

Testing:
gtk3
Addingpoppler also got me the command line toolpdftocairo, which helped some pgf tests, but also caused other issues with my compiled libpng not being the same as the runtime libpng.

timhoffm reacted with thumbs up emoji

@timhoffm
Copy link
MemberAuthor

I'll add a description how to use this later to the dev docs. But basically following the instuctions in the file is sufficient.

@timhoffm
Copy link
MemberAuthor

Note: Failed check is due to a failing freetype download and unrelated to this PR.

Copy link
Contributor

@greglucasgreglucas left a comment

Choose a reason for hiding this comment

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

It looks like pandas and numpy call this fileenvironment.yml without the "-dev", do we want to be consistent with them?

This works well for me locally, and I think even without any mention in the devdocs this gives a benefit to people who want to clone the matplotlib repo and get going with an environment quickly.

@timhoffm
Copy link
MemberAuthor

I take the liberty to self-merge with one review, because this is not a code change. And even if a dependency should be missing it'S better to have this in the repo than nothing at all.

rcomer reacted with hooray emoji

@timhoffmtimhoffm merged commit9bfbe9d intomatplotlib:masterSep 22, 2021
@timhoffmtimhoffm deleted the dev-environment branchSeptember 22, 2021 23:56
tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull requestOct 12, 2021
tacaswell pushed a commit that referenced this pull requestOct 20, 2021
Add conda environment.yml for developers
ericpre pushed a commit to ericpre/matplotlib that referenced this pull requestOct 20, 2021
@QuLogicQuLogic added this to thev3.6.0 milestoneJul 28, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

6 participants
@timhoffm@rcomer@tacaswell@jklymak@greglucas@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp