Skip to content

Commit

Permalink
suppress in pyproj
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Nov 9, 2024
1 parent 567d064 commit d28b034
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
41 changes: 38 additions & 3 deletions geoviews/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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")

Expand All @@ -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})
2 changes: 2 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

0 comments on commit d28b034

Please sign in to comment.