From 393973024fa7984cc7efdcb96197c76f32a5e82b Mon Sep 17 00:00:00 2001 From: Sylvain Th?nault Date: Fri, 18 Apr 2014 14:57:46 +0200 Subject: [packaging] attempt to skip byte-compilation for tests files This doesn't occurs when using bare distutils but does when using setuptools (eg from easy_install/pip). As setuptools seems broken on my box, I've not been able to test that. (Hopefuly) closes #171 --- setup.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5352833..ea4f28c 100644 --- a/setup.py +++ b/setup.py @@ -132,15 +132,13 @@ class MyInstallLib(install_lib.install_lib): exclude = set() shutil.rmtree(dest, ignore_errors=True) shutil.copytree(directory, dest) - # since python2.5's copytree doesn't support the ignore + # since python2.5's copytree doesn't support the ignore # parameter, the following loop to remove the exclude set # was added for (dirpath, dirnames, filenames) in os.walk(dest): for n in filenames: if n in exclude: os.remove(os.path.join(dirpath, n)) - - if sys.version_info >= (3, 0): # process manually python file in include_dirs (test data) # pylint: disable=no-name-in-module @@ -148,6 +146,14 @@ class MyInstallLib(install_lib.install_lib): print('running 2to3 on', dest) run_2to3([dest]) + # override this since pip/easy_install attempt to byte compile test data + # files, some of them being syntactically wrong by design, and this scares + # the end-user + def byte_compile(self, files): + print 'files', files + testdir = join('pylint', 'test') + files = [f for f in files if testdir not in f] + install_lib.install_lib.byte_compile(self, files) def install(**kwargs): """setup entry point""" -- cgit v1.2.1