Skip to content
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

PEP8 conformance tests complain about missing files #2072

Closed
mdboom opened this issue May 28, 2013 · 2 comments
Closed

PEP8 conformance tests complain about missing files #2072

mdboom opened this issue May 28, 2013 · 2 comments

Comments

@mdboom
Copy link
Member

mdboom commented May 28, 2013

There are some setuptools "stub" files for C extensions that only get exist when the C dependencies are present on the system. Unfortunately, these stub files are not PEP8 compliant, and making them PEP8 compliant would probably require patching setuptools.

Here's an example:

def __bootstrap__():
   global __bootstrap__, __loader__, __file__
   import sys, pkg_resources, imp
   __file__ = pkg_resources.resource_filename(__name__,'_gtkagg.so')
   __loader__ = None; del __bootstrap__, __loader__
   imp.load_dynamic(__name__,__file__)
__bootstrap__()

The PEP8 conformance test will fail if these files are present, so I excluded them. However, since they don't exist on Travis, we now get this over there:

======================================================================
ERROR: matplotlib.tests.test_coding_standards.test_pep8_conformance
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/matplotlib-1.3.x-py2.7-linux-x86_64.egg/matplotlib/tests/test_coding_standards.py", line 231, in test_pep8_conformance
    '{}'.format('\n  '.join(unexpectedly_good)))
ValueError: Some exclude patterns were unnecessary as the files they pointed to either passed the PEP8 tests or do not point to a file:
  */matplotlib/backends/_backend_gdk.py
  */matplotlib/backends/_gtkagg.py
----------------------------------------------------------------------

I think I'd prefer it if it was just silent if an excluded file is missing.

@pelson: What do you think?

@pelson
Copy link
Member

pelson commented May 29, 2013

I submitted a PR to distribute to fix the PEP8 problem, but it was rejected on the grounds of mirroring v0.7 of setuptools (https://bitbucket.org/tarek/distribute/pull-request/40/made-bootstrap-bdist_egg-files-pep8/activity).

I encountered this problem when writing the test in the first place and thought I'd excluded all of the C wrappers, but clearly I've missed some. Just add the necessary files to the list at https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_coding_standards.py#L195 😉

@mdboom
Copy link
Member Author

mdboom commented May 29, 2013

Ah -- I missed that other list the first time. I have fixed this in 8eef95e

@mdboom mdboom closed this as completed May 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants