From fd0fd80ce2302021769024fc399218eb5851d380 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Tue, 29 Sep 2020 12:32:00 +0100 Subject: [PATCH 1/6] only run flake8-rst in pre-commit --- .pre-commit-config.yaml | 4 ++++ environment.yml | 3 +-- requirements-dev.txt | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f669ee77c3eb..eacc559b8bfa0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,3 +43,7 @@ repos: entry: python -m scripts.generate_pip_deps_from_conda files: ^(environment.yml|requirements-dev.txt)$ pass_filenames: false +- repo: https://github.com/MarcoGorelli/flake8-rst-mirror + rev: v0.7.0 + hooks: + - id: flake8-rst diff --git a/environment.yml b/environment.yml index 7f6ce8cb9fa3b..8918afa163173 100644 --- a/environment.yml +++ b/environment.yml @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt index 690a3368c7aca..6a55090fc6065 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 From 4aa3110c06a9fb9176c721f3f1da6b50b6525784 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Tue, 29 Sep 2020 12:34:00 +0100 Subject: [PATCH 2/6] update code checks --- ci/code_checks.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 54aa830379c07..60c5b47ec6731 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -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 `obj` as opposed to ` 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 From 29c20de55f2e78898a2a91bc2d8554f2be7a2972 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Tue, 29 Sep 2020 18:06:10 +0100 Subject: [PATCH 3/6] :fire: remove pyflakes from environment.yml --- environment.yml | 1 - requirements-dev.txt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 8918afa163173..e7a7bffc8956a 100644 --- a/environment.yml +++ b/environment.yml @@ -111,4 +111,3 @@ dependencies: - pip: - git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master - git+https://github.com/numpy/numpydoc - - pyflakes>=2.2.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 6a55090fc6065..ddc90a222bb72 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -76,5 +76,4 @@ pyreadstat 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 \ No newline at end of file +git+https://github.com/numpy/numpydoc \ No newline at end of file From 3473f4b952467c88f12f93d243ca1321d65f4e4a Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Sat, 3 Oct 2020 07:54:04 +0100 Subject: [PATCH 4/6] no need for mirror --- .pre-commit-config.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56e468987a799..096e59565ff80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,10 +43,14 @@ repos: entry: python -m scripts.generate_pip_deps_from_conda files: ^(environment.yml|requirements-dev.txt)$ pass_filenames: false -- repo: https://github.com/MarcoGorelli/flake8-rst-mirror - rev: v0.7.0 - hooks: - id: flake8-rst + name: flake8-rst + description: Run flake8 on code snippets in docstrings or RST files + language: system + entry: flake8-rst + types: [rst] + args: ['--filename=*.rst'] + additional_dependencies: [flake8-rst@0.7.0] - repo: https://github.com/asottile/yesqa rev: v1.2.2 hooks: From c3b5a75843ef09d6cfbe12156d613fa109f9c1fe Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Sat, 3 Oct 2020 08:00:24 +0100 Subject: [PATCH 5/6] language python --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 096e59565ff80..cd7bb7e52d623 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,11 +46,11 @@ repos: - id: flake8-rst name: flake8-rst description: Run flake8 on code snippets in docstrings or RST files - language: system + language: python entry: flake8-rst types: [rst] args: ['--filename=*.rst'] - additional_dependencies: [flake8-rst@0.7.0] + additional_dependencies: ['flake8-rst==0.7.0', 'flake8==3.7.9'] - repo: https://github.com/asottile/yesqa rev: v1.2.2 hooks: From 9d0891dbb8dab29873531cdc49befdfd5f9d4e2e Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Wed, 7 Oct 2020 19:39:29 +0100 Subject: [PATCH 6/6] yaml formatting --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ef1b36ec2281..89187d97851b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,8 +49,8 @@ repos: language: python entry: flake8-rst types: [rst] - args: ['--filename=*.rst'] - additional_dependencies: ['flake8-rst==0.7.0', 'flake8==3.7.9'] + 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: