In this topic, I would like to collect some thoughts on how to improve the transport plugins. While working on the ssh_light transport plugin, I realised that a few things could be improved. I will add them as follow-up comments to keep this message short.
It’s important to note that pathlib.Path is dependent on the local system (see pathlib — Object-oriented filesystem paths — Python 3.11.4 documentation), and so this should not be used to reference remote paths. This is important if you need to distinguish between Posix and Windows.
There is a specific base class for paths: os — Miscellaneous operating system interfaces — Python 3.11.4 documentation
You may also be interested in two implementations of the Path API I have implemented:
- GitHub - aiidateam/archive-path: A package to provide pathlib like access to zip & tar archives, used in aiida-core for the archive storage
- https://github.com/aiidateam/aiida-firecrest/blob/main/aiida_firecrest/remote_path.py