Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v5.5.2
with:
file: mypy_report/cobertura.xml
files: mypy_report/cobertura.xml
flags: mypy
env_vars: PYTHON_VERSION
name: codecov-umbrella
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v5.5.2
with:
file: mypy_report/cobertura.xml
files: mypy_report/cobertura.xml
flags: mypy-min
env_vars: PYTHON_VERSION
name: codecov-umbrella
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
- name: Upload pyright coverage to Codecov
uses: codecov/codecov-action@v5.5.2
with:
file: pyright_report/cobertura.xml
files: pyright_report/cobertura.xml
flags: pyright
env_vars: PYTHON_VERSION
name: codecov-umbrella
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
files: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v5.5.2
with:
file: mypy_report/cobertura.xml
files: mypy_report/cobertura.xml
flags: mypy
env_vars: PYTHON_VERSION
name: codecov-umbrella
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.coverage.*
coverage.xml
.tox
nosetests.xml
.cache
Expand All @@ -47,6 +48,7 @@ nosetests.xml
.testmon*
.tmontmp/
.pytest_cache
pytest.xml
dask-worker-space/

# asv environments
Expand Down
9 changes: 6 additions & 3 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
pytest-env = "*"
pytest-mypy-plugins = "*"
pytest-mypy-plugins = ">=4.0.0"
pytest-reportlog = "*"
pytest-timeout = "*"
pytest-xdist = "*"
Expand Down Expand Up @@ -250,21 +250,24 @@ linkcheck = { cmd = "make linkcheck", cwd = "doc", description = "Check URLs in


[feature.typing.dependencies]
mypy = "==1.18.1"
mypy = "==1.19.1"
pyright = "*"
hypothesis = "*"
lxml = "*"
pandas-stubs = "<=2.3.3.251219"
scipy-stubs = ">=1.17.1.2"
types-colorama = "*"
types-docutils = "*"
types-decorator = "*"
types-networkx = "*"
types-openpyxl = "*"
types-psutil = "*"
types-Pygments = "*"
types-python-dateutil = "*"
types-pytz = "*"
types-PyYAML = "*"
types-requests = "*"
types-setuptools = "*"
types-openpyxl = "*"
typing_extensions = "*"
pip = "*"

Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,39 @@ viz = ["cartopy>=0.24", "matplotlib>=3.10", "nc-time-axis", "seaborn"]
types = [
"pandas-stubs",
"scipy-stubs",
"types-PyYAML",
"types-Pygments",
"types-colorama",
"types-decorator",
"types-defusedxml",
"types-docutils",
"types-networkx",
"types-openpyxl",
"types-pexpect",
"types-psutil",
"types-pycurl",
"types-openpyxl",
"types-Pygments",
"types-python-dateutil",
"types-pytz",
"types-PyYAML",
"types-requests",
"types-setuptools",
"types-xlrd",
]

[dependency-groups]
dev = [
"hypothesis",
"jinja2",
"mypy==1.18.1",
"mypy==1.19.1",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-mypy-plugins",
"pytest-mypy-plugins>=4.0.0",
"pytest-timeout",
"pytest-xdist",
"pytest-asyncio",
"pytz",
"ruff>=0.8.0",
"ruff>=0.15.0",
"sphinx",
"sphinx_autosummary_accessors",
"xarray[complete,types]",
Expand Down Expand Up @@ -158,7 +159,6 @@ module = [
"pooch.*",
"pyarrow.*",
"pydap.*",
"scipy.*",
"seaborn.*",
"setuptools",
"sparse.*",
Expand All @@ -176,6 +176,7 @@ module = [
[[tool.mypy.overrides]]
check_untyped_defs = true
module = [
"xarray.backends.scipy_",
"xarray.core.accessor_dt",
"xarray.core.accessor_str",
"xarray.structure.alignment",
Expand Down
31 changes: 6 additions & 25 deletions xarray/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Any,
ClassVar,
Self,
TypeAlias,
TypeVar,
Union,
overload,
Expand Down Expand Up @@ -381,7 +382,7 @@ def __exit__(self, exception_type, exception_value, traceback):
self.close()


T_PathFileOrDataStore = (
T_PathFileOrDataStore: TypeAlias = (
str | os.PathLike[Any] | ReadBuffer | bytes | memoryview | AbstractDataStore
)

Expand Down Expand Up @@ -776,12 +777,7 @@ def __repr__(self) -> str:

def open_dataset(
self,
filename_or_obj: str
| os.PathLike[Any]
| ReadBuffer
| bytes
| memoryview
| AbstractDataStore,
filename_or_obj: T_PathFileOrDataStore,
*,
drop_variables: str | Iterable[str] | None = None,
) -> Dataset:
Expand All @@ -793,12 +789,7 @@ def open_dataset(

def guess_can_open(
self,
filename_or_obj: str
| os.PathLike[Any]
| ReadBuffer
| bytes
| memoryview
| AbstractDataStore,
filename_or_obj: T_PathFileOrDataStore,
) -> bool:
"""
Backend open_dataset method used by Xarray in :py:func:`~xarray.open_dataset`.
Expand All @@ -808,12 +799,7 @@ def guess_can_open(

def open_datatree(
self,
filename_or_obj: str
| os.PathLike[Any]
| ReadBuffer
| bytes
| memoryview
| AbstractDataStore,
filename_or_obj: T_PathFileOrDataStore,
*,
drop_variables: str | Iterable[str] | None = None,
) -> DataTree:
Expand All @@ -827,12 +813,7 @@ def open_datatree(

def open_groups_as_dict(
self,
filename_or_obj: str
| os.PathLike[Any]
| ReadBuffer
| bytes
| memoryview
| AbstractDataStore,
filename_or_obj: T_PathFileOrDataStore,
*,
drop_variables: str | Iterable[str] | None = None,
) -> dict[str, Dataset]:
Expand Down
Loading
Loading