Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Debug #50

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 35 additions & 0 deletions foo.patch
Original file line number Diff line number Diff line change
@@ -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