Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPS: Use ipython run_cell instead of run_code; remove pytest-asyncio #55853

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
python -m pip install --no-cache-dir --no-build-isolation -e .
python -m pip list --no-cache-dir
export PANDAS_CI=1
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
python -m pip install --no-cache-dir --no-build-isolation -e .
python -m pip list --no-cache-dir

Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
python -m pip install versioneer[toml]
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
python -m pip install -ve . --no-build-isolation --no-index --no-deps
python -m pip list

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
shell: pwsh
run: |
$TST_CMD = @"
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17;
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
python -c `'import pandas as pd; pd.test(extra_args=[\"`\"--no-strict-data-files`\"\", \"`\"-m not clipboard and not single_cpu and not slow and not network and not db`\"\"])`';
"@
Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-311-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-311-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies:
# causes an InternalError within pytest
- pytest-xdist>=2.2.0, <3
- hypothesis>=6.46.1
- pytest-asyncio>=0.17.0

# pandas dependencies
- python-dateutil
Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-311-pyarrownightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
- pytest-cov
- pytest-xdist>=2.2.0
- hypothesis>=6.46.1
- pytest-asyncio>=0.17.0

# required dependencies
- python-dateutil
Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-39-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-pypy-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies:
# test dependencies
- pytest>=7.3.2
- pytest-cov
- pytest-asyncio>=0.17.0
- pytest-xdist>=2.2.0
- hypothesis>=6.46.1

Expand Down
1 change: 0 additions & 1 deletion ci/deps/circle-310-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- pytest-localserver>=0.7.1
- boto3

Expand Down
1 change: 0 additions & 1 deletion ci/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ test:
requires:
- pip
- pytest >=7.3.2
- pytest-asyncio >=0.17.0
- pytest-xdist >=2.2.0
- pytest-cov
- hypothesis >=6.46.1
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies:
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-asyncio>=0.17.0
- coverage

# required dependencies
Expand Down
7 changes: 2 additions & 5 deletions pandas/tests/arrays/categorical/test_warnings.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import pytest

from pandas.util._test_decorators import async_mark

import pandas._testing as tm


class TestCategoricalWarnings:
@async_mark()
async def test_tab_complete_warning(self, ip):
def test_tab_complete_warning(self, ip):
# https://github.com/pandas-dev/pandas/issues/16409
pytest.importorskip("IPython", minversion="6.0.0")
from IPython.core.completer import provisionalcompleter

code = "import pandas as pd; c = pd.Categorical([])"
await ip.run_code(code)
ip.run_cell(code)

# GH 31324 newer jedi version raises Deprecation warning;
# appears resolved 2021-02-02
Expand Down
8 changes: 2 additions & 6 deletions pandas/tests/frame/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

from pandas._config.config import option_context

from pandas.util._test_decorators import async_mark

