From 784bc2669ce7da6dcf8f45849197bebf8a7c3218 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Thu, 6 Jan 2022 17:57:55 -0800 Subject: [PATCH 1/9] Simplify dependency files --- .github/workflows/posix.yml | 8 ++-- ci/deps/actions-38-locale.yaml | 36 ---------------- ci/deps/actions-38-locale_slow.yaml | 30 ------------- ci/deps/actions-38-slow.yaml | 37 ---------------- ci/deps/actions-38.yaml | 48 +++++++++++++++++---- ci/deps/actions-39-slow.yaml | 41 ------------------ ci/deps/actions-39.yaml | 66 +++++++++++++++++------------ 7 files changed, 81 insertions(+), 185 deletions(-) delete mode 100644 ci/deps/actions-38-locale.yaml delete mode 100644 ci/deps/actions-38-locale_slow.yaml delete mode 100644 ci/deps/actions-38-slow.yaml delete mode 100644 ci/deps/actions-39-slow.yaml diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index e28878c2a03d8..66427cffc77b4 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -28,13 +28,13 @@ jobs: [actions-38-downstream_compat.yaml, "not slow and not network and not clipboard", "", "", "", "", ""], [actions-38-minimum_versions.yaml, "slow", "", "", "", "", ""], [actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""], - [actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""], + [actions-38.yaml, "not slow and not network", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""], + [actions-38.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""], [actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""], - [actions-38-slow.yaml, "slow", "", "", "", "", ""], - [actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""], - [actions-39-slow.yaml, "slow", "", "", "", "", ""], + [actions-38.yaml, "slow", "", "", "", "", ""], [actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", "--max-worker-restart 0"], [actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"], + [actions-39.yaml, "slow", "", "", "", "", ""], [actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""] ] fail-fast: false diff --git a/ci/deps/actions-38-locale.yaml b/ci/deps/actions-38-locale.yaml deleted file mode 100644 index ef2288e2a24a6..0000000000000 --- a/ci/deps/actions-38-locale.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: pandas-dev -channels: - - conda-forge -dependencies: - - python=3.8 - - # tools - - cython>=0.29.24 - - pytest>=6.0 - - pytest-cov - - pytest-xdist>=1.31 - - pytest-asyncio>=0.12.0 - - hypothesis>=5.5.3 - - # pandas dependencies - - beautifulsoup4 - - html5lib - - ipython - - jinja2 - - jedi - - lxml - - matplotlib - - nomkl - - numexpr - - numpy<1.20 # GH#39541 compat with pyarrow<3 - - openpyxl - - pytables - - python-dateutil - - pytz - - scipy - - xarray - - xlrd - - xlsxwriter - - xlwt - - pyarrow=1.0.1 - - pyxlsb diff --git a/ci/deps/actions-38-locale_slow.yaml b/ci/deps/actions-38-locale_slow.yaml deleted file mode 100644 index b16153398163b..0000000000000 --- a/ci/deps/actions-38-locale_slow.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: pandas-dev -channels: - - defaults - - conda-forge -dependencies: - - python=3.8 - - # tools - - cython>=0.29.24 - - pytest>=6.0 - - pytest-cov - - pytest-xdist>=1.31 - - hypothesis>=5.5.3 - - # pandas dependencies - - beautifulsoup4 - - bottleneck - - lxml - - matplotlib - - numpy - - openpyxl - - python-dateutil - - python-blosc - - pytz=2020.1 - - scipy - - sqlalchemy - - xlrd - - xlsxwriter - - xlwt - - html5lib diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/actions-38-slow.yaml deleted file mode 100644 index 5b3ff947aef8a..0000000000000 --- a/ci/deps/actions-38-slow.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: pandas-dev -channels: - - conda-forge -dependencies: - - python=3.8 - - # tools - - cython>=0.29.24 - - pytest>=6.0 - - pytest-cov - - pytest-xdist>=1.31 - - hypothesis>=5.5.3 - - # pandas dependencies - - beautifulsoup4 - - boto3 - - fsspec>=0.7.4 - - html5lib - - lxml - - matplotlib - - numexpr - - numpy - - openpyxl - - patsy - - psycopg2 - - pymysql - - pytables - - python-dateutil - - pytz - - s3fs>=0.4.0 - - scipy - - sqlalchemy - - xlrd - - xlsxwriter - - xlwt - - numba - - zstandard diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 2ad31ce82b855..08e75e315d025 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -1,20 +1,50 @@ name: pandas-dev channels: - - defaults - conda-forge dependencies: - python=3.8 - # tools - - cython>=0.29.24 + # test dependencies + - cython=0.29.24 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - psutil - # pandas dependencies - - numpy - - python-dateutil - - nomkl - - pytz - - tabulate + # required dependencies + - python-dateutil>=2.8.1 + - numpy>=1.18.5 + - pytz>=2020.1 + + # optional dependencies + - beautifulsoup4>=4.8.2 + - blosc>=1.20.1 + - bottleneck>=1.3.1 + - fastparquet>=0.4.0 + - fsspec>=0.7.4 + - html5lib>=1.1 + - gcsfs>=0.6.0 + - jinja2>=2.11 + - lxml>=4.5.0 + - matplotlib>=3.3.2 + - numba>=0.50.1 + - numexpr>=2.7.1 + - openpyxl>=3.0.3 + - odfpy>=1.4.1 + - pandas-gbq>=0.14.0 + - psycopg2>=2.8.4 + - pymysql>=0.10.1 + - pytables>=3.6.1 + - pyarrow>=1.0.1 + - pyreadstat + - pyxlsb>=1.0.6 + - s3fs>=0.4.0 + - scipy>=1.4.1 + - sqlalchemy>=1.4.0 + - tabulate>=0.8.7 + - xarray>=0.15.1 + - xlrd>=2.0.1 + - xlsxwriter>=1.2.2 + - xlwt>=1.3.0 + - zstandard>=0.15.2 diff --git a/ci/deps/actions-39-slow.yaml b/ci/deps/actions-39-slow.yaml deleted file mode 100644 index e0b85b0331933..0000000000000 --- a/ci/deps/actions-39-slow.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: pandas-dev -channels: - - defaults - - conda-forge -dependencies: - - python=3.9 - - # tools - - cython>=0.29.24 - - pytest>=6.0 - - pytest-cov - - pytest-xdist>=1.31 - - hypothesis>=5.5.3 - - # pandas dependencies - - beautifulsoup4 - - bottleneck - - boto3 - - fsspec>=0.8.0 - - gcsfs - - html5lib - - jinja2 - - lxml - - matplotlib - - numba - - numexpr - - numpy - - openpyxl - - pyarrow>2.0.1 - - pytables - - python-dateutil - - pytz - - s3fs>=0.4.2 - - scipy - - sqlalchemy - - xlrd - - xlsxwriter - - xlwt - - pyreadstat - - pyxlsb - - zstandard diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index f62520ea1da9e..9fc2e3b8bad2b 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -4,37 +4,47 @@ channels: dependencies: - python=3.9 - # tools - - cython>=0.29.24 + # test dependencies + - cython=0.29.24 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - psutil - # pandas dependencies - - beautifulsoup4 - - bottleneck - - boto3 - - fsspec>=0.8.0 - - gcsfs - - html5lib - - jinja2 - - lxml - - matplotlib - - numpy # move up to solve before numba - - numba - - numexpr - - openpyxl - - pyarrow>2.0.1 - - pytables - - python-dateutil - - pytz - - s3fs>=0.4.2 - - scipy - - sqlalchemy - - xlrd - - xlsxwriter - - xlwt + # required dependencies + - python-dateutil>=2.8.1 + - numpy>=1.18.5 + - pytz>=2020.1 + + # optional dependencies + - beautifulsoup4>=4.8.2 + - blosc>=1.20.1 + - bottleneck>=1.3.1 + - fastparquet>=0.4.0 + - fsspec>=0.7.4 + - html5lib>=1.1 + - gcsfs>=0.6.0 + - jinja2>=2.11 + - lxml>=4.5.0 + - matplotlib>=3.3.2 + - numba>=0.50.1 + - numexpr>=2.7.1 + - openpyxl>=3.0.3 + - odfpy>=1.4.1 + - pandas-gbq>=0.14.0 + - psycopg2>=2.8.4 + - pymysql>=0.10.1 + - pytables>=3.6.1 + - pyarrow>=1.0.1 - pyreadstat - - pyxlsb - - zstandard + - pyxlsb>=1.0.6 + - s3fs>=0.4.0 + - scipy>=1.4.1 + - sqlalchemy>=1.4.0 + - tabulate>=0.8.7 + - xarray>=0.15.1 + - xlrd>=2.0.1 + - xlsxwriter>=1.2.2 + - xlwt>=1.3.0 + - zstandard>=0.15.2 From 8e802eb9f1e36f021cf41bcd03687a98bd9cc1bd Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Fri, 7 Jan 2022 17:21:16 -0800 Subject: [PATCH 2/9] Remove pins --- ci/deps/actions-38.yaml | 64 ++++++++++++++++++++--------------------- ci/deps/actions-39.yaml | 64 ++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 08e75e315d025..60db02def8a3d 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -13,38 +13,38 @@ dependencies: - psutil # required dependencies - - python-dateutil>=2.8.1 - - numpy>=1.18.5 - - pytz>=2020.1 + - python-dateutil + - numpy + - pytz # optional dependencies - - beautifulsoup4>=4.8.2 - - blosc>=1.20.1 - - bottleneck>=1.3.1 - - fastparquet>=0.4.0 - - fsspec>=0.7.4 - - html5lib>=1.1 - - gcsfs>=0.6.0 - - jinja2>=2.11 - - lxml>=4.5.0 - - matplotlib>=3.3.2 - - numba>=0.50.1 - - numexpr>=2.7.1 - - openpyxl>=3.0.3 - - odfpy>=1.4.1 - - pandas-gbq>=0.14.0 - - psycopg2>=2.8.4 - - pymysql>=0.10.1 - - pytables>=3.6.1 - - pyarrow>=1.0.1 + - beautifulsoup4 + - blosc + - bottleneck + - fastparquet + - fsspec + - html5lib + - gcsfs + - jinja2 + - lxml + - matplotlib + - numba + - numexpr + - openpyxl + - odfpy + - pandas-gbq + - psycopg2 + - pymysql + - pytables + - pyarrow - pyreadstat - - pyxlsb>=1.0.6 - - s3fs>=0.4.0 - - scipy>=1.4.1 - - sqlalchemy>=1.4.0 - - tabulate>=0.8.7 - - xarray>=0.15.1 - - xlrd>=2.0.1 - - xlsxwriter>=1.2.2 - - xlwt>=1.3.0 - - zstandard>=0.15.2 + - pyxlsb + - s3fs + - scipy + - sqlalchemy + - tabulate + - xarray + - xlrd + - xlsxwriter + - xlwt + - zstandard diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 9fc2e3b8bad2b..2d6430afd0b36 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -13,38 +13,38 @@ dependencies: - psutil # required dependencies - - python-dateutil>=2.8.1 - - numpy>=1.18.5 - - pytz>=2020.1 + - python-dateutil + - numpy + - pytz # optional dependencies - - beautifulsoup4>=4.8.2 - - blosc>=1.20.1 - - bottleneck>=1.3.1 - - fastparquet>=0.4.0 - - fsspec>=0.7.4 - - html5lib>=1.1 - - gcsfs>=0.6.0 - - jinja2>=2.11 - - lxml>=4.5.0 - - matplotlib>=3.3.2 - - numba>=0.50.1 - - numexpr>=2.7.1 - - openpyxl>=3.0.3 - - odfpy>=1.4.1 - - pandas-gbq>=0.14.0 - - psycopg2>=2.8.4 - - pymysql>=0.10.1 - - pytables>=3.6.1 - - pyarrow>=1.0.1 + - beautifulsoup4 + - blosc + - bottleneck + - fastparquet + - fsspec + - html5lib + - gcsfs + - jinja2 + - lxml + - matplotlib + - numba + - numexpr + - openpyxl + - odfpy + - pandas-gbq + - psycopg2 + - pymysql + - pytables + - pyarrow - pyreadstat - - pyxlsb>=1.0.6 - - s3fs>=0.4.0 - - scipy>=1.4.1 - - sqlalchemy>=1.4.0 - - tabulate>=0.8.7 - - xarray>=0.15.1 - - xlrd>=2.0.1 - - xlsxwriter>=1.2.2 - - xlwt>=1.3.0 - - zstandard>=0.15.2 + - pyxlsb + - s3fs + - scipy + - sqlalchemy + - tabulate + - xarray + - xlrd + - xlsxwriter + - xlwt + - zstandard From 86d0f1584224ea1a8799e07b0e6f23f7bc8804e5 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Sat, 8 Jan 2022 13:45:28 -0800 Subject: [PATCH 3/9] Failing on pyarrow 2.0, bump to 3.0 tests check --- pandas/tests/arrays/period/test_arrow_compat.py | 8 ++++---- pandas/tests/io/test_feather.py | 4 ++-- pandas/tests/io/test_parquet.py | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pandas/tests/arrays/period/test_arrow_compat.py b/pandas/tests/arrays/period/test_arrow_compat.py index 6066d49b68489..ab2a917641d28 100644 --- a/pandas/tests/arrays/period/test_arrow_compat.py +++ b/pandas/tests/arrays/period/test_arrow_compat.py @@ -1,6 +1,6 @@ import pytest -from pandas.compat import pa_version_under2p0 +from pandas.compat import pa_version_under3p0 from pandas.core.dtypes.dtypes import PeriodDtype @@ -72,7 +72,7 @@ def test_arrow_array_missing(): @pytest.mark.xfail( - pa_version_under2p0, reason="pyarrow incorrectly uses pandas internals API" + pa_version_under3p0, reason="pyarrow incorrectly uses pandas internals API" ) def test_arrow_table_roundtrip(): from pandas.core.arrays._arrow_utils import ArrowPeriodType @@ -94,7 +94,7 @@ def test_arrow_table_roundtrip(): @pytest.mark.xfail( - pa_version_under2p0, reason="pyarrow incorrectly uses pandas internals API" + pa_version_under3p0, reason="pyarrow incorrectly uses pandas internals API" ) def test_arrow_load_from_zero_chunks(): # GH-41040 @@ -115,7 +115,7 @@ def test_arrow_load_from_zero_chunks(): @pytest.mark.xfail( - pa_version_under2p0, reason="pyarrow incorrectly uses pandas internals API" + pa_version_under3p0, reason="pyarrow incorrectly uses pandas internals API" ) def test_arrow_table_roundtrip_without_metadata(): arr = PeriodArray([1, 2, 3], freq="H") diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index 15d41c56c13c1..71660b25bd21f 100644 --- a/pandas/tests/io/test_feather.py +++ b/pandas/tests/io/test_feather.py @@ -2,7 +2,7 @@ import numpy as np import pytest -from pandas.compat.pyarrow import pa_version_under2p0 +from pandas.compat.pyarrow import pa_version_under3p0 import pandas as pd import pandas._testing as tm @@ -87,7 +87,7 @@ def test_basic(self): ), } ) - if not pa_version_under2p0: + if not pa_version_under3p0: # older pyarrow incorrectly uses pandas internal API, so # constructs invalid Block df["periods"] = pd.period_range("2013", freq="M", periods=3) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index ea88454ce7963..56f30883aa2fa 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -15,6 +15,7 @@ from pandas.compat.pyarrow import ( pa_version_under2p0, + pa_version_under3p0, pa_version_under5p0, pa_version_under6p0, ) @@ -654,9 +655,9 @@ def test_use_nullable_dtypes(self, engine, request): pytest.param( "period[D]", # Note: I don't know exactly what version the cutoff is; - # On the CI it fails with 1.0.1 + # On the CI it fails with 1.0.1 & 2.0.0 marks=pytest.mark.xfail( - pa_version_under2p0, + pa_version_under3p0, reason="pyarrow uses pandas internal API incorrectly", ), ), @@ -899,7 +900,7 @@ def test_pyarrow_backed_string_array(self, pa, string_storage): @td.skip_if_no("pyarrow") @pytest.mark.xfail( - pa_version_under2p0, reason="pyarrow uses pandas internal API incorrectly" + pa_version_under3p0, reason="pyarrow uses pandas internal API incorrectly" ) def test_additional_extension_types(self, pa): # test additional ExtensionArrays that are supported through the From cf98c5b6454bdddec551b376458cd09f24a43f31 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Sun, 9 Jan 2022 11:26:02 -0800 Subject: [PATCH 4/9] Passing now? --- .../tests/arrays/floating/test_construction.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/pandas/tests/arrays/floating/test_construction.py b/pandas/tests/arrays/floating/test_construction.py index 6fa3744429e5d..ca01b2f4897cc 100644 --- a/pandas/tests/arrays/floating/test_construction.py +++ b/pandas/tests/arrays/floating/test_construction.py @@ -1,13 +1,6 @@ -import locale - import numpy as np import pytest -from pandas.compat import ( - is_platform_windows, - np_version_under1p20, -) - import pandas as pd import pandas._testing as tm from pandas.core.arrays import FloatingArray @@ -47,7 +40,7 @@ def test_floating_array_constructor(): FloatingArray(values) -def test_floating_array_disallows_float16(request): +def test_floating_array_disallows_float16(): # GH#44715 arr = np.array([1, 2], dtype=np.float16) mask = np.array([False, False]) @@ -56,15 +49,6 @@ def test_floating_array_disallows_float16(request): with pytest.raises(TypeError, match=msg): FloatingArray(arr, mask) - if np_version_under1p20 or ( - locale.getlocale()[0] != "en_US" and not is_platform_windows() - ): - # the locale condition may need to be refined; this fails on - # the CI in the ZH_CN build - # https://github.com/numpy/numpy/issues/20512 - mark = pytest.mark.xfail(reason="numpy does not raise on np.dtype('Float16')") - request.node.add_marker(mark) - with pytest.raises(TypeError, match="data type 'Float16' not understood"): pd.array([1.0, 2.0], dtype="Float16") From 2fffc1b78a0dfe3039c1b5e72ccb7124afd5ae82 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Sun, 9 Jan 2022 16:39:43 -0800 Subject: [PATCH 5/9] Revert "Passing now?" This reverts commit cf98c5b6454bdddec551b376458cd09f24a43f31. --- .../tests/arrays/floating/test_construction.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pandas/tests/arrays/floating/test_construction.py b/pandas/tests/arrays/floating/test_construction.py index ca01b2f4897cc..6fa3744429e5d 100644 --- a/pandas/tests/arrays/floating/test_construction.py +++ b/pandas/tests/arrays/floating/test_construction.py @@ -1,6 +1,13 @@ +import locale + import numpy as np import pytest +from pandas.compat import ( + is_platform_windows, + np_version_under1p20, +) + import pandas as pd import pandas._testing as tm from pandas.core.arrays import FloatingArray @@ -40,7 +47,7 @@ def test_floating_array_constructor(): FloatingArray(values) -def test_floating_array_disallows_float16(): +def test_floating_array_disallows_float16(request): # GH#44715 arr = np.array([1, 2], dtype=np.float16) mask = np.array([False, False]) @@ -49,6 +56,15 @@ def test_floating_array_disallows_float16(): with pytest.raises(TypeError, match=msg): FloatingArray(arr, mask) + if np_version_under1p20 or ( + locale.getlocale()[0] != "en_US" and not is_platform_windows() + ): + # the locale condition may need to be refined; this fails on + # the CI in the ZH_CN build + # https://github.com/numpy/numpy/issues/20512 + mark = pytest.mark.xfail(reason="numpy does not raise on np.dtype('Float16')") + request.node.add_marker(mark) + with pytest.raises(TypeError, match="data type 'Float16' not understood"): pd.array([1.0, 2.0], dtype="Float16") From 09270aed23ce9e36ffc5c00e25c8ef58c6e8fb48 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Sun, 9 Jan 2022 16:45:28 -0800 Subject: [PATCH 6/9] Refine condidition --- .../tests/arrays/floating/test_construction.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pandas/tests/arrays/floating/test_construction.py b/pandas/tests/arrays/floating/test_construction.py index 6fa3744429e5d..f2b31b8f64a98 100644 --- a/pandas/tests/arrays/floating/test_construction.py +++ b/pandas/tests/arrays/floating/test_construction.py @@ -1,12 +1,7 @@ -import locale - import numpy as np import pytest -from pandas.compat import ( - is_platform_windows, - np_version_under1p20, -) +from pandas.compat import np_version_under1p20 import pandas as pd import pandas._testing as tm @@ -47,7 +42,7 @@ def test_floating_array_constructor(): FloatingArray(values) -def test_floating_array_disallows_float16(request): +def test_floating_array_disallows_float16(): # GH#44715 arr = np.array([1, 2], dtype=np.float16) mask = np.array([False, False]) @@ -56,11 +51,10 @@ def test_floating_array_disallows_float16(request): with pytest.raises(TypeError, match=msg): FloatingArray(arr, mask) - if np_version_under1p20 or ( - locale.getlocale()[0] != "en_US" and not is_platform_windows() - ): - # the locale condition may need to be refined; this fails on - # the CI in the ZH_CN build + +def test_floating_array_disallows_Float16_dtype(request): + # GH#44715 + if np_version_under1p20: # https://github.com/numpy/numpy/issues/20512 mark = pytest.mark.xfail(reason="numpy does not raise on np.dtype('Float16')") request.node.add_marker(mark) From c15f9bdc173b8d8e1b24651245f46ef21d85a73d Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Mon, 10 Jan 2022 13:25:50 -0800 Subject: [PATCH 7/9] Adjust tests for it_IT locale --- pandas/tests/io/excel/test_readers.py | 6 ++++-- pandas/tests/tools/test_to_datetime.py | 12 ++++++------ pandas/tests/tools/test_to_time.py | 14 +++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/pandas/tests/io/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index 7d18c2e63e74f..cb1076c21e9a7 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -738,9 +738,11 @@ def test_bad_sheetname_raises(self, read_ext, sheet_name): def test_missing_file_raises(self, read_ext): bad_file = f"foo{read_ext}" - # CI tests with zh_CN.utf8, translates to "No such file or directory" + # CI tests with other languages, translates to "No such file or directory" + match = r"(No such file or directory|没有那个文件或目录|File o directory non esistente)" with pytest.raises( - FileNotFoundError, match=r"(No such file or directory|没有那个文件或目录)" + FileNotFoundError, + match=match, ): pd.read_excel(bad_file) diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 07b1277b6f31b..5f8e0b4f70ec4 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -288,8 +288,8 @@ def test_to_datetime_format_microsecond(self, cache): "%m/%d/%Y %I:%M %p", Timestamp("2010-01-10 20:14"), marks=pytest.mark.xfail( - locale.getlocale()[0] == "zh_CN", - reason="fail on a CI build with LC_ALL=zh_CN.utf8", + locale.getlocale()[0] in ("zh_CN", "it_IT"), + reason="fail on a CI build with LC_ALL=zh_CN.utf8/it_IT.utf8", ), ), pytest.param( @@ -297,8 +297,8 @@ def test_to_datetime_format_microsecond(self, cache): "%m/%d/%Y %I:%M %p", Timestamp("2010-01-10 07:40"), marks=pytest.mark.xfail( - locale.getlocale()[0] == "zh_CN", - reason="fail on a CI build with LC_ALL=zh_CN.utf8", + locale.getlocale()[0] in ("zh_CN", "it_IT"), + reason="fail on a CI build with LC_ALL=zh_CN.utf8/it_IT.utf8", ), ), pytest.param( @@ -306,8 +306,8 @@ def test_to_datetime_format_microsecond(self, cache): "%m/%d/%Y %I:%M:%S %p", Timestamp("2010-01-10 09:12:56"), marks=pytest.mark.xfail( - locale.getlocale()[0] == "zh_CN", - reason="fail on a CI build with LC_ALL=zh_CN.utf8", + locale.getlocale()[0] in ("zh_CN", "it_IT"), + reason="fail on a CI build with LC_ALL=zh_CN.utf8/it_IT.utf8", ), ), ], diff --git a/pandas/tests/tools/test_to_time.py b/pandas/tests/tools/test_to_time.py index 968102ce9edde..7983944d4384d 100644 --- a/pandas/tests/tools/test_to_time.py +++ b/pandas/tests/tools/test_to_time.py @@ -9,9 +9,9 @@ from pandas.core.tools.datetimes import to_time as to_time_alias from pandas.core.tools.times import to_time -fails_on_zh_cn = pytest.mark.xfail( - locale.getlocale()[0] == "zh_CN", - reason="fail on a CI build with LC_ALL=zh_CN.utf8", +fails_on_non_english = pytest.mark.xfail( + locale.getlocale()[0] in ("zh_CN", "it_IT"), + reason="fail on a CI build with LC_ALL=zh_CN.utf8/it_IT.utf8", ) @@ -21,12 +21,12 @@ class TestToTime: [ "14:15", "1415", - pytest.param("2:15pm", marks=fails_on_zh_cn), - pytest.param("0215pm", marks=fails_on_zh_cn), + pytest.param("2:15pm", marks=fails_on_non_english), + pytest.param("0215pm", marks=fails_on_non_english), "14:15:00", "141500", - pytest.param("2:15:00pm", marks=fails_on_zh_cn), - pytest.param("021500pm", marks=fails_on_zh_cn), + pytest.param("2:15:00pm", marks=fails_on_non_english), + pytest.param("021500pm", marks=fails_on_non_english), time(14, 15), ], ) From 99a6076f53ace09baa54e5f2f0f726ff0c7a38aa Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Mon, 10 Jan 2022 13:26:15 -0800 Subject: [PATCH 8/9] Adjust tests for it_IT locale --- pandas/tests/io/excel/test_readers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/tests/io/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index cb1076c21e9a7..379ddb0ad1569 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -740,10 +740,7 @@ def test_missing_file_raises(self, read_ext): bad_file = f"foo{read_ext}" # CI tests with other languages, translates to "No such file or directory" match = r"(No such file or directory|没有那个文件或目录|File o directory non esistente)" - with pytest.raises( - FileNotFoundError, - match=match, - ): + with pytest.raises(FileNotFoundError, match=match): pd.read_excel(bad_file) def test_corrupt_bytes_raises(self, read_ext, engine): From d56f1a2077a617b8c229c7bb6f7472b0a372fbe7 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 11 Jan 2022 17:33:42 -0800 Subject: [PATCH 9/9] Add concurrency change as well --- .github/workflows/posix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 66427cffc77b4..ab27d1f0207cf 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -52,7 +52,7 @@ jobs: COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }} concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 - group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }} + group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }} cancel-in-progress: true services: