summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-12-15 15:13:18 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-12-21 01:44:06 +0200
commit19a0c822b34225b61c9909059845a8288df63c3d (patch)
tree58adad30cc0542bec39fd53a7b4cc39e7cebf2fe /setup.py
parent4b99a460aa9f49ca159fbcfb047886ccfaef766b (diff)
downloadastroid-git-19a0c822b34225b61c9909059845a8288df63c3d.tar.gz
Add support for not byte-compiling test files invalid by design.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index e143a2b9..2150d1c2 100644
--- a/setup.py
+++ b/setup.py
@@ -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}
)