diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 15:13:18 +0200 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-21 01:44:06 +0200 |
| commit | 19a0c822b34225b61c9909059845a8288df63c3d (patch) | |
| tree | 58adad30cc0542bec39fd53a7b4cc39e7cebf2fe /setup.py | |
| parent | 4b99a460aa9f49ca159fbcfb047886ccfaef766b (diff) | |
| download | astroid-git-19a0c822b34225b61c9909059845a8288df63c3d.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} ) |
