Skip to content

Commit

Permalink
CI: remove duplicated code check pandas-dev#36642 (pandas-dev#36716)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchenli authored and Kevin D Smith committed Nov 2, 2020
1 parent e54bd0b commit e12352d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 57 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ jobs:
ci/code_checks.sh lint
if: always()

- name: Dependencies consistency
run: |
source activate pandas-dev
ci/code_checks.sh dependencies
if: always()

- name: Checks on imported code
run: |
source activate pandas-dev
Expand Down
53 changes: 2 additions & 51 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
# $ ./ci/code_checks.sh code # checks on imported code
# $ ./ci/code_checks.sh doctests # run doctests
# $ ./ci/code_checks.sh docstrings # validate docstring errors
# $ ./ci/code_checks.sh dependencies # check that dependencies are consistent
# $ ./ci/code_checks.sh typing # run static type analysis

[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "dependencies" || "$1" == "typing" ]] || \
{ echo "Unknown command $1. Usage: $0 [lint|patterns|code|doctests|docstrings|dependencies|typing]"; exit 9999; }
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "typing" ]] || \
{ echo "Unknown command $1. Usage: $0 [lint|patterns|code|doctests|docstrings|typing]"; exit 9999; }

BASE_DIR="$(dirname $0)/.."
RET=0
Expand Down Expand Up @@ -48,31 +47,6 @@ fi
### LINTING ###
if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then

echo "black --version"
black --version

MSG='Checking black formatting' ; echo $MSG
black . --check
RET=$(($RET + $?)) ; echo $MSG "DONE"

# `setup.cfg` contains the list of error codes that are being ignored in flake8

echo "flake8 --version"
flake8 --version

# pandas/_libs/src is C code, so no need to search there.
MSG='Linting .py code' ; echo $MSG
flake8 --format="$FLAKE8_FORMAT" .
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Linting .pyx and .pxd code' ; echo $MSG
flake8 --format="$FLAKE8_FORMAT" pandas --append-config=flake8/cython.cfg
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Linting .pxi.in' ; echo $MSG
flake8 --format="$FLAKE8_FORMAT" pandas/_libs --append-config=flake8/cython-template.cfg
RET=$(($RET + $?)) ; echo $MSG "DONE"

# Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
# it doesn't make a difference, but we want to be internally consistent.
# Note: this grep pattern is (intended to be) equivalent to the python
Expand Down Expand Up @@ -125,19 +99,6 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
fi
RET=$(($RET + $?)) ; echo $MSG "DONE"

echo "isort --version-number"
isort --version-number

# Imports - Check formatting using isort see setup.cfg for settings
MSG='Check import format using isort' ; echo $MSG
ISORT_CMD="isort --quiet --check-only pandas asv_bench scripts web"
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
eval $ISORT_CMD | awk '{print "##[error]" $0}'; RET=$(($RET + ${PIPESTATUS[0]}))
else
eval $ISORT_CMD
fi
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi

### PATTERNS ###
Expand Down Expand Up @@ -354,15 +315,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

fi

### DEPENDENCIES ###
if [[ -z "$CHECK" || "$CHECK" == "dependencies" ]]; then

MSG='Check that requirements-dev.txt has been generated from environment.yml' ; echo $MSG
$BASE_DIR/scripts/generate_pip_deps_from_conda.py --compare --azure
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi

### TYPING ###
if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then

Expand All @@ -374,5 +326,4 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then
RET=$(($RET + $?)) ; echo $MSG "DONE"
fi


exit $RET

0 comments on commit e12352d

Please sign in to comment.