diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index b8b85201982d2..f7600a712922d 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -28,14 +28,16 @@ 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, "not slow and not clipboard", "", "", "", "", ""] + [actions-39.yaml, "slow", "", "", "", "", ""], + [actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""], + [actions-310-numpydev.yaml, "not slow and not network", "xclip", "", "", "deprecate", "-W error"], + [actions-310.yaml, "not slow and not clipboard", "", "", "", "", ""], + [actions-310.yaml, "slow", "", "", "", "", ""], ] fail-fast: false env: @@ -52,7 +54,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: diff --git a/.github/workflows/python-dev.yml b/.github/workflows/python-dev.yml index 3f9ea2aac22c7..5803e6351231b 100644 --- a/.github/workflows/python-dev.yml +++ b/.github/workflows/python-dev.yml @@ -1,3 +1,11 @@ +# This file is purposely frozen(does not run). DO NOT DELETE IT +# Unfreeze(by commentingthe if: false() condition) once the +# next Python Dev version has released beta 1 and both Cython and numpy support it +# After that Python has released, migrate the workflows to the +# posix GHA workflows/Azure pipelines and "freeze" this file by +# uncommenting the if: false() condition +# Feel free to modify this comment as necessary. + name: Python Dev on: @@ -21,13 +29,14 @@ env: jobs: build: + if: false # Comment this line out to "unfreeze" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - name: actions-310-dev + name: actions-311-dev timeout-minutes: 80 concurrency: @@ -43,7 +52,7 @@ jobs: - name: Set up Python Dev Version uses: actions/setup-python@v2 with: - python-version: '3.10-dev' + python-version: '3.11-dev' # TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941 - name: Install dependencies diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml index b7c36bb87353b..02a4a9ad44865 100644 --- a/ci/azure/posix.yml +++ b/ci/azure/posix.yml @@ -18,6 +18,26 @@ jobs: CONDA_PY: "38" PATTERN: "not slow" PYTEST_TARGET: "pandas/tests/[i-z]*" + py39_macos_1: + ENV_FILE: ci/deps/azure-macos-39.yaml + CONDA_PY: "39" + PATTERN: "not slow" + PYTEST_TARGET: "pandas/tests/[a-h]*" + py39_macos_2: + ENV_FILE: ci/deps/azure-macos-39.yaml + CONDA_PY: "39" + PATTERN: "not slow" + PYTEST_TARGET: "pandas/tests/[i-z]*" + py310_macos_1: + ENV_FILE: ci/deps/azure-macos-310.yaml + CONDA_PY: "310" + PATTERN: "not slow" + PYTEST_TARGET: "pandas/tests/[a-h]*" + py310_macos_2: + ENV_FILE: ci/deps/azure-macos-310.yaml + CONDA_PY: "310" + PATTERN: "not slow" + PYTEST_TARGET: "pandas/tests/[i-z]*" steps: - script: echo '##vso[task.prependpath]$(HOME)/miniconda3/bin' diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 7f3efb5a4dbf3..7061a266f28c7 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -36,6 +36,20 @@ jobs: PYTEST_WORKERS: 2 # GH-42236 PYTEST_TARGET: "pandas/tests/[i-z]*" + py310_1: + ENV_FILE: ci/deps/azure-windows-310.yaml + CONDA_PY: "310" + PATTERN: "not slow and not high_memory" + PYTEST_WORKERS: 2 # GH-42236 + PYTEST_TARGET: "pandas/tests/[a-h]*" + + py310_2: + ENV_FILE: ci/deps/azure-windows-310.yaml + CONDA_PY: "310" + PATTERN: "not slow and not high_memory" + PYTEST_WORKERS: 2 # GH-42236 + PYTEST_TARGET: "pandas/tests/[i-z]*" + steps: - powershell: | Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" diff --git a/ci/deps/actions-39-numpydev.yaml b/ci/deps/actions-310-numpydev.yaml similarity index 95% rename from ci/deps/actions-39-numpydev.yaml rename to ci/deps/actions-310-numpydev.yaml index 4a6acf55e265f..3e32665d5433f 100644 --- a/ci/deps/actions-39-numpydev.yaml +++ b/ci/deps/actions-310-numpydev.yaml @@ -2,7 +2,7 @@ name: pandas-dev channels: - defaults dependencies: - - python=3.9 + - python=3.10 # tools - pytest>=6.0 diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml new file mode 100644 index 0000000000000..9829380620f86 --- /dev/null +++ b/ci/deps/actions-310.yaml @@ -0,0 +1,51 @@ +name: pandas-dev +channels: + - conda-forge +dependencies: + - python=3.9 + + # test dependencies + - cython=0.29.24 + - pytest>=6.0 + - pytest-cov + - pytest-xdist>=1.31 + - hypothesis>=5.5.3 + - psutil + + # required dependencies + - python-dateutil + - numpy + - pytz + + # optional dependencies + - beautifulsoup4 + - blosc + - bottleneck + - fastparquet + - fsspec + - html5lib + - gcsfs + - jinja2 + - lxml + - matplotlib + # TODO: uncomment after numba supports py310 + #- 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-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.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-38-locale.yaml b/ci/deps/azure-macos-310.yaml similarity index 67% rename from ci/deps/actions-38-locale.yaml rename to ci/deps/azure-macos-310.yaml index 9053bc677eb4e..312fac8091db6 100644 --- a/ci/deps/actions-38-locale.yaml +++ b/ci/deps/azure-macos-310.yaml @@ -1,36 +1,36 @@ name: pandas-dev channels: + - defaults - conda-forge dependencies: - - python=3.8 + - python=3.10 # tools - cython>=0.29.24 - pytest>=6.0 - - pytest-cov - pytest-xdist>=1.31 - - pytest-asyncio>=0.12.0 - hypothesis>=5.5.3 + - pytest-azurepipelines # pandas dependencies - beautifulsoup4 + - bottleneck - html5lib - - ipython - jinja2 - - jedi - lxml - matplotlib - nomkl - numexpr - - numpy<1.20 # GH#39541 compat with pyarrow<3 + - numpy - openpyxl + - pyarrow + - pyreadstat - pytables - - python-dateutil + - python-dateutil==2.8.1 - pytz - - scipy + - pyxlsb - xarray - xlrd - xlsxwriter - xlwt - - pyarrow=4 - - pyxlsb + - zstandard diff --git a/ci/deps/azure-macos-38.yaml b/ci/deps/azure-macos-38.yaml index 472dc8754d13e..422aa86c57fc7 100644 --- a/ci/deps/azure-macos-38.yaml +++ b/ci/deps/azure-macos-38.yaml @@ -6,6 +6,7 @@ dependencies: - python=3.8 # tools + - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 - hypothesis>=5.5.3 @@ -33,6 +34,3 @@ dependencies: - xlsxwriter - xlwt - zstandard - - pip - - pip: - - cython>=0.29.24 diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/azure-macos-39.yaml similarity index 59% rename from ci/deps/actions-38-slow.yaml rename to ci/deps/azure-macos-39.yaml index 5b3ff947aef8a..a0860ef536953 100644 --- a/ci/deps/actions-38-slow.yaml +++ b/ci/deps/azure-macos-39.yaml @@ -1,37 +1,36 @@ name: pandas-dev channels: + - defaults - conda-forge dependencies: - - python=3.8 + - python=3.9 # tools - cython>=0.29.24 - pytest>=6.0 - - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - pytest-azurepipelines # pandas dependencies - beautifulsoup4 - - boto3 - - fsspec>=0.7.4 + - bottleneck - html5lib + - jinja2 - lxml - - matplotlib + - matplotlib=3.3.2 + - nomkl - numexpr - - numpy + - numpy=1.21.3 - openpyxl - - patsy - - psycopg2 - - pymysql + - pyarrow=1.0.1 + - pyreadstat - pytables - - python-dateutil + - python-dateutil==2.8.1 - pytz - - s3fs>=0.4.0 - - scipy - - sqlalchemy + - pyxlsb + - xarray - xlrd - xlsxwriter - xlwt - - numba - zstandard diff --git a/ci/deps/actions-39-slow.yaml b/ci/deps/azure-windows-310.yaml similarity index 81% rename from ci/deps/actions-39-slow.yaml rename to ci/deps/azure-windows-310.yaml index e0b85b0331933..8e6f4deef6057 100644 --- a/ci/deps/actions-39-slow.yaml +++ b/ci/deps/azure-windows-310.yaml @@ -1,32 +1,32 @@ name: pandas-dev channels: - - defaults - conda-forge + - defaults dependencies: - - python=3.9 + - python=3.10 # tools - cython>=0.29.24 - pytest>=6.0 - - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - pytest-azurepipelines # pandas dependencies - beautifulsoup4 - bottleneck - - boto3 - fsspec>=0.8.0 - gcsfs - html5lib - jinja2 - lxml - matplotlib - - numba + # TODO: uncomment after numba supports py310 + #- numba - numexpr - numpy - openpyxl - - pyarrow>2.0.1 + - pyarrow - pytables - python-dateutil - pytz 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/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/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 6c07366e402d6..ff247349ff4d5 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -682,7 +682,7 @@ def test_raise_error_on_datetime_time_data(self): # GH 8113, datetime.time type is not supported by matplotlib in scatter df = DataFrame(np.random.randn(10), columns=["a"]) df["dtime"] = date_range(start="2014-01-01", freq="h", periods=10).time - msg = "must be a string or a number, not 'datetime.time'" + msg = "must be a string or a (real )?number, not 'datetime.time'" with pytest.raises(TypeError, match=msg): df.plot(kind="scatter", x="dtime", y="a") diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 5d5e01084345d..0a9d422c45036 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), ], )