summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJulien Jehannet <julien.jehannet@logilab.fr>2010-12-06 13:29:56 +0100
committerJulien Jehannet <julien.jehannet@logilab.fr>2010-12-06 13:29:56 +0100
commitad5580fdcf0d9defee1a6a2b9fc8ea8f5110726c (patch)
treea534c3f11403ed33ccd790d71721e2934000167c /setup.py
parentcafffd79354d92714426a2176fdf5ca28ca798f4 (diff)
downloadpylint-ad5580fdcf0d9defee1a6a2b9fc8ea8f5110726c.tar.gz
[debian] py3k: override build_py command with filtering some test files
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 759072f..0eefa44 100644
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,34 @@ except ImportError:
from distutils.command import install_lib
USE_SETUPTOOLS = 0
+# pylint needs to filter some test files expected to be wrong
+P3K_FILES_TO_IGNORE= ['test/input/func_wrong_encoding.py',
+ 'test/input/func_noerror_encoding.py',
+ 'test/input/func_unknown_encoding.py',
+ 'test/input/func_nonascii_noencoding.py']
+try:
+ # python3
+ from distutils.command.build_py import build_py_2to3 as build_py
+ def run(self):
+ self.updated_files = []
+ # Base class code
+ if self.py_modules:
+ self.build_modules()
+ if self.packages:
+ self.build_packages()
+ self.build_package_data()
+ # filter test files
+ self.updated_files = [f for f in self.updated_files
+ if not f.endswith(tuple(P3K_FILES_TO_IGNORE))]
+ # 2to3
+ self.run_2to3(self.updated_files)
+ # Remaining base class code
+ self.byte_compile(self.get_outputs(include_bytecode=0))
+ build_py.run = run
+except ImportError:
+ # python2.x
+ from distutils.command.build_py import build_py
+
sys.modules.pop('__pkginfo__', None)
# import optional features
__pkginfo__ = __import__("__pkginfo__")
@@ -154,7 +182,8 @@ def install(**kwargs):
scripts = ensure_scripts(scripts),
data_files = data_files,
ext_modules = ext_modules,
- cmdclass = {'install_lib': MyInstallLib},
+ cmdclass = {'install_lib': MyInstallLib,
+ 'build_py': build_py},
**kwargs
)