diff --git a/.travis.yml b/.travis.yml index 329693d..bedaf79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,6 +75,7 @@ before_install: install: # Maybe get and clean and patch source - clean_code $REPO_DIR $BUILD_COMMIT + - git -C pandas apply ../foo.patch - build_wheel $REPO_DIR $PLAT script: diff --git a/foo.patch b/foo.patch new file mode 100644 index 0000000..04a23de --- /dev/null +++ b/foo.patch @@ -0,0 +1,35 @@ +diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py +index 9fe8b0f95..4660da269 100644 +--- a/pandas/tests/test_downstream.py ++++ b/pandas/tests/test_downstream.py +@@ -135,11 +135,27 @@ def test_pyarrow(df): + + def test_missing_required_dependency(): + # GH 23868 +- # use the -S flag to disable site-packages +- call = ['python', '-S', '-c', 'import pandas'] ++ # To ensure proper isolation, we pass these flags ++ # -S : disable site-packages ++ # -s : disable user site-packages ++ # -E : disable PYTHON* env vars, especially PYTHONPATH ++ # And, that's apparently not enough, so we give up. ++ # https://github.com/MacPython/pandas-wheels/pull/50 ++ try: ++ subprocess.check_output(['python', '-sSE', '-c', 'import numpy'], ++ stderr=subprocess.DEVNULL) ++ except subprocess.CalledProcessError: ++ # NumPy is not around, we can do the test ++ pass ++ else: ++ # NumPy is in the isolation environment, give up. ++ pytest.skip("Required dependencies in isolated environment.") ++ ++ call = ['python', '-sSE', '-c', 'import pandas'] + + with pytest.raises(subprocess.CalledProcessError) as exc: + subprocess.check_output(call, stderr=subprocess.STDOUT) + + output = exc.value.stdout.decode() +- assert all(x in output for x in ['numpy', 'pytz', 'dateutil']) ++ for name in ['numpy', 'pytz', 'dateutil']: ++ assert name in output