import pandas as pd
from pandas import (
DataFrame,
Expand Down Expand Up @@ -288,8 +286,7 @@ def _check_f(base, f):
f = lambda x: x.rename({1: "foo"}, inplace=True)
_check_f(d.copy(), f)

@async_mark()
async def test_tab_complete_warning(self, ip, frame_or_series):
def test_tab_complete_warning(self, ip, frame_or_series):
# GH 16409
pytest.importorskip("IPython", minversion="6.0.0")
from IPython.core.completer import provisionalcompleter
Expand All @@ -299,8 +296,7 @@ async def test_tab_complete_warning(self, ip, frame_or_series):
else:
code = "from pandas import Series; obj = Series(dtype=object)"

await ip.run_code(code)

ip.run_cell(code)
# GH 31324 newer jedi version raises Deprecation warning;
# appears resolved 2021-02-02
with tm.assert_produces_warning(None, raise_on_extra_warnings=False):
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,14 +1243,13 @@ def test_cached_properties_not_settable(self):
with pytest.raises(AttributeError, match="Can't set attribute"):
index.is_unique = False

@td.async_mark()
async def test_tab_complete_warning(self, ip):
def test_tab_complete_warning(self, ip):
# https://github.com/pandas-dev/pandas/issues/16409
pytest.importorskip("IPython", minversion="6.0.0")
from IPython.core.completer import provisionalcompleter

code = "import pandas as pd; idx = pd.Index([1, 2])"
await ip.run_code(code)
ip.run_cell(code)

# GH 31324 newer jedi version raises Deprecation warning;
# appears resolved 2021-02-02
Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/resample/test_resampler_grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

from pandas.compat import is_platform_windows
from pandas.util._test_decorators import async_mark

import pandas as pd
from pandas import (
Expand All @@ -26,8 +25,7 @@ def test_frame():
)


@async_mark()
async def test_tab_complete_ipython6_warning(ip):
def test_tab_complete_ipython6_warning(ip):
from IPython.core.completer import provisionalcompleter

code = dedent(
Expand All @@ -37,7 +35,7 @@ async def test_tab_complete_ipython6_warning(ip):
rs = s.resample("D")
"""
)
await ip.run_code(code)
ip.run_cell(code)

# GH 31324 newer jedi version raises Deprecation warning;
# appears resolved 2021-02-02
Expand Down
11 changes: 0 additions & 11 deletions pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_foo():
IS64,
is_platform_windows,
)
from pandas.compat._optional import import_optional_dependency

from pandas.core.computation.expressions import (
NUMEXPR_INSTALLED,
Expand Down Expand Up @@ -204,16 +203,6 @@ def documented_fixture(fixture):
return documented_fixture


def async_mark():
try:
import_optional_dependency("pytest_asyncio")
async_mark = pytest.mark.asyncio
except ImportError:
async_mark = pytest.mark.skip(reason="Missing dependency pytest-asyncio")

return async_mark


def mark_array_manager_not_yet_implemented(request) -> None:
mark = pytest.mark.xfail(reason="Not yet implemented for ArrayManager")
request.applymarker(mark)
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repository = 'https://github.com/pandas-dev/pandas'
matplotlib = "pandas:plotting._matplotlib"

[project.optional-dependencies]
test = ['hypothesis>=6.46.1', 'pytest>=7.3.2', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0']
test = ['hypothesis>=6.46.1', 'pytest>=7.3.2', 'pytest-xdist>=2.2.0']
performance = ['bottleneck>=1.3.6', 'numba>=0.56.4', 'numexpr>=2.8.4']
computation = ['scipy>=1.10.0', 'xarray>=2022.12.0']
fss = ['fsspec>=2022.11.0']
Expand Down Expand Up @@ -110,7 +110,6 @@ all = ['beautifulsoup4>=4.11.2',
'pyreadstat>=1.2.0',
'pytest>=7.3.2',
'pytest-xdist>=2.2.0',
'pytest-asyncio>=0.17.0',
'python-calamine>=0.1.6',
'pyxlsb>=1.0.10',
'qtpy>=2.3.0',
Expand Down Expand Up @@ -153,7 +152,7 @@ setup = ['--vsenv'] # For Windows
skip = "cp36-* cp37-* cp38-* pp* *_i686 *_ppc64le *_s390x *-musllinux_aarch64"
build-verbosity = "3"
environment = {LDFLAGS="-Wl,--strip-all"}
test-requires = "hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17"
test-requires = "hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0"
test-command = """
PANDAS_CI='1' python -c 'import pandas as pd; \
pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "-n 2", "--no-strict-data-files"]); \
Expand Down Expand Up @@ -519,7 +518,6 @@ markers = [
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]
asyncio_mode = "strict"

[tool.mypy]
# Import discovery
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ meson-python==0.13.1
pytest>=7.3.2
pytest-cov
pytest-xdist>=2.2.0
pytest-asyncio>=0.17.0
coverage
python-dateutil
numpy<2
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/data/deps_expected_random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest-cov
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17.0
- boto3

# required dependencies
Expand Down
6 changes: 2 additions & 4 deletions scripts/tests/data/deps_minimum.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repository = 'https://github.com/pandas-dev/pandas'
matplotlib = "pandas:plotting._matplotlib"

[project.optional-dependencies]
test = ['hypothesis>=6.34.2', 'pytest>=7.3.2', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0']
test = ['hypothesis>=6.34.2', 'pytest>=7.3.2', 'pytest-xdist>=2.2.0']
performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1']
timezone = ['tzdata>=2022.1']
computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
Expand Down Expand Up @@ -102,7 +102,6 @@ all = ['beautifulsoup4>=5.9.3',
'pyreadstat>=1.1.2',
'pytest>=7.3.2',
'pytest-xdist>=2.2.0',
'pytest-asyncio>=0.17.0',
'python-calamine>=0.1.6',
'pyxlsb>=1.0.8',
'qtpy>=2.2.0',
Expand Down Expand Up @@ -142,7 +141,7 @@ parentdir_prefix = "pandas-"
[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
build-verbosity = "3"
test-requires = "hypothesis>=6.34.2 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17"
test-requires = "hypothesis>=6.34.2 pytest>=7.3.2 pytest-xdist>=2.2.0"
test-command = "python {project}/ci/test_wheels.py"

[tool.cibuildwheel.macos]
Expand Down Expand Up @@ -386,7 +385,6 @@ markers = [
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]
asyncio_mode = "strict"

[tool.mypy]
# Import discovery
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/data/deps_unmodified_random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pytest-cov
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3

# required dependencies
Expand Down
1 change: 0 additions & 1 deletion tooling/debug/Dockerfile.pandas-debug
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ RUN python3 -m pip install \
meson \
meson-python \
pytest \
pytest-asyncio \
python-dateutil \
pytz \
versioneer[toml]
Expand Down