Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Include tests.py in archive of release #6017

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

Closed
FRidh opened this issue Feb 17, 2016 · 13 comments
Closed

Include tests.py in archive of release #6017

FRidh opened this issue Feb 17, 2016 · 13 comments

Comments

@FRidh
Copy link

FRidh commented Feb 17, 2016

It seems matplotlib tests need to be run with python tests.py. Unfortunately, tests.py is not included in releases. Please add this file, since it makes it easier for maintainers to check whether their package works. Thanks!

@tacaswell
Copy link
Member

Duplicate of #5831 which was closed in #5840 which was against 1.5.x so the next release off any branch will include this.

What are you packaging mpl for (given that you have hit both here an cycler in the last few days)?

@FRidh
Copy link
Author

FRidh commented Feb 18, 2016

Oops, I should remember to search in the closed issues as well :-)

I'm packaging a bunch of (Python) packages for Nix/NixOS. We basically have a function to a build a Python package, and by default tests are also automatically run with python setup.py test. In case the tests need to be called in a different way we override the default call.

That reminds me. I just accidentally happened to notice that tests had to be run like this. Nowadays, with the newer versions of setuptools, we basically always get an error when tests are not found, thereby halting the build. This is great for us, since that way we can be almost entirely sure that all packages are actually being tested in the correct way.

With matplotlib python setup.py test shows the message that tests have to be run as python tests.py and then exits gracefully. I think it would be better to raise an exception, just as if python setup.py test was not implemented, but then of course with this added message.

@QuLogic
Copy link
Member

QuLogic commented Feb 18, 2016

At the very least, it should probably exit with a non-zero exit code.

@jenshnielsen
Copy link
Member

We did have support for python setup.py test but in the end it resulted in a series of new issues so we removed it again. I would be strongly against waisting any more time on that but making it raise an error seems like a good idea.

@tacaswell
Copy link
Member

👍 to dying less cleanly and 👍 to not spending any more time getting python setup.py test to run now.

We might want to re-evaluate the second part if/when the move to py.test from nose gets merged.

@FRidh
Copy link
Author

FRidh commented Jan 30, 2017

Am I correct that from 2.0 the sdist won't include the tests?

@tacaswell
Copy link
Member

the source dist should include all of the tests and baseline images.

@FRidh
Copy link
Author

FRidh commented Jan 30, 2017

Indeed, they are included, though not installed, which is fine. I was just checking how to run the tests now since we get ImportError: matplotlib test data is not installed. Can we run the tests with an installed copy, without installing the tests, by referring to the matplotlib source?

@tacaswell
Copy link
Member

tacaswell commented Jan 30, 2017

Yes, that should be possible. See s https://matplotlib.org/2.1.0/api/api_changes.html#default-install-no-longer-includes-test-images

[edited to point at stable link, thanks @kapsh ]

@kapsh
Copy link

kapsh commented Dec 2, 2018

If somebody wants to read last link, it is https://matplotlib.org/2.1.0/api/api_changes.html#default-install-no-longer-includes-test-images to be precise.

@tacaswell
Copy link
Member

Thanks @kapsh ! I should have used the stable link initially.

@sameer-dubal
Copy link

Hi , I have installed matplotlib 2.2.3, and i have enabled the flag " local_freetype=True" in setup.cfg.template . But still i am getting the error . Please check below for the error.

=====

Python 3.7.1 (default, Feb 6 2019, 03:49:16)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib as mat
mat.test("full")
/usr/local/lib/python3.7/site-packages/matplotlib/init.py:1472: UserWarning: Matplotlib is not built with the correct FreeType version to run tests. Set local_freetype=True in setup.cfg and rebuild. Expect many image comparison failures below. Expected freetype version 2.6.1. Found freetype version 2.6.1. Freetype build type is not local
"" if ft2font.freetype_build_type == 'local' else "not "
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/matplotlib/init.py", line 1488, in test
raise ImportError("Matplotlib test data is not installed")
ImportError: Matplotlib test data is not installed

root@fcdd10:/home/sameer#

======
I will really appreciate if someone can provide help to resolve the above issue.

Thanks,
Sameer

@tacaswell
Copy link
Member

@sameer-dubal can you please move this discussion to the user mailing list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants