From 27d0890a8d78dbc37ebf935c8d714b5e26532029 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 15 Jun 2020 15:06:24 +0100 Subject: [PATCH 1/5] CI: Checks-and-Web-and-Docs-on-1.0.x --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d87fa5203bd52..e65774e3bf0bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,13 @@ name: CI on: push: - branches: master + branches: + - master + - 1.0.x pull_request: - branches: master + branches: + - master + - 1.0.x env: ENV_FILE: environment.yml From 71c8cbf5d0f764cc1a3c51e67f6ff65f4b8d3dcb Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 15 Jun 2020 16:02:54 +0100 Subject: [PATCH 2/5] avoid uploading web and docs if merged. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e65774e3bf0bf..e846ef9b0d4ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - 1.0.x pull_request: branches: - master From f196e8d05a706bd3899c6ccdb528e4a314598d90 Mon Sep 17 00:00:00 2001 From: Michael Marino Date: Wed, 13 May 2020 16:30:31 +0200 Subject: [PATCH 3/5] CI: Address linting errors in flake8 >= 3.8.1 (#34152) --- pandas/core/arrays/interval.py | 1 + pandas/core/internals/concat.py | 2 +- pandas/tests/groupby/test_categorical.py | 6 +++--- setup.cfg | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index cc41ac1dc19a9..1c7a903df5584 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1070,6 +1070,7 @@ def mid(self): points) and is either monotonic increasing or monotonic decreasing, else False. """ + # https://github.com/python/mypy/issues/1362 # Mypy does not support decorated properties @property # type: ignore diff --git a/pandas/core/internals/concat.py b/pandas/core/internals/concat.py index c75373b82305c..2b230eae8c847 100644 --- a/pandas/core/internals/concat.py +++ b/pandas/core/internals/concat.py @@ -381,7 +381,7 @@ def is_uniform_join_units(join_units): """ return ( # all blocks need to have the same type - all(type(ju.block) is type(join_units[0].block) for ju in join_units) + all(isinstance(ju.block, type(join_units[0].block)) for ju in join_units) and # noqa # no blocks that would get missing values (can lead to type upcasts) # unless we're an extension dtype. diff --git a/pandas/tests/groupby/test_categorical.py b/pandas/tests/groupby/test_categorical.py index 1c2de8c8c223f..03e87aeb415e5 100644 --- a/pandas/tests/groupby/test_categorical.py +++ b/pandas/tests/groupby/test_categorical.py @@ -497,9 +497,9 @@ def test_dataframe_categorical_ordered_observed_sort(ordered, observed, sort): aggr[aggr.isna()] = "missing" if not all(label == aggr): msg = ( - f"Labels and aggregation results not consistently sorted\n" - + "for (ordered={ordered}, observed={observed}, sort={sort})\n" - + "Result:\n{result}" + "Labels and aggregation results not consistently sorted\n" + f"for (ordered={ordered}, observed={observed}, sort={sort})\n" + f"Result:\n{result}" ) assert False, msg diff --git a/setup.cfg b/setup.cfg index d0570cee6fe10..d536a1b6022cc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,7 @@ ignore = W504, # line break after binary operator E402, # module level import not at top of file E731, # do not assign a lambda expression, use a def + E741, # ambiguous variable name 'l' (GH#34150) C406, # Unnecessary list literal - rewrite as a dict literal. C408, # Unnecessary dict call - rewrite as a literal. C409, # Unnecessary list passed to tuple() - rewrite as a tuple literal. From 32cc00e0f14decb3f15448273fb262b95ea958c8 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 15 Jun 2020 18:09:30 +0100 Subject: [PATCH 4/5] Revert "CI: Address linting errors in flake8 >= 3.8.1 (#34152)" This reverts commit f196e8d05a706bd3899c6ccdb528e4a314598d90. --- pandas/core/arrays/interval.py | 1 - pandas/core/internals/concat.py | 2 +- pandas/tests/groupby/test_categorical.py | 6 +++--- setup.cfg | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 1c7a903df5584..cc41ac1dc19a9 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1070,7 +1070,6 @@ def mid(self): points) and is either monotonic increasing or monotonic decreasing, else False. """ - # https://github.com/python/mypy/issues/1362 # Mypy does not support decorated properties @property # type: ignore diff --git a/pandas/core/internals/concat.py b/pandas/core/internals/concat.py index 2b230eae8c847..c75373b82305c 100644 --- a/pandas/core/internals/concat.py +++ b/pandas/core/internals/concat.py @@ -381,7 +381,7 @@ def is_uniform_join_units(join_units): """ return ( # all blocks need to have the same type - all(isinstance(ju.block, type(join_units[0].block)) for ju in join_units) + all(type(ju.block) is type(join_units[0].block) for ju in join_units) and # noqa # no blocks that would get missing values (can lead to type upcasts) # unless we're an extension dtype. diff --git a/pandas/tests/groupby/test_categorical.py b/pandas/tests/groupby/test_categorical.py index 03e87aeb415e5..1c2de8c8c223f 100644 --- a/pandas/tests/groupby/test_categorical.py +++ b/pandas/tests/groupby/test_categorical.py @@ -497,9 +497,9 @@ def test_dataframe_categorical_ordered_observed_sort(ordered, observed, sort): aggr[aggr.isna()] = "missing" if not all(label == aggr): msg = ( - "Labels and aggregation results not consistently sorted\n" - f"for (ordered={ordered}, observed={observed}, sort={sort})\n" - f"Result:\n{result}" + f"Labels and aggregation results not consistently sorted\n" + + "for (ordered={ordered}, observed={observed}, sort={sort})\n" + + "Result:\n{result}" ) assert False, msg diff --git a/setup.cfg b/setup.cfg index d536a1b6022cc..d0570cee6fe10 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,6 @@ ignore = W504, # line break after binary operator E402, # module level import not at top of file E731, # do not assign a lambda expression, use a def - E741, # ambiguous variable name 'l' (GH#34150) C406, # Unnecessary list literal - rewrite as a dict literal. C408, # Unnecessary dict call - rewrite as a literal. C409, # Unnecessary list passed to tuple() - rewrite as a tuple literal. From fd8105579dc31627e860d8e9c01d68485417ffa5 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 15 Jun 2020 18:35:43 +0100 Subject: [PATCH 5/5] ignore flake8 E128, E721 errors --- ci/code_checks.sh | 2 +- pandas/core/arrays/interval.py | 1 + pandas/tests/groupby/test_categorical.py | 6 +++--- setup.cfg | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 30d3a3ffe5f7b..ea02ddbb81546 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -66,7 +66,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Linting .pyx code' ; echo $MSG - flake8 --format="$FLAKE8_FORMAT" pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C405,C406,C407,C408,C409,C410,C411 + flake8 --format="$FLAKE8_FORMAT" pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C405,C406,C407,C408,C409,C410,C411 RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Linting .pxd and .pxi.in' ; echo $MSG diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index cc41ac1dc19a9..1c7a903df5584 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1070,6 +1070,7 @@ def mid(self): points) and is either monotonic increasing or monotonic decreasing, else False. """ + # https://github.com/python/mypy/issues/1362 # Mypy does not support decorated properties @property # type: ignore diff --git a/pandas/tests/groupby/test_categorical.py b/pandas/tests/groupby/test_categorical.py index 1c2de8c8c223f..03e87aeb415e5 100644 --- a/pandas/tests/groupby/test_categorical.py +++ b/pandas/tests/groupby/test_categorical.py @@ -497,9 +497,9 @@ def test_dataframe_categorical_ordered_observed_sort(ordered, observed, sort): aggr[aggr.isna()] = "missing" if not all(label == aggr): msg = ( - f"Labels and aggregation results not consistently sorted\n" - + "for (ordered={ordered}, observed={observed}, sort={sort})\n" - + "Result:\n{result}" + "Labels and aggregation results not consistently sorted\n" + f"for (ordered={ordered}, observed={observed}, sort={sort})\n" + f"Result:\n{result}" ) assert False, msg diff --git a/setup.cfg b/setup.cfg index d0570cee6fe10..cf7c5a5ef6563 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,8 @@ ignore = W504, # line break after binary operator E402, # module level import not at top of file E731, # do not assign a lambda expression, use a def + E721, # do not compare types, use 'isinstance() + E741, # ambiguous variable name 'l' (GH#34150) C406, # Unnecessary list literal - rewrite as a dict literal. C408, # Unnecessary dict call - rewrite as a literal. C409, # Unnecessary list passed to tuple() - rewrite as a tuple literal.