diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index a3d3f316e06cd..86c25642f4b2a 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..60db02def8a3d 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 + # required dependencies - python-dateutil - - nomkl + - numpy - pytz + + # optional dependencies + - beautifulsoup4 + - blosc + - bottleneck + - fastparquet + - fsspec + - html5lib + - gcsfs + - jinja2 + - lxml + - matplotlib + - numba + - numexpr + - openpyxl + - odfpy + - pandas-gbq + - psycopg2 + - pymysql + - pytables + - pyarrow + - pyreadstat + - pyxlsb + - s3fs + - scipy + - sqlalchemy - tabulate + - xarray + - xlrd + - xlsxwriter + - xlwt + - zstandard 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..2d6430afd0b36 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 + # required dependencies + - python-dateutil + - numpy + - pytz + + # optional dependencies - beautifulsoup4 + - blosc - bottleneck - - boto3 - - fsspec>=0.8.0 - - gcsfs + - fastparquet + - fsspec - html5lib + - gcsfs - jinja2 - lxml - matplotlib - - numpy # move up to solve before numba - numba - numexpr - openpyxl - - pyarrow>2.0.1 + - odfpy + - pandas-gbq + - psycopg2 + - pymysql - pytables - - python-dateutil - - pytz - - s3fs>=0.4.2 + - pyarrow + - pyreadstat + - pyxlsb + - s3fs - scipy - sqlalchemy + - tabulate + - xarray - xlrd - xlsxwriter - xlwt - - pyreadstat - - pyxlsb - zstandard 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) 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/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index 1c5557216fd6a..589c98721f139 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -738,10 +738,9 @@ 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" - with pytest.raises( - FileNotFoundError, match=r"(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=match): pd.read_excel(bad_file) def test_corrupt_bytes_raises(self, read_ext, engine): diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index 19b5ef51e738c..6b5528c87ac15 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 e6cf2d437731f..00623b3b47134 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 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), ], )