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.
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/PKG-INFO +1 -1
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/s3utils.py +19 -14
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/PKG-INFO +1 -1
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.editorconfig +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.github/workflows/pr.yml +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.github/workflows/push.yml +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/.gitignore +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/MANIFEST.in +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/README.md +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/VERSION +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/pyproject.toml +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.0.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.1.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/jsonutils/dummy.2.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.bar.baz +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.foo.bar +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.baz/file.foo.baz +0 -0
- {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
- {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
- {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
- {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
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.bar +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.baz +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils/dir.foo/file.foo +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils_archive/archive.compressed.zip +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/s3utils_archive/archive.uncompressed.zip +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/0-dummy +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/1-dummy +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/2-dummy +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.0.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.0.vol-0.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.1.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.1.vol-1.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.2.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.2.vol-2.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.jsonl +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part0 +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part1 +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.csv.part2 +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.txt +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/setup.cfg +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/setup.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/__init__.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMFile.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMNode.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMTags.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMWay.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/__init__.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/pose.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/proj.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/__init__.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/apiutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/bagutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/config.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/datautils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/jsonutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/ormutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/shutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/sqlutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/strutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/testutils.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/SOURCES.txt +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/dependency_links.txt +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/not-zip-safe +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/requires.txt +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus_python_common.egg-info/top_level.txt +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/__init__.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/carto/osm_file_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/carto/osm_tags_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/pose_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/proj_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/bagutils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/datautils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/jsonutils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/ormutils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/s3utils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/shutils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/strutils_test.py +0 -0
- {plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/utils/testutils_test.py +0 -0
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/s3utils.py
RENAMED
|
@@ -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
|
|
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
|
-
|
|
485
|
-
|
|
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) ->
|
|
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:
|
|
500
|
+
s3_options: JsonObject = {}
|
|
506
501
|
|
|
507
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/0-dummy
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/1-dummy
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/2-dummy
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.0.jsonl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.1.jsonl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.2.jsonl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/resources/unittest/shutils/dummy.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMFile.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMNode.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMTags.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/OSMWay.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/carto/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/__init__.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/apiutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/bagutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/config.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/datautils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/jsonutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/ormutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/shutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/sqlutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/strutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/src/plexus/common/utils/testutils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/pose_test.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.35 → plexus_python_common-1.0.36}/test/plexus_tests/common/proj_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|