From 4dd8cdd7c9a1dc34d11e3329227deaa0f96fa631 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Sun, 11 Nov 2018 20:16:40 +0000 Subject: [PATCH 1/3] Check in the CI that assert_raises_regex is not being used --- ci/code_checks.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index eba96f0c6c2fc..b12c812fd6232 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -119,6 +119,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then ! grep -R --include="*.py" --include="*.pyx" --include="*.rst" -E "\.\. (autosummary|contents|currentmodule|deprecated|function|image|important|include|ipython|literalinclude|math|module|note|raw|seealso|toctree|versionadded|versionchanged|warning):[^:]" ./pandas ./doc/source RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Check that the deprecated `assert_raises_regex` is not used (`pytest.raises(match=pattern)` should be used instead)' ; echo $MSG + grep -R --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas + RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Check for modules that pandas should not import' ; echo $MSG python -c " import sys From da8b244198c901f1af37c604963fcb92f573cc64 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Sun, 11 Nov 2018 20:26:00 +0000 Subject: [PATCH 2/3] Reversing the result of the grep --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index b12c812fd6232..413942e404760 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -120,7 +120,7 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Check that the deprecated `assert_raises_regex` is not used (`pytest.raises(match=pattern)` should be used instead)' ; echo $MSG - grep -R --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas + ! grep -R --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Check for modules that pandas should not import' ; echo $MSG From 1fea3a452cc4ae0ac7efcf791a39cc9b9686f6c0 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Sun, 11 Nov 2018 23:00:53 +0000 Subject: [PATCH 3/3] Excluding .pyc files from the new check --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 413942e404760..2eb3fabd04df2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -120,7 +120,7 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Check that the deprecated `assert_raises_regex` is not used (`pytest.raises(match=pattern)` should be used instead)' ; echo $MSG - ! grep -R --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas + ! grep -R --exclude=*.pyc --exclude=testing.py --exclude=test_testing.py assert_raises_regex pandas RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Check for modules that pandas should not import' ; echo $MSG