diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 15:13:18 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 15:13:18 +0200 |
commit | 6f4674b0d8fde3effb5e5ffc3bb2f08e4238c3ba (patch) | |
tree | f940ce8eb5fd4cb108769ba95672d30674d4450e /setup.py | |
parent | 93097be78874dc4c2f323837352f2b1f552cb025 (diff) | |
download | astroid-6f4674b0d8fde3effb5e5ffc3bb2f08e4238c3ba.tar.gz |
Add support for not byte-compiling test files invalid by design.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -20,6 +20,7 @@ """Setup script for astroid.""" import os from setuptools import setup, find_packages +from setuptools.command import easy_install from setuptools.command import install_lib @@ -35,11 +36,20 @@ with open(os.path.join(astroid_dir, 'README.rst')) as fobj: class AstroidInstallLib(install_lib.install_lib): def byte_compile(self, files): - test_datadir = os.path.join(astroid_dir, 'tests', 'testdata') + test_datadir = os.path.join('astroid', 'tests', 'testdata') files = [f for f in files if test_datadir not in f] install_lib.install_lib.byte_compile(self, files) +class AstroidEasyInstallLib(easy_install.easy_install): + # 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): + test_datadir = os.path.join('astroid', 'tests', 'testdata') + files = [f for f in files if test_datadir not in f] + easy_install.easy_install.byte_compile(self, files) + def install(): return setup(name = distname, @@ -54,7 +64,8 @@ def install(): include_package_data = True, install_requires = install_requires, packages = find_packages(), - cmdclass={'install_lib': AstroidInstallLib} + cmdclass={'install_lib': AstroidInstallLib, + 'easy_install': AstroidEasyInstallLib} ) |