pyfirecrest 3.2.0__tar.gz → 3.2.2__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 (112) hide show
  1. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/PKG-INFO +1 -1
  2. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/__init__.py +1 -1
  3. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/cli2/__init__.py +22 -1
  4. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v2/_async/Client.py +20 -1
  5. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v2/_sync/Client.py +20 -1
  6. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/.github/workflows/python-publish.yml +0 -0
  7. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/.github/workflows/testing.yml +0 -0
  8. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/.gitignore +0 -0
  9. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/.mypy.ini +0 -0
  10. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/.readthedocs.yml +0 -0
  11. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/LICENSE +0 -0
  12. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/README.md +0 -0
  13. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/async-example.md +0 -0
  14. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/Makefile +0 -0
  15. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/authorization.rst +0 -0
  16. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/conf.py +0 -0
  17. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/index.rst +0 -0
  18. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_async.rst +0 -0
  19. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_async_v2.rst +0 -0
  20. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_auth.rst +0 -0
  21. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_basic.rst +0 -0
  22. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_cli.rst +0 -0
  23. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_sync_v2.rst +0 -0
  24. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_v1_index.rst +0 -0
  25. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/reference_v2_index.rst +0 -0
  26. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_async.rst +0 -0
  27. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_basic_v1.rst +0 -0
  28. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_basic_v2.rst +0 -0
  29. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_cli.rst +0 -0
  30. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_errors.rst +0 -0
  31. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_index.rst +0 -0
  32. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/docs/source/tutorial_logging.rst +0 -0
  33. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/Authorization.py +0 -0
  34. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/FirecrestException.py +0 -0
  35. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/cli/__init__.py +0 -0
  36. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/cli_script.py +0 -0
  37. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/path.py +0 -0
  38. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/py.typed +0 -0
  39. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/types.py +0 -0
  40. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/utilities.py +0 -0
  41. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v1/AsyncClient.py +0 -0
  42. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v1/AsyncExternalStorage.py +0 -0
  43. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v1/BasicClient.py +0 -0
  44. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v1/ExternalStorage.py +0 -0
  45. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v1/__init__.py +0 -0
  46. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v2/__init__.py +0 -0
  47. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/firecrest/v2/_async/__init__.py +0 -0
  48. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/pyproject.toml +0 -0
  49. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/common.py +0 -0
  50. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/context.py +0 -0
  51. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_authorisation.py +0 -0
  52. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_compute.py +0 -0
  53. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_compute_async.py +0 -0
  54. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_extras.py +0 -0
  55. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_extras_async.py +0 -0
  56. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_status.py +0 -0
  57. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_status_async.py +0 -0
  58. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_storage.py +0 -0
  59. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_storage_async.py +0 -0
  60. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_utilities.py +0 -0
  61. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/test_utilities_async.py +0 -0
  62. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/common.py +0 -0
  63. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/context_v2.py +0 -0
  64. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/handlers.py +0 -0
  65. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/checksum.json +0 -0
  66. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/chmod.json +0 -0
  67. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/chown.json +0 -0
  68. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/chown_not_permitted.json +0 -0
  69. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/compress.json +0 -0
  70. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/delete.json +0 -0
  71. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/extract.json +0 -0
  72. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/file.json +0 -0
  73. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/head.json +0 -0
  74. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/head_bytes.json +0 -0
  75. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/head_bytes_exclude_trailing.json +0 -0
  76. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/head_lines.json +0 -0
  77. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/head_lines_exclude_trailing.json +0 -0
  78. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/job_info.json +0 -0
  79. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/job_metadata.json +0 -0
  80. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/job_submit.json +0 -0
  81. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls.json +0 -0
  82. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_dereference.json +0 -0
  83. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_hidden.json +0 -0
  84. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_home.json +0 -0
  85. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_home_dereference.json +0 -0
  86. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_home_hidden.json +0 -0
  87. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_home_recursive.json +0 -0
  88. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_home_uid.json +0 -0
  89. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_invalid_path.json +0 -0
  90. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_recursive.json +0 -0
  91. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/ls_uid.json +0 -0
  92. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/mkdir.json +0 -0
  93. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/nodes.json +0 -0
  94. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/partitions.json +0 -0
  95. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/reservations.json +0 -0
  96. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/rm.json +0 -0
  97. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/stat.json +0 -0
  98. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/stat_dereference.json +0 -0
  99. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/symlink.json +0 -0
  100. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/systems.json +0 -0
  101. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/tail.json +0 -0
  102. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/tail_bytes.json +0 -0
  103. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/tail_bytes_exclude_beginning.json +0 -0
  104. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/tail_lines.json +0 -0
  105. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/tail_lines_exclude_beginning.json +0 -0
  106. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/userinfo.json +0 -0
  107. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/responses/view.json +0 -0
  108. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/test_v2_async.py +0 -0
  109. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/test_v2_cli.py +0 -0
  110. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tests/v2/test_v2_sync.py +0 -0
  111. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/tox.ini +0 -0
  112. {pyfirecrest-3.2.0 → pyfirecrest-3.2.2}/utils/run_unasync.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfirecrest
