xrootdpyfs 0.2.2__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. xrootdpyfs-2.0.0/.dockerignore +11 -0
  2. xrootdpyfs-2.0.0/.editorconfig +31 -0
  3. xrootdpyfs-2.0.0/.git-blame-ignore-revs +1 -0
  4. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/.github/workflows/pypi-publish.yml +2 -2
  5. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/.github/workflows/tests.yml +9 -13
  6. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/CHANGES +16 -0
  7. xrootdpyfs-2.0.0/CONTRIBUTING.rst +39 -0
  8. xrootdpyfs-2.0.0/MANIFEST.in +28 -0
  9. xrootdpyfs-2.0.0/PKG-INFO +154 -0
  10. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/README.rst +32 -15
  11. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/docs/conf.py +96 -100
  12. xrootdpyfs-2.0.0/run-docker.sh +1 -0
  13. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/run-tests.sh +2 -2
  14. xrootdpyfs-2.0.0/setup.cfg +64 -0
  15. xrootdpyfs-0.2.2/.coveragerc → xrootdpyfs-2.0.0/setup.py +8 -3
  16. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/conftest.py +1 -6
  17. xrootdpyfs-2.0.0/tests/data/afolder/afile.txt +0 -0
  18. xrootdpyfs-2.0.0/tests/data/bfolder/bfile.txt +0 -0
  19. xrootdpyfs-2.0.0/tests/data/binary.dat +0 -0
  20. xrootdpyfs-2.0.0/tests/data/multiline.txt +8 -0
  21. xrootdpyfs-2.0.0/tests/data/testa.txt +1 -0
  22. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/perf.py +20 -19
  23. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/test_env.py +10 -8
  24. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/test_fs.py +221 -227
  25. xrootdpyfs-2.0.0/tests/test_fs_extras.py +29 -0
  26. xrootdpyfs-2.0.0/tests/test_opener.py +22 -0
  27. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/test_utils.py +14 -16
  28. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/test_xrdfile.py +285 -301
  29. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/tests/test_xrdflags.py +9 -9
  30. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs/__init__.py +11 -11
  31. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs/env.py +4 -6
  32. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs/fs.py +281 -165
  33. xrootdpyfs-2.0.0/xrootdpyfs/opener.py +51 -0
  34. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs/utils.py +7 -11
  35. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs/xrdfile.py +53 -50
  36. xrootdpyfs-2.0.0/xrootdpyfs.egg-info/PKG-INFO +154 -0
  37. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs.egg-info/SOURCES.txt +11 -2
  38. xrootdpyfs-2.0.0/xrootdpyfs.egg-info/entry_points.txt +4 -0
  39. xrootdpyfs-2.0.0/xrootdpyfs.egg-info/requires.txt +8 -0
  40. xrootdpyfs-0.2.2/MANIFEST.in +0 -16
  41. xrootdpyfs-0.2.2/PKG-INFO +0 -132
  42. xrootdpyfs-0.2.2/setup.cfg +0 -18
  43. xrootdpyfs-0.2.2/setup.py +0 -92
  44. xrootdpyfs-0.2.2/tests/test_fs_extras.py +0 -31
  45. xrootdpyfs-0.2.2/tests/test_opener.py +0 -48
  46. xrootdpyfs-0.2.2/xrootdpyfs/opener.py +0 -60
  47. xrootdpyfs-0.2.2/xrootdpyfs/version.py +0 -21
  48. xrootdpyfs-0.2.2/xrootdpyfs.egg-info/PKG-INFO +0 -132
  49. xrootdpyfs-0.2.2/xrootdpyfs.egg-info/requires.txt +0 -9
  50. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/AUTHORS +0 -0
  51. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/LICENSE +0 -0
  52. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/docs/Makefile +0 -0
  53. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/docs/index.rst +0 -0
  54. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/docs/requirements.txt +0 -0
  55. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs.egg-info/dependency_links.txt +0 -0
  56. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs.egg-info/not-zip-safe +0 -0
  57. {xrootdpyfs-0.2.2 → xrootdpyfs-2.0.0}/xrootdpyfs.egg-info/top_level.txt +0 -0
@@ -0,0 +1,11 @@
1
+ *.pyc
2
+ *.swp
3
+ *.swo
4
+ *.~
5
+
6
+ docker-compose.yml
7
+
8
+ .tox
9
+ .cache
10
+ .coverage
11
+ __pycache__
@@ -0,0 +1,31 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ charset = utf-8
9
+
10
+ # Python files
11
+ [*.py]
12
+ indent_size = 4
13
+ # isort plugin configuration
14
+ multi_line_output = 2
15
+ default_section = THIRDPARTY
16
+
17
+ # RST files (used by sphinx)
18
+ [*.rst]
19
+ indent_size = 4
20
+
21
+ # CSS, HTML, JS, JSON, YML
22
+ [*.{css,html,js,json,yml}]
23
+ indent_size = 2
24
+
25
+ # Matches the exact files either package.json or .travis.yml
26
+ [{package.json,.travis.yml}]
27
+ indent_size = 2
28
+
29
+ # Dockerfile
30
+ [Dockerfile]
31
+ indent_size = 4
@@ -0,0 +1 @@
1
+ 07f4d277f102ded42a1a44d9ddc3a9f0a1122e86
@@ -18,12 +18,12 @@ jobs:
18
18
  runs-on: ubuntu-20.04
19
19
  steps:
20
20
  - name: Checkout
21
- uses: actions/checkout@v2
21
+ uses: actions/checkout@v3
22
22
 
23
23
  - name: Set up Python
24
24
  uses: actions/setup-python@v2
25
25
  with:
26
- python-version: 3.6
26
+ python-version: 3.9
27
27
 
28
28
  - name: Install dependencies
29
29
  run: |
@@ -20,27 +20,23 @@ jobs:
20
20
  runs-on: ubuntu-20.04
21
21
  strategy:
22
22
  matrix:
23
- include:
24
- - xrootd-version: 4.8.5
25
- cmake: cmake3
26
- - xrootd-version: 4.9.1
27
- cmake: cmake3
28
- - xrootd-version: 4.11.3
29
- cmake: cmake
30
- - xrootd-version: 4.12.2
31
- cmake: cmake
32
- - xrootd-version: 4.12.7
33
- cmake: cmake3
23
+ # empty string "" is for latest
24
+ xrootd-version: [
25
+ 5.5.5,
26
+ 5.6.1,
27
+ 5.6.2,
28
+ 5.6.7,
29
+ ""
30
+ ]
34
31
 
35
32
  steps:
36
33
  - name: Checkout
37
34
  uses: actions/checkout@v2
38
35
 
39
36
  - name: Build Docker image
40
- run: docker build -t xrootd --build-arg xrootd_version=$XROOTD_VERSION --build-arg cmake=$CMAKE --progress=plain .
37
+ run: docker build -t xrootd --build-arg xrootd_version=$XROOTD_VERSION --progress=plain .
41
38
  env:
42
39
  XROOTD_VERSION: ${{ matrix.xrootd-version }}
43
- CMAKE: ${{ matrix.cmake }}
44
40
 
45
41
  - name: Run tests
46
42
  run: docker run -h xrootdpyfs -t xrootd
@@ -1,6 +1,22 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ Version 2.0.0 (released 2024-02-14)
5
+
6
+ - stable release
7
+ - fs: align error code changes (3005, 3018) to comply with
8
+ https://github.com/xrootd/xrootd/commit/3715a81a5807a2fd2aee5dbbcd2aac1a74d5acc6
9
+
10
+ Version 2.0.0a1 (released 2023-05-03)
11
+
12
+ - upgrade xrootd to version 5.
13
+ - fix testing xrootd responses
14
+
15
+ Version 1.0.0a1 (released 2023-04-19)
16
+
17
+ - Upgrade pyfs to version 2.
18
+ - Improve module's files organization and code formatting.
19
+
4
20
  Version 0.2.2 (released 2021-12-13)
5
21
 
6
22
  - Supports `xrootd@4.12.7`
@@ -0,0 +1,39 @@
1
+ Contributing
2
+ ============
3
+
4
+ Bug reports, feature requests, and other contributions are welcome.
5
+ If you find a demonstrable problem that is caused by the code of this
6
+ library, please:
7
+
8
+ 1. Search for `already reported problems
9
+ <https://github.com/inveniosoftware/xrootdpyfs/issues>`_.
10
+ 2. Check if the issue has been fixed or is still reproducible on the
11
+ latest `master` branch.
12
+ 3. Create an issue with **a test case**.
13
+
14
+ If you create a feature branch, you can run the tests to ensure everything is
15
+ operating correctly. The easiest is to run the tests using Docker:
16
+
17
+ .. code-block:: console
18
+
19
+ $ docker build -t xrootd .
20
+ $ docker run -h xrootdpyfs -it xrootd
21
+
22
+ You can also run the tests locally:
23
+
24
+ .. code-block:: console
25
+
26
+ $ ./run-tests.sh
27
+
28
+ You will however need to start a local XRootD server, e.g.:
29
+
30
+ .. code-block:: console
31
+
32
+ $ xrootd -b -l /dev/null /tmp <tmpfolder>
33
+
34
+ where, ``<tmpfolder>`` is dependent on your system (e.g. on OS X it is
35
+ ``/var/folders``, while on Linux it can be left empty).
36
+
37
+ .. note::
38
+ XRootD have issues with Docker's default hostname, thus it is important to
39
+ supply a host name to ``docker run`` via the ``-h`` option.
@@ -0,0 +1,28 @@
1
+ # This file is part of xrootdpyfs
2
+ # Copyright (C) 2015-2023 CERN.
3
+ #
4
+ # xrootdpyfs is free software; you can redistribute it and/or modify it under the
5
+ # terms of the Revised BSD License; see LICENSE file for more details.
6
+
7
+ exclude .coveragerc
8
+ exclude Dockerfile
9
+ include .dockerignore
10
+ include .editorconfig
11
+ include .tx/config
12
+ include *.rst
13
+ include *.sh
14
+ include *.txt
15
+ include CHANGES
16
+ include LICENSE
17
+ prune docs/_build
18
+ recursive-include docs *.bat
19
+ recursive-include docs *.py
20
+ recursive-include docs *.rst
21
+ recursive-include docs *.txt
22
+ recursive-include docs Makefile
23
+ recursive-include tests *.py
24
+ recursive-include tests *.html
25
+ recursive-include tests *.dat
26
+ recursive-include tests *.txt
27
+ recursive-include .github/workflows *.yml
28
+ include .git-blame-ignore-revs
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.1
2
+ Name: xrootdpyfs
3
+ Version: 2.0.0
4
+ Summary: XRootDPyFS is a PyFilesystem interface for XRootD.
5
+ Home-page: https://github.com/inveniosoftware/xrootdpyfs
6
+ Author: CERN
7
+ Author-email: info@inveniosoftware.org
8
+ License: BSD
9
+ Keywords: xrootdpyfs
10
+ Platform: any
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: BSD License
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.6
17
+ Provides-Extra: tests
18
+ License-File: LICENSE
19
+ License-File: AUTHORS
20
+
21
+ ============
22
+ XRootDPyFS
23
+ ============
24
+
25
+ .. image:: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI.svg?branch=master
26
+ :target: https://github.com/inveniosoftware/xrootdpyfs/actions?query=workflow%3ACI
27
+ .. image:: https://coveralls.io/repos/inveniosoftware/xrootdpyfs/badge.svg?branch=master
28
+ :target: https://coveralls.io/r/inveniosoftware/xrootdpyfs
29
+ .. image:: https://pypip.in/v/xrootdpyfs/badge.svg
30
+ :target: https://crate.io/packages/xrootdpyfs/
31
+
32
+
33
+ XRootDPyFS is a PyFilesystem interface to XRootD.
34
+
35
+ XRootD protocol aims at giving high performance, scalable fault tolerant access
36
+ to data repositories of many kinds. The XRootDPyFS adds a high-level interface
37
+ on top of the existing Python interface (pyxrootd) and makes it easy to e.g.
38
+ copy a directory in parallel or recursively remove a directory.
39
+
40
+ Further documentation is available on https://xrootdpyfs.readthedocs.io/.
41
+
42
+ Getting started
43
+ ===============
44
+
45
+ If you just want to try out the library, the easiest is to use Docker.
46
+
47
+ Build the image:
48
+
49
+ .. code-block:: console
50
+
51
+ $ docker build --platform linux/amd64 -t xrootd .
52
+
53
+ Run the container and launch `xrootd`:
54
+
55
+ .. code-block:: console
56
+
57
+ $ docker run --platform linux/amd64 -h xrootdpyfs -it xrootd bash
58
+
59
+ You will see the logs in the stdout. Next, in another shell, connect the container
60
+ and fire up an ipython shell:
61
+
62
+ .. code-block:: console
63
+
64
+ $ docker ps # find the container id
65
+ $ docker exec -it <container-id> bash
66
+ [xrootdpyfs@xrootdpyfs code]$ ipython
67
+
68
+
69
+ Quick examples
70
+ --------------
71
+
72
+ Here is a quick example of a file listing with the xrootd PyFilesystem
73
+ integration:
74
+
75
+ >>> from xrootdpyfs import XRootDPyFS
76
+ >>> fs = XRootDPyFS("root://localhost//tmp/")
77
+ >>> fs.listdir("xrootdpyfs")
78
+ ['test.txt']
79
+
80
+ Or, alternatively using the PyFilesystem opener (note the first
81
+ ``import xrootdpyfs`` is required to ensure the XRootDPyFS opener is registered):
82
+
83
+ >>> import xrootdpyfs
84
+ >>> from fs.opener import open_fs
85
+ >>> fs = open_fs("root://localhost//tmp/")
86
+ >>> fs.listdir("xrootdpyfs")
87
+ ['test.txt']
88
+
89
+ Reading files:
90
+
91
+ >>> f = fs.open("xrootdpyfs/test.txt")
92
+ >>> f.read()
93
+ b'Hello XRootD!\n'
94
+ >>> f.close()
95
+
96
+ Reading files using the ``readtext()`` method:
97
+
98
+ >>> fs.readtext("xrootdpyfs/test.txt")
99
+ b'Hello XRootD!\n'
100
+
101
+ Writing files:
102
+
103
+ >>> f = fs.open("xrootdpyfs/hello.txt", "w+")
104
+ >>> f.write("World")
105
+ >>> f.close()
106
+
107
+ Writing files using the ``writetext()`` method:
108
+
109
+ >>> fs.writetext("xrootdpyfs/test.txt", "World")
110
+
111
+ Development
112
+ ===========
113
+
114
+ The easiest way to develop is to build the Docker image and mount
115
+ the source code as a volume to test any code modification with a
116
+ running XRootD server:
117
+
118
+ .. code-block:: console
119
+
120
+ $ docker build --platform linux/amd64 -t xrootd --progress=plain .
121
+ $ docker run --platform linux/amd64 -h xrootdpyfs -it -v <absolute path to this project>:/code xrootd bash
122
+ [xrootdpyfs@xrootdpyfs code]$ xrootd
123
+
124
+ In another shell:
125
+
126
+ .. code-block:: console
127
+
128
+ $ docker ps # find the container id
129
+ $ docker exec -it <container-id> bash
130
+ [xrootdpyfs@xrootdpyfs code]$ python -m pytest -vvv tests
131
+
132
+ If you want to test a specific version of xrootd, run:
133
+
134
+ .. code-block:: console
135
+
136
+ $ docker build --platform linux/amd64 --build-arg xrootd_version=4.12.7 -t xrootd --progress=plain .
137
+
138
+ Documentation
139
+ =============
140
+ Documentation is available at <http://xrootdpyfs.readthedocs.io/> or can be
141
+ build using Sphinx::
142
+
143
+ pip install Sphinx
144
+ python setup.py build_sphinx
145
+
146
+ Testing
147
+ =======
148
+ Running the tests are most easily done using docker:
149
+
150
+ .. code-block:: console
151
+
152
+ $ docker build --platform linux/amd64 -t xrootd . && docker run --platform linux/amd64 -h xrootdpyfs -it xrootd
153
+
154
+
@@ -24,16 +24,25 @@ Getting started
24
24
 
25
25
  If you just want to try out the library, the easiest is to use Docker.
26
26
 
27
+ Build the image:
28
+
29
+ .. code-block:: console
30
+
31
+ $ docker build --platform linux/amd64 -t xrootd .
32
+
33
+ Run the container and launch `xrootd`:
34
+
27
35
  .. code-block:: console
28
36
 
29
- $ docker build -t xrootd .
30
- $ docker run -h xrootdpyfs -it xrootd bash
37
+ $ docker run --platform linux/amd64 -h xrootdpyfs -it xrootd bash
31
38
 
32
- Next, start a XRootD server in the container and fire up an ipython shell:
39
+ You will see the logs in the stdout. Next, in another shell, connect the container
40
+ and fire up an ipython shell:
33
41
 
34
42
  .. code-block:: console
35
43
 
36
- [xrootdpyfs@xrootdpyfs code]$ xrootd -b -l /dev/null
44
+ $ docker ps # find the container id
45
+ $ docker exec -it <container-id> bash
37
46
  [xrootdpyfs@xrootdpyfs code]$ ipython
38
47
 
39
48
 
@@ -52,8 +61,8 @@ Or, alternatively using the PyFilesystem opener (note the first
52
61
  ``import xrootdpyfs`` is required to ensure the XRootDPyFS opener is registered):
53
62
 
54
63
  >>> import xrootdpyfs
55
- >>> from fs.opener import opener
56
- >>> fs, path = opener.parse("root://localhost//tmp/")
64
+ >>> from fs.opener import open_fs
65
+ >>> fs = open_fs("root://localhost//tmp/")
57
66
  >>> fs.listdir("xrootdpyfs")
58
67
  ['test.txt']
59
68
 
@@ -64,9 +73,9 @@ Reading files:
64
73
  b'Hello XRootD!\n'
65
74
  >>> f.close()
66
75
 
67
- Reading files using the ``getcontents()`` method:
76
+ Reading files using the ``readtext()`` method:
68
77
 
69
- >>> fs.getcontents("xrootdpyfs/test.txt")
78
+ >>> fs.readtext("xrootdpyfs/test.txt")
70
79
  b'Hello XRootD!\n'
71
80
 
72
81
  Writing files:
@@ -75,9 +84,9 @@ Writing files:
75
84
  >>> f.write("World")
76
85
  >>> f.close()
77
86
 
78
- Writing files using the ``setcontents()`` method:
87
+ Writing files using the ``writetext()`` method:
79
88
 
80
- >>> fs.setcontents("xrootdpyfs/test.txt", "World")
89
+ >>> fs.writetext("xrootdpyfs/test.txt", "World")
81
90
 
82
91
  Development
83
92
  ===========
@@ -88,15 +97,23 @@ running XRootD server:
88
97
 
89
98
  .. code-block:: console
90
99
 
91
- $ docker build -t xrootd --progress=plain .
92
- $ docker run -h xrootdpyfs -it -v <absolute path to this project>:/code xrootd bash
93
- [xrootdpyfs@xrootdpyfs code]$ xrootd -b -l /dev/null
100
+ $ docker build --platform linux/amd64 -t xrootd --progress=plain .
101
+ $ docker run --platform linux/amd64 -h xrootdpyfs -it -v <absolute path to this project>:/code xrootd bash
102
+ [xrootdpyfs@xrootdpyfs code]$ xrootd
103
+
104
+ In another shell:
105
+
106
+ .. code-block:: console
107
+
108
+ $ docker ps # find the container id
109
+ $ docker exec -it <container-id> bash
110
+ [xrootdpyfs@xrootdpyfs code]$ python -m pytest -vvv tests
94
111
 
95
112
  If you want to test a specific version of xrootd, run:
96
113
 
97
114
  .. code-block:: console
98
115
 
99
- $ docker build --build-arg xrootd_version=4.8.5 -t xrootd --progress=plain .
116
+ $ docker build --platform linux/amd64 --build-arg xrootd_version=4.12.7 -t xrootd --progress=plain .
100
117
 
101
118
  Documentation
102
119
  =============
@@ -112,4 +129,4 @@ Running the tests are most easily done using docker:
112
129
 
113
130
  .. code-block:: console
114
131
 
115
- $ docker build -t xrootd . && docker run -h xrootdpyfs -it xrootd
132
+ $ docker build --platform linux/amd64 -t xrootd . && docker run --platform linux/amd64 -h xrootdpyfs -it xrootd