Skip to content

Commit

Permalink
CI unpin flake8, only run flake8-rst in pre-commit (pandas-dev#36722)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored and Kevin D Smith committed Nov 2, 2020
1 parent e1c9cc8 commit faeb757
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ repos:
files: ^(environment.yml|requirements-dev.txt)$
pass_filenames: false
additional_dependencies: [pyyaml]
- id: flake8-rst
name: flake8-rst
description: Run flake8 on code snippets in docstrings or RST files
language: python
entry: flake8-rst
types: [rst]
args: [--filename=*.rst]
additional_dependencies: [flake8-rst==0.7.0, flake8==3.7.9]
- repo: https://github.com/asottile/yesqa
rev: v1.2.2
hooks:
Expand Down
7 changes: 0 additions & 7 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
flake8 --format="$FLAKE8_FORMAT" pandas/_libs --append-config=flake8/cython-template.cfg
RET=$(($RET + $?)) ; echo $MSG "DONE"

echo "flake8-rst --version"
flake8-rst --version

MSG='Linting code-blocks in .rst documentation' ; echo $MSG
flake8-rst doc/source --filename=*.rst --format="$FLAKE8_FORMAT"
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
4 changes: 1 addition & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ dependencies:
# code checks
- black=20.8b1
- cpplint
- flake8<3.8.0 # temporary pin, GH#34150
- flake8
- flake8-comprehensions>=3.1.0 # used by flake8, linting of unnecessary comprehensions
- flake8-rst>=0.6.0,<=0.7.0 # linting of code blocks in rst files
- isort>=5.2.1 # check that imports are in the right order
- mypy=0.782
- pre-commit
Expand Down Expand Up @@ -113,4 +112,3 @@ dependencies:
- pip:
- git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
- git+https://github.com/numpy/numpydoc
- pyflakes>=2.2.0
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ asv
cython>=0.29.21
black==20.8b1
cpplint
flake8<3.8.0
flake8
flake8-comprehensions>=3.1.0
flake8-rst>=0.6.0,<=0.7.0
isort>=5.2.1
mypy==0.782
pre-commit
Expand Down Expand Up @@ -79,4 +78,3 @@ tabulate>=0.8.3
natsort
git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
git+https://github.com/numpy/numpydoc
pyflakes>=2.2.0

0 comments on commit faeb757

Please sign in to comment.