Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI unpin flake8, only run flake8-rst in pre-commit #36722

Merged
merged 10 commits into from
Oct 10, 2020
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
dsaxton marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably remove the pip install of pyflakes>=2.2.0 now.

- 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
jreback marked this conversation as resolved.
Show resolved Hide resolved
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