Skip to content

Commit 9592e5e

Browse files
committed
feat: depend on new xrootd wheels
1 parent e994fb7 commit 9592e5e

9 files changed

Lines changed: 31 additions & 66 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can set up a development environment by running:
3232
```bash
3333
python3 -m venv .venv
3434
source ./.venv/bin/activate
35-
pip install -v -e .[dev,xrootd]
35+
pip install -v -e .[dev]
3636
```
3737

3838
If you have the
@@ -41,7 +41,7 @@ can instead do:
4141

4242
```bash
4343
py -m venv .venv
44-
py -m install -v -e .[dev,xrootd]
44+
py -m install -v -e .[dev]
4545
```
4646

4747
# Post setup
@@ -65,6 +65,11 @@ Use pytest to run the unit checks:
6565
pytest
6666
```
6767

68+
The local integration tests also start an `xrootd` server process. If the Python
69+
wheel does not provide an `xrootd` executable in your environment, install one
70+
separately, for example via `conda install -c conda-forge xrootd` or
71+
`brew install xrootd`.
72+
6873
# Building docs
6974

7075
You can build the docs using:

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
python-version: "3.14"
2222

2323
- name: Install package
24-
run: python -m pip install -e ".[docs,xrootd]"
24+
run: python -m pip install -e ".[docs]"
2525

2626
- name: Build documentation
2727
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,6 @@ cython_debug/
139139

140140
# setuptools_scm
141141
src/*/_version.py
142+
143+
# JetBrains IDEs
144+
.idea/

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ An XRootD implementation for fsspec.
55
## Install
66

77
```bash
8-
pip install "fsspec-xrootd[xrootd]"
8+
pip install fsspec-xrootd
99
```
1010

1111
Supports Python 3.9 and newer.
1212

1313
## Purpose
1414

1515
To allow fsspec to use XRootD accessible storage systems. Install fsspec-xrootd
16-
with the optional `xrootd` extra alongside fsspec and have easy access to files
17-
stored on XRootD servers. Once installed, fsspec will be able to work with urls
18-
with the 'root' protocol. Only tested with Linux at this time.
16+
alongside fsspec and have easy access to files stored on XRootD servers. Once
17+
installed, fsspec will be able to work with urls with the 'root' protocol. Only
18+
tested with Linux at this time.
19+
20+
The Python package depends on the XRootD client bindings directly. If you want
21+
to run the local integration tests, you will also need an `xrootd` server
22+
executable available on `PATH`.
1923

2024
## Documentation
2125

docs/index.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ Install
99

1010
.. code:: bash
1111
12-
pip install "fsspec-xrootd[xrootd]"
12+
pip install fsspec-xrootd
1313
1414
Purpose
1515
-------
1616

1717
To allow fsspec to use XRootD accessible storage systems. Install
18-
``fsspec-xrootd[xrootd]`` alongside fsspec and have easy access to files stored
19-
on XRootD servers. Once installed, fsspec will be able to work with urls with
20-
the ``root`` protocol. Only tested with Linux at this time.
18+
``fsspec-xrootd`` alongside fsspec and have easy access to files stored on
19+
XRootD servers. Once installed, fsspec will be able to work with urls with the
20+
``root`` protocol. Only tested with Linux at this time.
21+
22+
The Python package depends on the XRootD client bindings directly. Running the
23+
local integration tests also requires an ``xrootd`` server executable on
24+
``PATH``.
2125

2226
.. toctree::
2327
:maxdepth: 3

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def tests(session: nox.Session) -> None:
2424
"""
2525
Run the unit and regular tests.
2626
"""
27-
session.install(".[test,xrootd]")
27+
session.install(".[test]")
2828
session.run("pytest", *session.posargs)
2929

3030

@@ -34,7 +34,7 @@ def docs(session: nox.Session) -> None:
3434
Build the docs. Pass "serve" to serve.
3535
"""
3636

37-
session.install(".[docs,xrootd]")
37+
session.install(".[docs]")
3838
session.chdir("docs")
3939
session.run("sphinx-build", "-M", "html", ".", "_build")
4040

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classifiers = [
3030
"Programming Language :: Python :: 3.14",
3131
"Topic :: Scientific/Engineering",
3232
]
33-
dependencies = ["fsspec"]
33+
dependencies = ["fsspec", "xrootd>=6.0.1"]
3434

3535
[project.urls]
3636
Documentation = "https://fsspec_xrootd.readthedocs.io/"
@@ -50,7 +50,6 @@ docs = [
5050
"sphinx-copybutton",
5151
]
5252
test = ["pytest>=6", "pytest-rerunfailures", "pytest-timeout"]
53-
xrootd = ["xrootd>=6.0.0"]
5453

5554
[tool.setuptools]
5655
include-package-data = true

src/fsspec_xrootd/__init__.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,7 @@
77

88
from __future__ import annotations
99

10-
from typing import TYPE_CHECKING, Any
11-
1210
from ._version import version as __version__
13-
14-
if TYPE_CHECKING:
15-
from .xrootd import XRootDFile, XRootDFileSystem
11+
from .xrootd import XRootDFile, XRootDFileSystem
1612

1713
__all__ = ("__version__", "XRootDFileSystem", "XRootDFile")
18-
19-
20-
def __getattr__(name: str) -> Any:
21-
if name not in {"XRootDFile", "XRootDFileSystem"}:
22-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
23-
24-
try:
25-
from .xrootd import XRootDFile, XRootDFileSystem
26-
except ModuleNotFoundError as exc:
27-
if exc.name == "XRootD":
28-
raise ModuleNotFoundError(
29-
"The 'xrootd' package is required to use fsspec-xrootd. "
30-
'Install it with `pip install "fsspec-xrootd[xrootd]"`.'
31-
) from exc
32-
raise
33-
34-
globals().update({
35-
"XRootDFile": XRootDFile,
36-
"XRootDFileSystem": XRootDFileSystem,
37-
})
38-
return globals()[name]

tests/test_package.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
11
from __future__ import annotations
22

3-
import builtins
4-
import importlib
5-
import sys
6-
7-
import pytest
8-
93
import fsspec_xrootd as m
104

115

126
def test_version():
137
assert m.__version__
14-
15-
16-
def test_import_without_xrootd(monkeypatch):
17-
original_import = builtins.__import__
18-
19-
def raising_import(name, *args, **kwargs):
20-
if name == "XRootD":
21-
raise ModuleNotFoundError("No module named 'XRootD'", name="XRootD")
22-
return original_import(name, *args, **kwargs)
23-
24-
monkeypatch.setattr(builtins, "__import__", raising_import)
25-
for module_name in ("fsspec_xrootd", "fsspec_xrootd.xrootd", "XRootD"):
26-
sys.modules.pop(module_name, None)
27-
28-
module = importlib.import_module("fsspec_xrootd")
29-
30-
assert module.__version__
31-
with pytest.raises(ModuleNotFoundError, match="Install it with"):
32-
_ = module.XRootDFileSystem

0 commit comments

Comments
 (0)