plexus-python-common 1.0.35__tar.gz → 1.0.36__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 (82) hide show
  1. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/PKG-INFO +1 -1
  2. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/s3utils.py +19 -14
  3. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/PKG-INFO +1 -1
  4. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.editorconfig +0 -0
  5. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.github/workflows/pr.yml +0 -0
  6. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.github/workflows/push.yml +0 -0
  7. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.gitignore +0 -0
  8. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/MANIFEST.in +0 -0
  9. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/README.md +0 -0
  10. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/VERSION +0 -0
  11. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/pyproject.toml +0 -0
  12. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.0.jsonl +0 -0
  13. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.1.jsonl +0 -0
  14. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.2.jsonl +0 -0
  15. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.bar.baz +0 -0
  16. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.foo.bar +0 -0
  17. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.foo.baz +0 -0
  18. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/dir.foo.bar/dir.foo.bar.baz/file.foo.bar.baz +0 -0
  19. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.bar.baz +0 -0
  20. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.bar +0 -0
  21. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.baz +0 -0
  22. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.bar +0 -0
  23. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.baz +0 -0
  24. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.foo +0 -0
  25. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils_archive/archive.compressed.zip +0 -0
  26. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils_archive/archive.uncompressed.zip +0 -0
  27. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/0-dummy +0 -0
  28. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/1-dummy +0 -0
  29. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/2-dummy +0 -0
  30. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.0.jsonl +0 -0
  31. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.0.vol-0.jsonl +0 -0
  32. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.jsonl +0 -0
  33. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.1.jsonl +0 -0
  34. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.1.vol-1.jsonl +0 -0
  35. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.jsonl +0 -0
  36. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.2.jsonl +0 -0
  37. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.2.vol-2.jsonl +0 -0
  38. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.jsonl +0 -0
  39. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part0 +0 -0
  40. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part1 +0 -0
  41. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part2 +0 -0
  42. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.txt +0 -0
  43. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/setup.cfg +0 -0
  44. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/setup.py +0 -0
  45. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/__init__.py +0 -0
  46. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMFile.py +0 -0
  47. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMNode.py +0 -0
  48. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMTags.py +0 -0
  49. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMWay.py +0 -0
  50. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/__init__.py +0 -0
  51. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/pose.py +0 -0
  52. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/proj.py +0 -0
  53. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/__init__.py +0 -0
  54. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/apiutils.py +0 -0
  55. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/bagutils.py +0 -0
  56. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/config.py +0 -0
  57. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/datautils.py +0 -0
  58. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/jsonutils.py +0 -0
  59. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/ormutils.py +0 -0
  60. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/shutils.py +0 -0
  61. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/sqlutils.py +0 -0
  62. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/strutils.py +0 -0
  63. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/testutils.py +0 -0
  64. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/SOURCES.txt +0 -0
  65. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/dependency_links.txt +0 -0
  66. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/not-zip-safe +0 -0
  67. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/requires.txt +0 -0
  68. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/top_level.txt +0 -0
  69. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_test.py +0 -0
  70. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/__init__.py +0 -0
  71. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/carto/osm_file_test.py +0 -0
  72. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/carto/osm_tags_test.py +0 -0
  73. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/pose_test.py +0 -0
  74. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/proj_test.py +0 -0
  75. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/bagutils_test.py +0 -0
  76. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/datautils_test.py +0 -0
  77. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/jsonutils_test.py +0 -0
  78. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/ormutils_test.py +0 -0
  79. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/s3utils_test.py +0 -0
  80. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/shutils_test.py +0 -0
  81. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/strutils_test.py +0 -0
  82. {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/testutils_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-python-common
3
- Version: 1.0.35
3
+ Version: 1.0.36
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Programming Language :: Python :: 3.13
@@ -13,11 +13,12 @@ import typing
13
13
  import zipfile
14
14
  import zlib
15
15
  from collections.abc import Callable, Generator
16
- from typing import Any, Literal
16
+ from typing import Literal
17
17
 
18
18
  import boto3
19
19
  import fsspec
20
20
  import fsspec.utils
21
+ from iker.common.utils.jsonutils import JsonObject
21
22
  from iker.common.utils.sequtils import chunk_between, head, last
22
23
  from iker.common.utils.shutils import glob_match, listfile, path_depth
23
24
  from iker.common.utils.strutils import is_empty, trim_to_none
@@ -83,6 +84,7 @@ def s3_make_client(
83
84
  aws_secret_access_key=trim_to_none(secret_access_key),
84
85
  region_name=trim_to_none(region_name))
85
86
  client = session.client("s3", endpoint_url=trim_to_none(endpoint_url))
87
+ client.meta.credentials = session.get_credentials()
86
88
  try:
87
89
  yield client
88
90
  finally:
@@ -473,7 +475,7 @@ def s3_make_progressed_client(
473
475
  :param secret_access_key: AWS secret access key.
474
476
  :param region_name: AWS service region name.
475
477
  :param endpoint_url: AWS service endpoint URL.
476
- :return: An instance of ``S3Client`` with progress reporting.
478
+ :return: An instance of ``S3ClientProgressProxy`` that wraps an ``S3Client`` with progress reporting.
477
479
  """
478
480
  with Progress(
479
481
  TextColumn("[blue]{task.fields[key]}"),
@@ -481,18 +483,11 @@ def s3_make_progressed_client(
481
483
  DownloadColumn(),
482
484
  TransferSpeedColumn(),
483
485
  ) as progress:
484
- session = boto3.Session(aws_access_key_id=trim_to_none(access_key_id),
485
- aws_secret_access_key=trim_to_none(secret_access_key),
486
- region_name=trim_to_none(region_name))
487
- client = session.client("s3", endpoint_url=trim_to_none(endpoint_url))
488
- proxy = S3ClientProgressProxy(client, progress)
489
- try:
490
- yield proxy
491
- finally:
492
- proxy.close()
486
+ with s3_make_client(access_key_id, secret_access_key, region_name, endpoint_url) as client:
487
+ yield S3ClientProgressProxy(client, progress)
493
488
 
494
489
 
495
- def s3_options_from_s3_client(client: S3Client) -> dict[str, Any]:
490
+ def s3_options_from_s3_client(client: S3Client) -> JsonObject:
496
491
  """
497
492
  Extracts S3 connection options from an existing S3Client instance for use with ``fsspec``.
498
493
 
@@ -502,9 +497,19 @@ def s3_options_from_s3_client(client: S3Client) -> dict[str, Any]:
502
497
  if client is None:
503
498
  return {}
504
499
 
505
- s3_options: dict[str, Any] = {}
500
+ s3_options: JsonObject = {}
506
501
 
507
- credentials = client._request_signer._credentials
502
+ try:
503
+ # Extract credentials from the client
504
+ # First try the public meta attribute, which is injected by our `s3_make_client` function, if available
505
+ credentials = client.meta.credentials
506
+ except AttributeError:
507
+ try:
508
+ # Fallback to private attribute (may not be stable across boto3 versions)
509
+ credentials = client._request_signer._credentials
510
+ except AttributeError:
511
+ # Unable to extract credentials
512
+ raise AttributeError("cannot extract credentials from the provided S3Client instance")
508
513
  if credentials is not None:
509
514
  if credentials.access_key:
510
515
  s3_options["key"] = credentials.access_key
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-python-common
3
- Version: 1.0.35
3
+ Version: 1.0.36
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Programming Language :: Python :: 3.13