3
- Version: 3.2.0
3
+ Version: 3.2.2
4
4
  Summary: pyFirecrest is a python wrapper for FirecREST
5
5
  Author: CSCS Swiss National Supercomputing Center
6
6
  Maintainer-email: Eirini Koutsaniti <eirini.koutsaniti@cscs.ch>, Juan Pablo Dorsch <juanpablo.dorsch@cscs.ch>
@@ -7,7 +7,7 @@
7
7
  import sys
8
8
 
9
9
 
10
- __version__ = "3.2.0"
10
+ __version__ = "3.2.2"
11
11
  __app_name__ = "firecrest"
12
12
  MIN_PYTHON_VERSION = (3, 7, 0)
13
13
 
@@ -77,6 +77,21 @@ def config_callback(ctx: typer.Context, param: typer.CallbackParam, value: str):
77
77
  return value
78
78
 
79
79
 
80
+ @app.command(rich_help_panel="Status commands")
81
+ def server_version():
82
+ """Provides the exact version of the FirecREST server, when available."""
83
+ try:
84
+ result = client.server_version()
85
+ if result is None:
86
+ console.print("[yellow]Server version not available[/yellow]")
87
+ else:
88
+ console.print(result)
89
+
90
+ except Exception as e:
91
+ examine_exeption(e)
92
+ raise typer.Exit(code=1)
93
+
94
+
80
95
  @app.command(rich_help_panel="Status commands")
81
96
  def systems(
82
97
  pager: Optional[bool] = typer.Option(
@@ -361,11 +376,17 @@ def cp(
361
376
  ),
362
377
  source: str = typer.Argument(..., help="The absolute source path."),
363
378
  destination: str = typer.Argument(..., help="The absolute destination path."),
379
+ dereference: bool = typer.Option(
380
+ False,
381
+ "-L",
382
+ "--dereference",
383
+ help="When copying a symbolic link, copy the file or directory the link points to rather than the link itself.",
384
+ ),
364
385
  account: Optional[str] = typer.Option(None, help="The account to use for the operation."),
365
386
  ):
366
387
  """Copy files"""
367
388
  try:
368
- client.cp(system, source, destination, account)
389
+ client.cp(system, source, destination, dereference=dereference, account=account)
369
390
  except Exception as e:
370
391
  examine_exeption(e)
371
392
  raise typer.Exit(code=1)
@@ -448,6 +448,21 @@ class AsyncFirecrest:
448
448
 
449
449
  return response.json() if return_json and status_code != 204 else {}
450
450
 
451
+ async def server_version(self) -> str | None:
452
+ """Returns the exact API version of the FirecREST server.
453
+
454
+ :calls: GET `/status/systems`
455
+ """
456
+ resp = await self._get_request(endpoint="/status/systems")
457
+ if resp.headers.get("f7t-appversion") == "2.x.x":
458
+ return "2"
459
+ elif (
460
+ resp.headers.get("f7t-appversion")
461
+ ):
462
+ return resp.headers["f7t-appversion"]
463
+ else:
464
+ return None
465
+
451
466
  async def systems(self) -> List[dict]:
452
467
  """Returns available systems.
453
468
 
@@ -1014,6 +1029,7 @@ class AsyncFirecrest:
1014
1029
  system_name: str,
1015
1030
  source_path: str,
1016
1031
  target_path: str,
1032
+ dereference: bool = False,
1017
1033
  account: Optional[str] = None,
1018
1034
  blocking: bool = True,
1019
1035
  timeout: Optional[float] = None
@@ -1023,14 +1039,17 @@ class AsyncFirecrest:
1023
1039
  :param system_name: the system name where the filesystem belongs to
1024
1040
  :param source_path: the absolute source path
1025
1041
  :param target_path: the absolute target path
1042
+ :param dereference: dereference links when copying
1026
1043
  :param blocking: whether to wait for the job to complete
1027
1044
  :param account: the account to be used for the transfer job
1028
1045
  :param timeout: the maximum time to wait for the job to complete
1029
1046
  :calls: POST `/filesystem/{system_name}/transfer/cp`
1030
1047
  """
1031
- data: dict[str, str] = {
1048
+ # TODO: dereference is supported only after version 2.2.8 of the API
1049
+ data: dict[str, Any] = {
1032
1050
  "sourcePath": source_path,
1033
1051
  "targetPath": target_path,
1052
+ "dereference": dereference,
1034
1053
  }
1035
1054
  if account is not None:
1036
1055
  data["account"] = account
@@ -433,6 +433,21 @@ class Firecrest:
433
433
 
434
434
  return response.json() if return_json and status_code != 204 else {}
435
435
 
436
+ def server_version(self) -> str | None:
437
+ """Returns the exact API version of the FirecREST server.
438
+
439
+ :calls: GET `/status/systems`
440
+ """
441
+ resp = self._get_request(endpoint="/status/systems")
442
+ if resp.headers.get("f7t-appversion") == "2.x.x":
443
+ return "2"
444
+ elif (
445
+ resp.headers.get("f7t-appversion")
446
+ ):
447
+ return resp.headers["f7t-appversion"]
448
+ else:
449
+ return None
450
+
436
451
  def systems(self) -> List[dict]:
437
452
  """Returns available systems.
438
453
 
@@ -999,6 +1014,7 @@ class Firecrest:
999
1014
  system_name: str,
1000
1015
  source_path: str,
1001
1016
  target_path: str,
1017
+ dereference: bool = False,
1002
1018
  account: Optional[str] = None,
1003
1019
  blocking: bool = True,
1004
1020
  timeout: Optional[float] = None
@@ -1008,14 +1024,17 @@ class Firecrest:
1008
1024
  :param system_name: the system name where the filesystem belongs to
1009
1025
  :param source_path: the absolute source path
1010
1026
  :param target_path: the absolute target path
1027
+ :param dereference: dereference links when copying
1011
1028
  :param blocking: whether to wait for the job to complete
1012
1029
  :param account: the account to be used for the transfer job
1013
1030
  :param timeout: the maximum time to wait for the job to complete
1014
1031
  :calls: POST `/filesystem/{system_name}/transfer/cp`
1015
1032
  """
1016
- data: dict[str, str] = {
1033
+ # TODO: dereference is supported only after version 2.2.8 of the API
1034
+ data: dict[str, Any] = {
1017
1035
  "sourcePath": source_path,
1018
1036
  "targetPath": target_path,
1037
+ "dereference": dereference,
1019
1038
  }
1020
1039
  if account is not None:
1021
1040
  data["account"] = account
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes