aboutsummaryrefslogtreecommitdiff
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-15 15:13:18 +0200
commit6f4674b0d8fde3effb5e5ffc3bb2f08e4238c3ba (patch)
treef940ce8eb5fd4cb108769ba95672d30674d4450e /setup.py
parent93097be78874dc4c2f323837352f2b1f552cb025 (diff)
downloadastroid-6f4674b0d8fde3effb5e5ffc3bb2f08e4238c3ba.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}
)