From d28b034ba9bcc51e8884fc2eb197af555f3b731a Mon Sep 17 00:00:00 2001 From: Andrew Huang Date: Sat, 9 Nov 2024 06:29:19 -0800 Subject: [PATCH] suppress in pyproj --- geoviews/tests/conftest.py | 41 +++++++++++++++++++++++++++++++++++--- pixi.toml | 2 ++ pyproject.toml | 4 ++-- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/geoviews/tests/conftest.py b/geoviews/tests/conftest.py index 72305519..53925ffb 100644 --- a/geoviews/tests/conftest.py +++ b/geoviews/tests/conftest.py @@ -1,7 +1,45 @@ from contextlib import suppress +from holoviews.tests.conftest import bokeh_backend, port, serve_hv # noqa: F401 + import geoviews as gv +CUSTOM_MARKS = ("ui",) + + +def pytest_addoption(parser): + for marker in CUSTOM_MARKS: + parser.addoption( + f"--{marker}", + action="store_true", + default=False, + help=f"Run {marker} related tests", + ) + + +def pytest_configure(config): + for marker in CUSTOM_MARKS: + config.addinivalue_line("markers", f"{marker}: {marker} test marker") + + +def pytest_collection_modifyitems(config, items): + skipped, selected = [], [] + markers = [m for m in CUSTOM_MARKS if config.getoption(f"--{m}")] + empty = not markers + for item in items: + if empty and any(m in item.keywords for m in CUSTOM_MARKS): + skipped.append(item) + elif empty: + selected.append(item) + elif not empty and any(m in item.keywords for m in markers): + selected.append(item) + else: + skipped.append(item) + + config.hook.pytest_deselected(items=skipped) + items[:] = selected + + with suppress(Exception): gv.extension("bokeh") @@ -14,11 +52,8 @@ plt.switch_backend("agg") with suppress(Exception): - # From Dask 2023.7.1 they now automatically convert strings - # https://docs.dask.org/en/stable/changelog.html#v2023-7-1 # From Dask 2024.3.0 they now use `dask_expr` by default # https://github.com/dask/dask/issues/10995 import dask - dask.config.set({"dataframe.convert-string": False}) dask.config.set({"dataframe.query-planning": False}) diff --git a/pixi.toml b/pixi.toml index f0c4e05d..fb9b1784 100644 --- a/pixi.toml +++ b/pixi.toml @@ -101,6 +101,8 @@ rioxarray = "*" scipy = "*" shapely = "*" xarray = "*" +dask-core = "*" +dask-expr = "*" [feature.test-example.tasks] test-example = 'pytest -n logical --dist loadscope --nbval-lax examples' diff --git a/pyproject.toml b/pyproject.toml index b2be65db..a29c5f3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -175,9 +175,9 @@ filterwarnings = [ "ignore:\\s*Pyarrow will become a required dependency of pandas:DeprecationWarning", # Will go away by itself in Pandas 3.0 "ignore:Passing a (SingleBlockManager|BlockManager) to (Series|GeoSeries|DataFrame|GeoDataFrame) is deprecated:DeprecationWarning", # https://github.com/holoviz/spatialpandas/issues/137 "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", # https://github.com/dateutil/dateutil/pull/1285 - # 2024-02 - "ignore:The current Dask DataFrame implementation is deprecated:DeprecationWarning", # https://github.com/dask/dask/issues/10917 # 2024-03 "ignore:\\s*Dask dataframe query planning is disabled because dask-expr is not installed:FutureWarning", "ignore:numpy.ndarray size changed, may indicate binary incompatibility:RuntimeWarning", # https://github.com/pydata/xarray/issues/7259 + # 2024-11 + "ignore:The legacy Dask DataFrame implementation is deprecated and will be removed in a future version.:DeprecationWarning", # https://github.com/dask/dask/issues/10917 ]