From dff6ab35c2d54f32ca24af6569dd5f03435db5a1 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 15 Mar 2021 19:19:50 -0700 Subject: [PATCH 1/3] CI: fix failing script/tests --- Makefile | 5 ++++- environment.yml | 1 + requirements-dev.txt | 1 + scripts/__init__.py | 0 scripts/tests/test_inconsistent_namespace_check.py | 2 +- scripts/tests/test_validate_docstrings.py | 7 +++++-- scripts/tests/test_validate_unwanted_patterns.py | 3 ++- 7 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 scripts/__init__.py diff --git a/Makefile b/Makefile index f47c50032f83c..1fdd3cfdcf027 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY : develop build clean clean_pyc doc lint-diff black +.PHONY : develop build clean clean_pyc doc lint-diff black test-scripts all: develop @@ -25,3 +25,6 @@ doc: cd doc; \ python make.py clean; \ python make.py html + +test-scripts: + pytest scripts diff --git a/environment.yml b/environment.yml index 1259d0dd4ae44..f7d3c50f8400c 100644 --- a/environment.yml +++ b/environment.yml @@ -27,6 +27,7 @@ dependencies: - pre-commit>=2.9.2 - pycodestyle # used by flake8 - pyupgrade + - tokenize_rt # for scripts/ # documentation - gitpython # obtain contributors from git for whatsnew diff --git a/requirements-dev.txt b/requirements-dev.txt index 1817d79f96139..d58c7ab06820f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,6 +15,7 @@ mypy==0.812 pre-commit>=2.9.2 pycodestyle pyupgrade +tokenize_rt gitpython gitdb sphinx diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/scripts/tests/test_inconsistent_namespace_check.py b/scripts/tests/test_inconsistent_namespace_check.py index cc3509af5b138..9562a30ba0ffd 100644 --- a/scripts/tests/test_inconsistent_namespace_check.py +++ b/scripts/tests/test_inconsistent_namespace_check.py @@ -1,6 +1,6 @@ import pytest -from scripts.check_for_inconsistent_pandas_namespace import ( +from ..check_for_inconsistent_pandas_namespace import ( check_for_inconsistent_pandas_namespace, ) diff --git a/scripts/tests/test_validate_docstrings.py b/scripts/tests/test_validate_docstrings.py index 74819db7b878c..7e4c68ddc183b 100644 --- a/scripts/tests/test_validate_docstrings.py +++ b/scripts/tests/test_validate_docstrings.py @@ -2,7 +2,8 @@ import textwrap import pytest -import validate_docstrings + +from .. import validate_docstrings class BadDocstrings: @@ -162,7 +163,9 @@ def test_bad_class(self, capsys): ( "BadDocstrings", "indentation_is_not_a_multiple_of_four", - ("flake8 error: E111 indentation is not a multiple of four",), + # with flake8 3.9.0, the message ends with four spaces, + # whereas in earlier versions, it ended with "four" + ("flake8 error: E111 indentation is not a multiple of ",), ), ( "BadDocstrings", diff --git a/scripts/tests/test_validate_unwanted_patterns.py b/scripts/tests/test_validate_unwanted_patterns.py index 947666a730ee9..ef93fd1d21981 100644 --- a/scripts/tests/test_validate_unwanted_patterns.py +++ b/scripts/tests/test_validate_unwanted_patterns.py @@ -1,7 +1,8 @@ import io import pytest -import validate_unwanted_patterns + +from .. import validate_unwanted_patterns class TestBarePytestRaises: From a089103c1fbcd9d8d1d4aff1f170b47e584dc903 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 15 Mar 2021 19:49:37 -0700 Subject: [PATCH 2/3] get tokenize_rt from pip --- environment.yml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index f7d3c50f8400c..653d781c89755 100644 --- a/environment.yml +++ b/environment.yml @@ -27,7 +27,6 @@ dependencies: - pre-commit>=2.9.2 - pycodestyle # used by flake8 - pyupgrade - - tokenize_rt # for scripts/ # documentation - gitpython # obtain contributors from git for whatsnew @@ -116,3 +115,4 @@ dependencies: - pip: - git+https://github.com/pydata/pydata-sphinx-theme.git@master - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI + - tokenize_rt # needed for scripts/ diff --git a/requirements-dev.txt b/requirements-dev.txt index d58c7ab06820f..113992884af26 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,7 +15,6 @@ mypy==0.812 pre-commit>=2.9.2 pycodestyle pyupgrade -tokenize_rt gitpython gitdb sphinx @@ -79,3 +78,4 @@ tabulate>=0.8.3 natsort git+https://github.com/pydata/pydata-sphinx-theme.git@master numpydoc < 1.2 +tokenize_rt From 57021e92430ea79c3b6e9c9a9990920e14c62a11 Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 16 Mar 2021 07:33:35 -0700 Subject: [PATCH 3/3] revert tokenize_rt dep --- environment.yml | 1 - requirements-dev.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/environment.yml b/environment.yml index 653d781c89755..1259d0dd4ae44 100644 --- a/environment.yml +++ b/environment.yml @@ -115,4 +115,3 @@ dependencies: - pip: - git+https://github.com/pydata/pydata-sphinx-theme.git@master - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI - - tokenize_rt # needed for scripts/ diff --git a/requirements-dev.txt b/requirements-dev.txt index 113992884af26..1817d79f96139 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -78,4 +78,3 @@ tabulate>=0.8.3 natsort git+https://github.com/pydata/pydata-sphinx-theme.git@master numpydoc < 1.2 -tokenize_rt