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

Deprecate matplotlib.test()#20586

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
tacaswell merged 1 commit intomatplotlib:masterfromtimhoffm:deprecate-test
Aug 24, 2021

Conversation

timhoffm
Copy link
Member

This is not a function that can be easily executed by the end user with a standard setup. Testing requires substantial setup such as installing additional dependencies and reference data. A functionmatplotlib.test() gives the false impression that a user can simply call it to verify if Matplotlib is working correctly. Running pytest explicitly has become a de-facto standard and allows users to customize the run by various command line arguments. There is no point in having a second own and more limited entry point to tests.

@timhoffmtimhoffmforce-pushed thedeprecate-test branch 2 times, most recently from033f462 to45bcd44CompareJuly 6, 2021 21:08
@tacaswell
Copy link
Member

I think we need this function to be able to run the tests against a "proper" install rather than a source install. IIRC@QuLogic uses this in the fedora packaging.

@tacaswelltacaswell requested a review fromQuLogicJuly 6, 2021 22:26
@tacaswelltacaswell added this to thev3.5.0 milestoneJul 6, 2021
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

I think we need this to support testing installed versions (primarily to support the packagers).@QuLogic can dismiss this with prejudice if I am wrong.

@timhoffm
Copy link
MemberAuthor

Maybe it's my ignorance on the topic, I would have thought that proper install or editable install doesn't make a difference for testing. But happy to learn something new.

If this is only needed for packagers, we could still make it private and/or move it tomatplotlib.testing. A top-levelmatplotlib.test() seems too prominent.

@QuLogic
Copy link
Member

QuLogic commentedJul 6, 2021
edited
Loading

I don't use it directly, but throughtests.py. But as that's basically a wrapper around pytest, I think it should be possible to switch to it.

You should also confirm what happens on Debian, cc@sandrotosi

@tacaswell
Copy link
Member

Maybe it's my ignorance on the topic, I would have thought that proper install or editable install doesn't make a difference for testing. But happy to learn something new.

There are some difficulties in how pytest auto-discovery works if you naively run thepytest CLI tool in the source tree (see discussion in#20312) with Matplotlib "properly" installed.

@timhoffm
Copy link
MemberAuthor

Ah, might have to do with the test files being part of the package? I have to admit, that I have never really understood how pytest sets up the environment.

@timhoffmtimhoffm marked this pull request as draftJuly 6, 2021 23:08
@tacaswell
Copy link
Member

I have to admit, that I have never really understood how pytest sets up the environment.

pytest is very magical (which is both the best and worst thing about it!).

@QuLogic
Copy link
Member

No, not really, you just have to ensure thatPYTHONPATH points to a complete copy, and pass--pyargs, which is whattest does.

@tacaswell
Copy link
Member

It also does extensive dependancy injection and re-writes the byte code!

@sandrotosi
Copy link
Contributor

I don't use it directly, but throughtests.py. But as that's basically a wrapper around pytest, I think it should be possible to switch to it.

You should also confirm what happens on Debian, cc@sandrotosi

yep, Debian does the same (thanks for checking!)

@QuLogic
Copy link
Member

I've switched Fedora to usepytest directly, so this is okay to do from its point of view. The only annoyance was that it had to use--pyargs mpl_toolkits.tests instead of plainmpl_toolkits because it's a namespace.

@tacaswelltacaswell self-requested a reviewAugust 21, 2021 16:31
@timhoffm
Copy link
MemberAuthor

@QuLogic thanks for checking! Could you amend the deprecation notice with your findings to prevent any stumbling blocks? I'm not sure what needs to be explained so that currentmatplotib.test() users can switch seamlessly.

This is not urgent. We can push this to 3.6 if there is too much 3.5 stuff still to do.

This is not a function that can be easily executed by the end user witha standard setup.  Testing requires substantial setup such as installingadditional dependencies and reference data.  A function`matplotlib.test()` gives the false impression that a user can simplycall it to verify if Matplotlib is working correctly.  Running pytestexplicitly has become a de-facto standard and allows users to customizethe run by various command line arguments.  There is no point in havinga second own and more limited entry point to tests.
@QuLogicQuLogic marked this pull request as ready for reviewAugust 24, 2021 00:26
Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

I'm okay with this, though I wrote some of the API change note.

@tacaswelltacaswell merged commitb4251e6 intomatplotlib:masterAug 24, 2021
@timhoffmtimhoffm deleted the deprecate-test branchAugust 24, 2021 06:11
@anntzeranntzer mentioned this pull requestMay 27, 2022
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.5.0
Development

Successfully merging this pull request may close these issues.

4 participants
@timhoffm@tacaswell@QuLogic@sandrotosi

[8]ページ先頭

©2009-2025 Movatter.jp