From c8e7f506bccd409783bbee48af7a08374d4d4b4e Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sat, 14 Mar 2020 04:25:22 -0400 Subject: [PATCH 1/7] enable pydocstyle in github build --- .github/workflows/master.yml | 4 ++-- dev/requirements.txt | 5 ++++- dev/tox.ini | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 632a0f1aa91fd..60245270d9b82 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -88,7 +88,7 @@ jobs: run: ./dev/lint-java - name: Python run: | - pip install flake8 sphinx numpy + pip install ./dev/requirements.txt ./dev/lint-python - name: License run: ./dev/check-license @@ -147,7 +147,7 @@ jobs: sudo apt-get install -y r-base r-base-dev libcurl4-openssl-dev pandoc - name: Install packages run: | - pip install sphinx mkdocs numpy + pip install sphinx==2.3.1 mkdocs==1.0.4 numpy==1.18.1 gem install jekyll jekyll-redirect-from rouge sudo Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')" - name: Run jekyll build diff --git a/dev/requirements.txt b/dev/requirements.txt index baea9213dbc97..103da0601f0d4 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,5 +1,8 @@ -flake8==3.5.0 +pycodestyle==2.5.0 +pydocstyle==5.0.2 +flake8==3.7.9 jira==1.0.3 PyGithub==1.26.0 Unidecode==0.04.19 sphinx +numpy diff --git a/dev/tox.ini b/dev/tox.ini index 54f65692c8303..8c7c4d282bf41 100644 --- a/dev/tox.ini +++ b/dev/tox.ini @@ -18,4 +18,4 @@ ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 max-line-length=100 exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/* [pydocstyle] -ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 +ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D415,D416,D417 From 3f09453416ae044964992f77b639dd0c485233ed Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sat, 14 Mar 2020 04:29:01 -0400 Subject: [PATCH 2/7] pin versions to match various READMEs --- dev/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/requirements.txt b/dev/requirements.txt index 103da0601f0d4..a0f3972d0c2f2 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -4,5 +4,5 @@ flake8==3.7.9 jira==1.0.3 PyGithub==1.26.0 Unidecode==0.04.19 -sphinx -numpy +sphinx==2.3.1 +numpy==1.18.1 From 0e7116217405176a91e9ff74eded2165dd9bf00b Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sat, 14 Mar 2020 04:44:20 -0400 Subject: [PATCH 3/7] derp: pip install -r --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 60245270d9b82..bcd380dcdbb78 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -88,7 +88,7 @@ jobs: run: ./dev/lint-java - name: Python run: | - pip install ./dev/requirements.txt + pip install -r ./dev/requirements.txt ./dev/lint-python - name: License run: ./dev/check-license From eed71648f50e67f8a1112ea931284ee9336f5296 Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sun, 15 Mar 2020 00:43:21 -0400 Subject: [PATCH 4/7] reenable some pydocstyle tests --- dev/tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/tox.ini b/dev/tox.ini index 8c7c4d282bf41..e0ac2e530322d 100644 --- a/dev/tox.ini +++ b/dev/tox.ini @@ -17,5 +17,10 @@ ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 max-line-length=100 exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/* + [pydocstyle] -ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D201,D202,D203,D204,D205,D206,D207,D208,D209,D210,D211,D212,D213,D214,D215,D300,D301,D302,D400,D401,D402,D403,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D415,D416,D417 +ignore= + D100,D101,D102,D103,D104,D105,D106,D107, + D200,D201,D202,D203,D204,D205,D207,D208,D209,D210,D211,D212,D213,D214, + D300,D301, + D400,D401,D402,D403,D404,D405,D406,D407,D412,D413,D414,D415,D416,D417 From 82489426523da1fe3c5bbd82f1c9566b3019ceff Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Mon, 16 Mar 2020 11:34:39 -0400 Subject: [PATCH 5/7] remove pydocstyle --- dev/lint-python | 46 ---------------------------------------------- dev/tox.ini | 7 ------- 2 files changed, 53 deletions(-) diff --git a/dev/lint-python b/dev/lint-python index a9d2a0b75ac56..d5491f2447176 100755 --- a/dev/lint-python +++ b/dev/lint-python @@ -16,9 +16,6 @@ # limitations under the License. # # define test binaries + versions -PYDOCSTYLE_BUILD="pydocstyle" -MINIMUM_PYDOCSTYLE="3.0.0" - FLAKE8_BUILD="flake8" MINIMUM_FLAKE8="3.5.0" @@ -165,48 +162,6 @@ flake8 checks failed." fi } -function pydocstyle_test { - local PYDOCSTYLE_REPORT= - local PYDOCSTYLE_STATUS= - local PYDOCSTYLE_VERSION= - local EXPECTED_PYDOCSTYLE= - - # Exclude auto-generated configuration file. - local DOC_PATHS_TO_CHECK="$( cd "${SPARK_ROOT_DIR}" && find . -name "*.py" | grep -vF 'functions.py' )" - - # Check python document style, skip check if pydocstyle is not installed. - if ! hash "$PYDOCSTYLE_BUILD" 2> /dev/null; then - echo "The pydocstyle command was not found. Skipping pydocstyle checks for now." - echo - return - fi - - PYDOCSTYLE_VERSION="$($PYDOCSTYLE_BUILD --version)" - EXPECTED_PYDOCSTYLE="$(satisfies_min_version $PYDOCSTYLE_VERSION $MINIMUM_PYDOCSTYLE)" - - if [[ "$EXPECTED_PYDOCSTYLE" == "False" ]]; then - echo "\ -The minimum version of pydocstyle needs to be $MINIMUM_PYDOCSTYLE. -Your current version is $PYDOCSTYLE_VERSION. -Skipping pydocstyle checks for now." - echo - return - fi - - echo "starting $PYDOCSTYLE_BUILD test..." - PYDOCSTYLE_REPORT=$( ($PYDOCSTYLE_BUILD --config=dev/tox.ini $DOC_PATHS_TO_CHECK) 2>&1) - PYDOCSTYLE_STATUS=$? - - if [ "$PYDOCSTYLE_STATUS" -ne 0 ]; then - echo "pydocstyle checks failed:" - echo "$PYDOCSTYLE_REPORT" - exit "$PYDOCSTYLE_STATUS" - else - echo "pydocstyle checks passed." - echo - fi -} - function sphinx_test { local SPHINX_REPORT= local SPHINX_STATUS= @@ -252,7 +207,6 @@ PYTHON_SOURCE="$(find . -name "*.py")" compile_python_test "$PYTHON_SOURCE" pycodestyle_test "$PYTHON_SOURCE" flake8_test -pydocstyle_test sphinx_test echo diff --git a/dev/tox.ini b/dev/tox.ini index e0ac2e530322d..3ee13c09b5de7 100644 --- a/dev/tox.ini +++ b/dev/tox.ini @@ -17,10 +17,3 @@ ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 max-line-length=100 exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/* - -[pydocstyle] -ignore= - D100,D101,D102,D103,D104,D105,D106,D107, - D200,D201,D202,D203,D204,D205,D207,D208,D209,D210,D211,D212,D213,D214, - D300,D301, - D400,D401,D402,D403,D404,D405,D406,D407,D412,D413,D414,D415,D416,D417 From 18de9d7b9621de126240cee5e4cb9c6b16b1e64e Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Mon, 16 Mar 2020 11:43:11 -0400 Subject: [PATCH 6/7] revert dep changes --- .github/workflows/master.yml | 4 ++-- dev/requirements.txt | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index bcd380dcdbb78..632a0f1aa91fd 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -88,7 +88,7 @@ jobs: run: ./dev/lint-java - name: Python run: | - pip install -r ./dev/requirements.txt + pip install flake8 sphinx numpy ./dev/lint-python - name: License run: ./dev/check-license @@ -147,7 +147,7 @@ jobs: sudo apt-get install -y r-base r-base-dev libcurl4-openssl-dev pandoc - name: Install packages run: | - pip install sphinx==2.3.1 mkdocs==1.0.4 numpy==1.18.1 + pip install sphinx mkdocs numpy gem install jekyll jekyll-redirect-from rouge sudo Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')" - name: Run jekyll build diff --git a/dev/requirements.txt b/dev/requirements.txt index a0f3972d0c2f2..baea9213dbc97 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,8 +1,5 @@ -pycodestyle==2.5.0 -pydocstyle==5.0.2 -flake8==3.7.9 +flake8==3.5.0 jira==1.0.3 PyGithub==1.26.0 Unidecode==0.04.19 -sphinx==2.3.1 -numpy==1.18.1 +sphinx From 34ec6a3715dde1d9e00b15af28f823d99d049db3 Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Mon, 16 Mar 2020 13:58:40 -0400 Subject: [PATCH 7/7] re-trigger GitHub tests