Skip to content

Remove pyfs dependency#134

Merged
ntarocco merged 2 commits into
inveniosoftware:masterfrom
ntarocco:remove-pyfs
Jul 17, 2026
Merged

Remove pyfs dependency#134
ntarocco merged 2 commits into
inveniosoftware:masterfrom
ntarocco:remove-pyfs

Conversation

@ntarocco

@ntarocco ntarocco commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Pyfs dependency has been removed from the Invenio ecosystem.
This pull requests removes the pyfs (Pyfilesystem2) dependency, adds the necessary classes and utilities to the package and removes the Opener (the only breaking change).

@ntarocco ntarocco changed the title wip Remove pyfs dependency Jun 24, 2026
Comment thread tests/perf.py Outdated
os.system("dd bs=1024 count={1} </dev/urandom >{0}".format(filepath, 1024 * 10))
# Create test file with random data using subprocess
count = 1024 * 10
subprocess.check_call(["dd", "bs=1024", f"count={count}", "if=/dev/urandom", f"of={filepath}"])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.system is deprecated

Comment thread tests/perf.py
t1 = time.time()

fs = open_fs(url)
fs = XRootDPyFS(url)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Opened has been removed

@@ -0,0 +1,1696 @@
# SPDX-FileCopyrightText: 2015, 2023 CERN.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from pyfs source code

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if it's largely copied then we should preserve the original copyright/license notice 😃

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, thank you. When the funcs have been copied, I checked license (MIT) and copyright headers. The latter are not there. I have added a new line with a reference to the license and repo.

@kpsherva kpsherva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Sorry for jumping in late with this question, but I understand that copying pyfs utils functions was the only way to go, right? were there any alternative solutions?

@zzacharo zzacharo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I guess the pyfs needs to be removed from invenio-xrootd too?

@OliverGeneser OliverGeneser left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test it a bit more, but I thing it's good 👍

@@ -0,0 +1,1696 @@
# SPDX-FileCopyrightText: 2015, 2023 CERN.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if it's largely copied then we should preserve the original copyright/license notice 😃

Comment thread tests/test_xrdfile.py Outdated
Comment thread xrootdpyfs/__init__.py
Comment thread tests/perf.py Outdated

@slint slint left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a brief pass. I think we're going to have other places in the code where we just didn't use the PyFS features in our paths, but I don't think it makes sense to trim down this compat module for this reason.

I still want to test "live" with EOS, but have to find time to setup...

Comment thread xrootdpyfs/_pyfs_compat.py Outdated
Comment thread xrootdpyfs/_pyfs_compat.py Outdated
@ntarocco

Copy link
Copy Markdown
Contributor Author

@zzacharo yes, I will work on invenio-xrootd.
@kpsherva given that I (or we?) did not want to re-write the entire module/funcs and test it, I opted for porting the minimal needed code from pyfs.

@ntarocco

Copy link
Copy Markdown
Contributor Author

@slint indeed, we need to test this in a live system. We can release an alpha, fix and release invenio-xrootd with an alpha too and test it.

@ntarocco
ntarocco force-pushed the remove-pyfs branch 2 times, most recently from 5ddb740 to 1c4d9f2 Compare July 16, 2026 14:56
- remove the dependency on pyfs Pyfilesystem2, as it has been
  removed from Invenio packages and it blocks Python upgrade
- remove the pyfs Opener
- add pyfs required classes and utilities in the package
@ntarocco

Copy link
Copy Markdown
Contributor Author

I will merge this so we can go ahead with testing, I can fix any comment in a subsequent PR.

@ntarocco
ntarocco merged commit 6f3f779 into inveniosoftware:master Jul 17, 2026
6 checks passed
@ntarocco
ntarocco deleted the remove-pyfs branch July 17, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants