ansys-hps-data-transfer-client 0.2.dev0__tar.gz → 0.2.1__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 (28) hide show
  1. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/PKG-INFO +45 -22
  2. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/README.rst +35 -11
  3. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/pyproject.toml +36 -16
  4. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/api/__init__.py +2 -0
  5. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/api/api.py +40 -39
  6. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/api/async_api.py +43 -41
  7. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/api/retry.py +5 -3
  8. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/authenticate.py +23 -28
  9. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/binary.py +59 -43
  10. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/client.py +68 -50
  11. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/exceptions.py +21 -24
  12. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/__init__.py +4 -0
  13. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/common.py +8 -8
  14. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/core.py +4 -3
  15. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/metadata.py +11 -5
  16. ansys_hps_data_transfer_client-0.2.1/src/ansys/hps/data_transfer/client/models/msg.py +190 -0
  17. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/ops.py +21 -17
  18. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/permissions.py +26 -12
  19. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/rest.py +4 -3
  20. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/models/storage.py +3 -1
  21. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/token.py +3 -1
  22. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/utils/__init__.py +2 -0
  23. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/utils/jitter.py +18 -7
  24. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/utils/otel_config.py +10 -8
  25. ansys_hps_data_transfer_client-0.2.dev0/src/ansys/hps/data_transfer/client/models/msg.py +0 -142
  26. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/LICENSE +0 -0
  27. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/__init__.py +0 -0
  28. {ansys_hps_data_transfer_client-0.2.dev0 → ansys_hps_data_transfer_client-0.2.1}/src/ansys/hps/data_transfer/client/__version__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-hps-data-transfer-client
3
- Version: 0.2.dev0
3
+ Version: 0.2.1
4
4
  Summary: Python client library for hps data transfer service
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -24,16 +24,15 @@ Requires-Dist: asyncio-atexit>=1.0.0
24
24
  Requires-Dist: build==1.2.2.post1 ; extra == "build"
25
25
  Requires-Dist: twine==6.1.0 ; extra == "build"
26
26
  Requires-Dist: wheel ; extra == "build"
27
- Requires-Dist: datamodel-code-generator==0.26.3 ; extra == "build"
27
+ Requires-Dist: datamodel-code-generator==0.30.1 ; extra == "build"
28
28
  Requires-Dist: pre-commit==4.2.0 ; extra == "build"
29
29
  Requires-Dist: importlib_metadata>=7.0 ; extra == "build"
30
- Requires-Dist: ansys-sphinx-theme==1.2.6 ; extra == "doc"
30
+ Requires-Dist: ansys-sphinx-theme==1.4.4 ; extra == "doc"
31
31
  Requires-Dist: autodoc_pydantic==2.2.0 ; extra == "doc"
32
32
  Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "doc"
33
- Requires-Dist: nbsphinx==0.9.6 ; extra == "doc"
33
+ Requires-Dist: nbsphinx==0.9.7 ; extra == "doc"
34
34
  Requires-Dist: numpydoc==1.8.0 ; extra == "doc"
35
- Requires-Dist: myst-parser==4.0.0 ; extra == "doc"
36
- Requires-Dist: Sphinx==8.2.3 ; extra == "doc"
35
+ Requires-Dist: Sphinx==8.1.3 ; extra == "doc"
37
36
  Requires-Dist: sphinx-autoapi==3.6.0 ; extra == "doc"
38
37
  Requires-Dist: sphinx-autodoc-typehints==3.0.1 ; extra == "doc"
39
38
  Requires-Dist: sphinxcontrib-globalsubs==0.1.2 ; extra == "doc"
@@ -45,14 +44,14 @@ Requires-Dist: sphinxnotes-strike==1.2.1 ; extra == "doc"
45
44
  Requires-Dist: sphinx-tabs==3.4.7 ; extra == "doc"
46
45
  Requires-Dist: sphinx-gallery==0.19.0 ; extra == "doc"
47
46
  Requires-Dist: pytest==8.3.5 ; extra == "tests"
48
- Requires-Dist: pytest-cov==6.0.0 ; extra == "tests"
49
- Requires-Dist: pytest-timeout==2.3.1 ; extra == "tests"
47
+ Requires-Dist: pytest-cov==6.1.1 ; extra == "tests"
48
+ Requires-Dist: pytest-timeout==2.4.0 ; extra == "tests"
50
49
  Requires-Dist: pytest-mock-resources[redis]==2.12.2 ; extra == "tests"
51
- Requires-Dist: pytest-rerunfailures==15.0 ; extra == "tests"
52
- Requires-Dist: pytest-asyncio==0.25.3 ; extra == "tests"
50
+ Requires-Dist: pytest-rerunfailures==15.1 ; extra == "tests"
51
+ Requires-Dist: pytest-asyncio==0.26.0 ; extra == "tests"
53
52
  Requires-Dist: python-keycloak==5.3.1 ; extra == "tests"
54
53
  Requires-Dist: python-slugify>=8.0.4 ; extra == "tests"
55
- Requires-Dist: tox==4.24.2 ; extra == "tests"
54
+ Requires-Dist: tox==4.26.0 ; extra == "tests"
56
55
  Project-URL: Documentation, https://data-transfer.hps.docs.pyansys.com
57
56
  Project-URL: Homepage, https://github.com/ansys/pyhps-data-transfer/
58
57
  Project-URL: Source, https://github.com/ansys/pyhps-data-transfer/
@@ -97,21 +96,19 @@ PyHPS Data Transfer
97
96
  Overview
98
97
  --------
99
98
 
100
- Python client library for HPS Data Transfer Service
99
+ PyHPS Data Transfer is a Python client library for the Ansys HPC Platform Services (HPS) data transfer service.
101
100
 
102
101
  .. contribute_start
103
102
 
104
103
  Installation
105
104
  ^^^^^^^^^^^^
106
-
107
- You can use `pip <https://pypi.org/project/pip/>`_ to install PyHPS Data Transfer.
108
- Note: This will be available only after released. For now, please install from git
105
+ You can use `pip <https://pypi.org/project/pip/>`_ to install PyHPS Data Transfer in user mode:
109
106
 
110
107
  .. code:: bash
111
108
 
112
109
  pip install ansys-hps-data-transfer-client
113
110
 
114
- To install the latest development version, run these commands:
111
+ To install the latest development version from the GitHub repository, run these commands:
115
112
 
116
113
  .. code:: bash
117
114
 
@@ -119,19 +116,45 @@ To install the latest development version, run these commands:
119
116
  cd pyhps-data-transfer
120
117
  pip install -e .
121
118
 
122
- For more information, see `Getting Started`_.
119
+ For more information, see `Getting started`_.
123
120
 
124
121
  Basic usage
125
122
  ^^^^^^^^^^^
126
123
 
127
- This code shows how to import PyHPS Data Transfer and use some basic capabilities:
124
+ The following sections show how to import PyHPS Data Transfer and use some basic capabilities.
125
+
126
+ Request access token
127
+ ~~~~~~~~~~~~~~~~~~~~
128
+
129
+ The client library requires an access token to connect to the HPS Data Transfer service.
130
+
131
+ .. code:: python
132
+
133
+ from ansys.hps.data_transfer.client.authenticate import authenticate
134
+
135
+ auth_url = "https://localhost:8443/hps/auth/realms/rep"
136
+
137
+ token = authenticate(username="repadmin", password="repadmin", verify=False, url=auth_url)
138
+ token = token.get("access_token", None)
139
+
140
+ Connect to data transfer service client
141
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
+
143
+ After obtaining the access token, you can connect to the data transfer service client:
128
144
 
129
145
  .. code:: python
130
146
 
131
147
  from ansys.hps.data_transfer.client import Client # Import the Client class
148
+ dt_url = f"https://localhost:8443/hps/dt/api/v1"
132
149
  client = Client() # Create a client object
150
+ client.binary_config.update(verbosity=3, debug=True, insecure=True, token=token, data_transfer_url=dt_url, log=True)
151
+ client.start()
152
+
153
+ api = DataTransferApi(client)
154
+ api.status(wait=True)
155
+
133
156
 
134
- For comprehensive usage information, see `Examples`_ in the `PyHPS Data Transfer documentation`_.
157
+ For comprehensive usage information, see `Examples`_.
135
158
 
136
159
  Documentation and issues
137
160
  ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -150,7 +173,7 @@ To reach the project support team, email `pyansys.core@ansys.com <mailto:pyansys
150
173
 
151
174
 
152
175
  .. LINKS AND REFERENCES
153
- .. _Getting Started: https://hps.docs.pyansys.com/version/stable/getting_started/index.html
154
- .. _Examples: https://hps.docs.pyansys.com/version/stable/examples.html
155
- .. _PyHPS Data Transfer documentation: https://hps.docs.pyansys.com/version/stable/index.html
176
+ .. _Getting Started: https://data-transfer.hps.docs.pyansys.com/version/stable/getting_started/index.html
177
+ .. _Examples: https://data-transfer.hps.docs.pyansys.com/version/stable/examples/index.html
178
+ .. _PyHPS Data Transfer documentation: https://data-transfer.hps.docs.pyansys.com/
156
179
 
@@ -34,21 +34,19 @@ PyHPS Data Transfer
34
34
  Overview
35
35
  --------
36
36
 
37
- Python client library for HPS Data Transfer Service
37
+ PyHPS Data Transfer is a Python client library for the Ansys HPC Platform Services (HPS) data transfer service.
38
38
 
39
39
  .. contribute_start
40
40
 
41
41
  Installation
42
42
  ^^^^^^^^^^^^
43
-
44
- You can use `pip <https://pypi.org/project/pip/>`_ to install PyHPS Data Transfer.
45
- Note: This will be available only after released. For now, please install from git
43
+ You can use `pip <https://pypi.org/project/pip/>`_ to install PyHPS Data Transfer in user mode:
46
44
 
47
45
  .. code:: bash
48
46
 
49
47
  pip install ansys-hps-data-transfer-client
50
48
 
51
- To install the latest development version, run these commands:
49
+ To install the latest development version from the GitHub repository, run these commands:
52
50
 
53
51
  .. code:: bash
54
52
 
@@ -56,19 +54,45 @@ To install the latest development version, run these commands:
56
54
  cd pyhps-data-transfer
57
55
  pip install -e .
58
56
 
59
- For more information, see `Getting Started`_.
57
+ For more information, see `Getting started`_.
60
58
 
61
59
  Basic usage
62
60
  ^^^^^^^^^^^
63
61
 
64
- This code shows how to import PyHPS Data Transfer and use some basic capabilities:
62
+ The following sections show how to import PyHPS Data Transfer and use some basic capabilities.
63
+
64
+ Request access token
65
+ ~~~~~~~~~~~~~~~~~~~~
66
+
67
+ The client library requires an access token to connect to the HPS Data Transfer service.
68
+
69
+ .. code:: python
70
+
71
+ from ansys.hps.data_transfer.client.authenticate import authenticate
72
+
73
+ auth_url = "https://localhost:8443/hps/auth/realms/rep"
74
+
75
+ token = authenticate(username="repadmin", password="repadmin", verify=False, url=auth_url)
76
+ token = token.get("access_token", None)
77
+
78
+ Connect to data transfer service client
79
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80
+
81
+ After obtaining the access token, you can connect to the data transfer service client:
65
82
 
66
83
  .. code:: python
67
84
 
68
85
  from ansys.hps.data_transfer.client import Client # Import the Client class
86
+ dt_url = f"https://localhost:8443/hps/dt/api/v1"
69
87
  client = Client() # Create a client object
88
+ client.binary_config.update(verbosity=3, debug=True, insecure=True, token=token, data_transfer_url=dt_url, log=True)
89
+ client.start()
90
+
91
+ api = DataTransferApi(client)
92
+ api.status(wait=True)
93
+
70
94
 
71
- For comprehensive usage information, see `Examples`_ in the `PyHPS Data Transfer documentation`_.
95
+ For comprehensive usage information, see `Examples`_.
72
96
 
73
97
  Documentation and issues
74
98
  ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -87,6 +111,6 @@ To reach the project support team, email `pyansys.core@ansys.com <mailto:pyansys
87
111
 
88
112
 
89
113
  .. LINKS AND REFERENCES
90
- .. _Getting Started: https://hps.docs.pyansys.com/version/stable/getting_started/index.html
91
- .. _Examples: https://hps.docs.pyansys.com/version/stable/examples.html
92
- .. _PyHPS Data Transfer documentation: https://hps.docs.pyansys.com/version/stable/index.html
114
+ .. _Getting Started: https://data-transfer.hps.docs.pyansys.com/version/stable/getting_started/index.html
115
+ .. _Examples: https://data-transfer.hps.docs.pyansys.com/version/stable/examples/index.html
116
+ .. _PyHPS Data Transfer documentation: https://data-transfer.hps.docs.pyansys.com/
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
  [project]
6
6
  # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
7
7
  name = "ansys-hps-data-transfer-client"
8
- version = "0.2.dev0"
8
+ version = "0.2.1"
9
9
  description = "Python client library for hps data transfer service"
10
10
  readme = "README.rst"
11
11
  requires-python = ">=3.10,<4.0"
@@ -40,23 +40,22 @@ dependencies = [
40
40
  [project.optional-dependencies]
41
41
  tests = [
42
42
  "pytest==8.3.5",
43
- "pytest-cov==6.0.0",
44
- "pytest-timeout==2.3.1",
43
+ "pytest-cov==6.1.1",
44
+ "pytest-timeout==2.4.0",
45
45
  "pytest-mock-resources[redis]==2.12.2",
46
- "pytest-rerunfailures==15.0",
47
- "pytest-asyncio==0.25.3",
46
+ "pytest-rerunfailures==15.1",
47
+ "pytest-asyncio==0.26.0",
48
48
  "python-keycloak==5.3.1",
49
49
  "python-slugify>=8.0.4",
50
- "tox==4.24.2",
50
+ "tox==4.26.0",
51
51
  ]
52
52
  doc = [
53
- "ansys-sphinx-theme==1.2.6",
53
+ "ansys-sphinx-theme==1.4.4",
54
54
  "autodoc_pydantic==2.2.0",
55
55
  "jupyter_sphinx==0.5.3",
56
- "nbsphinx==0.9.6",
56
+ "nbsphinx==0.9.7",
57
57
  "numpydoc==1.8.0",
58
- "myst-parser==4.0.0",
59
- "Sphinx==8.2.3",
58
+ "Sphinx==8.1.3",
60
59
  "sphinx-autoapi==3.6.0",
61
60
  "sphinx-autodoc-typehints==3.0.1",
62
61
  "sphinxcontrib-globalsubs==0.1.2",
@@ -73,7 +72,7 @@ build = [
73
72
  "build==1.2.2.post1",
74
73
  "twine==6.1.0",
75
74
  "wheel",
76
- "datamodel-code-generator==0.26.3",
75
+ "datamodel-code-generator==0.30.1",
77
76
  "pre-commit==4.2.0",
78
77
  "importlib_metadata>=7.0",
79
78
  ]
@@ -121,12 +120,33 @@ extend-exclude = ["examples/**/*.py"]
121
120
 
122
121
  [tool.ruff.lint]
123
122
  select = [
124
- "E", # pycodestyle, see https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
125
- "F", # pyflakes, see https://beta.ruff.rs/docs/rules/#pyflakes-f
126
- "I", # isort, see https://beta.ruff.rs/docs/rules/#isort-i
127
- "N", # pep8-naming, see https://beta.ruff.rs/docs/rules/#pep8-naming-n
123
+ "E", # pycodestyle errors
124
+ "W", # pycodestyle warnings
125
+ "F", # pyflakes
126
+ "I", # isort
127
+ "N", # pep8-naming
128
+ "UP", # pyupgrade
129
+ "C4", # flake8-comprehensions
130
+ "B", # flake8-bugbear
131
+ "PLE", # Pylint errors
132
+ "PLC", # Pylint convention
133
+ "PLW", # Pylint warnings
134
+ "PLR1711", # useless-return
135
+ "PLR5501", # collapsible-else-if
136
+ "Q", # flake8-quotes
137
+ "PT", # flake8-pytest-style
138
+ "LOG", # flake8-logging
139
+ "D", # pydocstyle
128
140
  ]
129
- ignore = ["E402", "E712", "E722", "F401", "F841", "F821"]
141
+
142
+ ignore = []
143
+
144
+ [tool.ruff.lint.per-file-ignores]
145
+ "__init__.py" = ["F401"]
146
+ # ignore docstring requirements for module because it is autogenerated
147
+ "src/ansys/hps/data_transfer/client/models/*.py" = ["D", "F821"]
148
+ # ignore docstring requirements amd equility comparisons issues for tests
149
+ "tests/**/*.py" = ["D", "PT011", "E712"]
130
150
 
131
151
  [tool.ruff.lint.isort]
132
152
  combine-as-imports = true
@@ -20,5 +20,7 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
+ """PyHPS data transfer API subpackage."""
24
+
23
25
  from .api import DataTransferApi
24
26
  from .async_api import AsyncDataTransferApi
@@ -20,20 +20,18 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
- """This module provides the core API functionality for interacting with the
24
- Ansys HPS Data Transfer Client. It includes methods and utilities for performing
23
+ """Provides the core API functionality for interacting with the Ansys HPS data transfer client.
24
+
25
+ This module includes methods and utilities for performing
25
26
  data transfer operations, managing resources, and handling client interactions.
26
27
  """
27
28
 
29
+ import builtins
28
30
  import logging
29
31
  import textwrap
30
32
  import time
31
- from typing import Dict, List
32
33
 
33
34
  import backoff
34
-
35
- log = logging.getLogger(__name__)
36
-
37
35
  import humanfriendly as hf
38
36
 
39
37
  from ..client import Client
@@ -55,9 +53,11 @@ from ..models.permissions import RoleAssignment, RoleQuery
55
53
  from ..utils.jitter import get_expo_backoff
56
54
  from .retry import retry
57
55
 
56
+ log = logging.getLogger(__name__)
57
+
58
58
 
59
59
  class DataTransferApi:
60
- """Class for Data transfer API.
60
+ """Provides the data transfer API.
61
61
 
62
62
  Parameters
63
63
  ----------
@@ -66,12 +66,13 @@ class DataTransferApi:
66
66
  """
67
67
 
68
68
  def __init__(self, client: Client):
69
+ """Initializes the DataTransferApi class object."""
69
70
  self.dump_mode = "json"
70
71
  self.client = client
71
72
 
72
73
  @retry()
73
74
  def status(self, wait=False, sleep=5, jitter=True, timeout: float | None = 20.0):
74
- """Status of worker binary."""
75
+ """Get the status of the worker binary."""
75
76
 
76
77
  def _sleep():
77
78
  log.info(f"Waiting for the worker to be ready on port {self.client.binary_config.port} ...")
@@ -93,13 +94,13 @@ class DataTransferApi:
93
94
  return s
94
95
 
95
96
  @retry()
96
- def operations(self, ids: List[str]):
97
+ def operations(self, ids: list[str]):
97
98
  """Get a list of operations.
98
99
 
99
100
  Parameters
100
101
  ----------
101
102
  ids: List[str]
102
- List of ids.
103
+ List of IDs.
103
104
  """
104
105
  return self._operations(ids)
105
106
 
@@ -110,8 +111,8 @@ class DataTransferApi:
110
111
  json = resp.json()
111
112
  return StorageConfigResponse(**json).storage
112
113
 
113
- def copy(self, operations: List[SrcDst]):
114
- """Get API response for copying a list of files.
114
+ def copy(self, operations: list[SrcDst]):
115
+ """Get the API response for copying a list of files.
115
116
 
116
117
  Parameters
117
118
  ----------
@@ -119,7 +120,7 @@ class DataTransferApi:
119
120
  """
120
121
  return self._exec_operation_req("copy", operations)
121
122
 
122
- def exists(self, operations: List[StoragePath]):
123
+ def exists(self, operations: list[StoragePath]):
123
124
  """Check if a path exists.
124
125
 
125
126
  Parameters
@@ -128,7 +129,7 @@ class DataTransferApi:
128
129
  """
129
130
  return self._exec_operation_req("exists", operations)
130
131
 
131
- def list(self, operations: List[StoragePath]):
132
+ def list(self, operations: list[StoragePath]):
132
133
  """List files in a path.
133
134
 
134
135
  Parameters
@@ -137,8 +138,8 @@ class DataTransferApi:
137
138
  """
138
139
  return self._exec_operation_req("list", operations)
139
140
 
140
- def mkdir(self, operations: List[StoragePath]):
141
- """Create a dir.
141
+ def mkdir(self, operations: builtins.list[StoragePath]):
142
+ """Create a directory.
142
143
 
143
144
  Parameters
144
145
  ----------
@@ -146,7 +147,7 @@ class DataTransferApi:
146
147
  """
147
148
  return self._exec_operation_req("mkdir", operations)
148
149
 
149
- def move(self, operations: List[SrcDst]):
150
+ def move(self, operations: builtins.list[SrcDst]):
150
151
  """Move a file on the backend storage.
151
152
 
152
153
  Parameters
@@ -155,7 +156,7 @@ class DataTransferApi:
155
156
  """
156
157
  return self._exec_operation_req("move", operations)
157
158
 
158
- def remove(self, operations: List[StoragePath]):
159
+ def remove(self, operations: builtins.list[StoragePath]):
159
160
  """Delete a file.
160
161
 
161
162
  Parameters
@@ -164,8 +165,8 @@ class DataTransferApi:
164
165
  """
165
166
  return self._exec_operation_req("remove", operations)
166
167
 
167
- def rmdir(self, operations: List[StoragePath]):
168
- """Delete a dir.
168
+ def rmdir(self, operations: builtins.list[StoragePath]):
169
+ """Delete a directory.
169
170
 
170
171
  Parameters
171
172
  ----------
@@ -174,7 +175,9 @@ class DataTransferApi:
174
175
  return self._exec_operation_req("rmdir", operations)
175
176
 
176
177
  @retry()
177
- def _exec_operation_req(self, storage_operation: str, operations: List[StoragePath] | List[SrcDst]):
178
+ def _exec_operation_req(
179
+ self, storage_operation: str, operations: builtins.list[StoragePath] | builtins.list[SrcDst]
180
+ ):
178
181
  url = f"/storage:{storage_operation}"
179
182
  payload = {"operations": [operation.model_dump(mode=self.dump_mode) for operation in operations]}
180
183
  resp = self.client.session.post(url, json=payload)
@@ -182,15 +185,15 @@ class DataTransferApi:
182
185
  r = OpIdResponse(**json)
183
186
  return r
184
187
 
185
- def _operations(self, ids: List[str]):
188
+ def _operations(self, ids: builtins.list[str]):
186
189
  url = "/operations"
187
190
  resp = self.client.session.get(url, params={"ids": ids})
188
191
  json = resp.json()
189
192
  return OpsResponse(**json).operations
190
193
 
191
194
  @retry()
192
- def check_permissions(self, permissions: List[RoleAssignment]):
193
- """Checks permissions of a path (including parent directory) using a list of RoleAssignment objects.
195
+ def check_permissions(self, permissions: builtins.list[RoleAssignment]):
196
+ """Check permissions of a path (including parent directory) using a list of ``RoleAssignment`` objects.
194
197
 
195
198
  Parameters
196
199
  ----------
@@ -203,8 +206,8 @@ class DataTransferApi:
203
206
  return CheckPermissionsResponse(**json)
204
207
 
205
208
  @retry()
206
- def get_permissions(self, permissions: List[RoleQuery]):
207
- """Return permissions of a file from a list of RoleQuery objects.
209
+ def get_permissions(self, permissions: builtins.list[RoleQuery]):
210
+ """Get permissions of a file from a list of ``RoleQuery`` objects.
208
211
 
209
212
  Parameters
210
213
  ----------
@@ -217,8 +220,8 @@ class DataTransferApi:
217
220
  return GetPermissionsResponse(**json)
218
221
 
219
222
  @retry()
220
- def remove_permissions(self, permissions: List[RoleAssignment]):
221
- """Remove permissions using a list of RoleAssignment objects.
223
+ def remove_permissions(self, permissions: builtins.list[RoleAssignment]):
224
+ """Remove permissions using a list of ``RoleAssignment`` objects.
222
225
 
223
226
  Parameters
224
227
  ----------
@@ -227,11 +230,10 @@ class DataTransferApi:
227
230
  url = "/permissions:remove"
228
231
  payload = {"permissions": [permission.model_dump(mode=self.dump_mode) for permission in permissions]}
229
232
  self.client.session.post(url, json=payload)
230
- return None
231
233
 
232
234
  @retry()
233
- def set_permissions(self, permissions: List[RoleAssignment]):
234
- """Set permissions using a list of RoleAssignment objects.
235
+ def set_permissions(self, permissions: builtins.list[RoleAssignment]):
236
+ """Set permissions using a list of ``RoleAssignment`` objects.
235
237
 
236
238
  Parameters
237
239
  ----------
@@ -240,11 +242,10 @@ class DataTransferApi:
240
242
  url = "/permissions:set"
241
243
  payload = {"permissions": [permission.model_dump(mode=self.dump_mode) for permission in permissions]}
242
244
  self.client.session.post(url, json=payload)
243
- return None
244
245
 
245
246
  @retry()
246
- def get_metadata(self, paths: List[str | StoragePath]):
247
- """Get metadata of a path on backend storage.
247
+ def get_metadata(self, paths: builtins.list[str | StoragePath]):
248
+ """Get metadata of a path on the backend storage.
248
249
 
249
250
  Parameters
250
251
  ----------
@@ -258,13 +259,13 @@ class DataTransferApi:
258
259
  return OpIdResponse(**json)
259
260
 
260
261
  @retry()
261
- def set_metadata(self, asgs: Dict[str | StoragePath, DataAssignment]):
262
- """Setting metadata for a path on backend storage.
262
+ def set_metadata(self, asgs: dict[str | StoragePath, DataAssignment]):
263
+ """Set metadata for a path on the backend storage.
263
264
 
264
265
  Parameters
265
266
  ----------
266
267
  asgs: Dict[str | StoragePath, DataAssignment]
267
- List of paths with key of type string or StoragePath and value of DataAssignment
268
+ List of paths with key of type string or ``StoragePath`` and value of ``DataAssignment``.
268
269
  """
269
270
  url = "/metadata:set"
270
271
  d = {k if isinstance(k, str) else k.path: v for k, v in asgs.items()}
@@ -275,7 +276,7 @@ class DataTransferApi:
275
276
 
276
277
  def wait_for(
277
278
  self,
278
- operation_ids: List[str | Operation | OpIdResponse],
279
+ operation_ids: builtins.list[str | Operation | OpIdResponse],
279
280
  timeout: float | None = None,
280
281
  interval: float = 0.1,
281
282
  cap: float = 2.0,
@@ -284,7 +285,7 @@ class DataTransferApi:
284
285
  """Wait for operations to complete."""
285
286
  if not isinstance(operation_ids, list):
286
287
  operation_ids = [operation_ids]
287
- operation_ids = [op.id if isinstance(op, (Operation, OpIdResponse)) else op for op in operation_ids]
288
+ operation_ids = [op.id if isinstance(op, Operation | OpIdResponse) else op for op in operation_ids]
288
289
  start = time.time()
289
290
  attempt = 0
290
291
  op_str = textwrap.wrap(", ".join(operation_ids), width=60, placeholder="...")