dsw-storage 4.12.0__tar.gz → 4.14.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.
- {dsw_storage-4.12.0/dsw_storage.egg-info → dsw_storage-4.14.0}/PKG-INFO +4 -4
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw/storage/build_info.py +4 -4
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw/storage/s3storage.py +9 -10
- {dsw_storage-4.12.0 → dsw_storage-4.14.0/dsw_storage.egg-info}/PKG-INFO +4 -4
- dsw_storage-4.14.0/dsw_storage.egg-info/requires.txt +3 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/pyproject.toml +4 -4
- dsw_storage-4.12.0/dsw_storage.egg-info/requires.txt +0 -3
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/LICENSE +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/README.md +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw/storage/__init__.py +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw_storage.egg-info/SOURCES.txt +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw_storage.egg-info/dependency_links.txt +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw_storage.egg-info/not-zip-safe +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/dsw_storage.egg-info/top_level.txt +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/setup.cfg +0 -0
- {dsw_storage-4.12.0 → dsw_storage-4.14.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dsw-storage
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.14.0
|
|
4
4
|
Summary: Library for managing DSW S3 storage
|
|
5
5
|
Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -11,16 +11,16 @@ Keywords: dsw,s3,bucket,storage
|
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Topic :: Communications :: File Sharing
|
|
17
17
|
Classifier: Topic :: Utilities
|
|
18
|
-
Requires-Python: <4,>=3.
|
|
18
|
+
Requires-Python: <4,>=3.11
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: minio
|
|
22
22
|
Requires-Dist: tenacity
|
|
23
|
-
Requires-Dist: dsw-config==4.
|
|
23
|
+
Requires-Dist: dsw-config==4.14.0
|
|
24
24
|
|
|
25
25
|
# Data Stewardship Wizard: Storage
|
|
26
26
|
|
|
@@ -9,9 +9,9 @@ BuildInfo = namedtuple(
|
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
BUILD_INFO = BuildInfo(
|
|
12
|
-
version='v4.
|
|
13
|
-
built_at='
|
|
14
|
-
sha='
|
|
12
|
+
version='v4.14.0~213910f',
|
|
13
|
+
built_at='2025-01-07 08:18:01Z',
|
|
14
|
+
sha='213910ffb32a7cea98942ccd0f6c52cb6cf79128',
|
|
15
15
|
branch='HEAD',
|
|
16
|
-
tag='v4.
|
|
16
|
+
tag='v4.14.0',
|
|
17
17
|
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import contextlib
|
|
2
2
|
import io
|
|
3
3
|
import logging
|
|
4
|
-
import minio # type: ignore
|
|
5
|
-
import minio.error # type: ignore
|
|
6
4
|
import pathlib
|
|
7
5
|
import tempfile
|
|
8
|
-
import tenacity
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
import minio
|
|
8
|
+
import minio.error
|
|
9
|
+
import tenacity
|
|
11
10
|
|
|
12
11
|
from dsw.config.model import S3Config
|
|
13
12
|
|
|
@@ -35,7 +34,7 @@ class S3Storage:
|
|
|
35
34
|
parts = url.split('://', maxsplit=1)
|
|
36
35
|
return parts[0] if len(parts) == 1 else parts[1]
|
|
37
36
|
|
|
38
|
-
def __init__(self, cfg: S3Config, multi_tenant: bool):
|
|
37
|
+
def __init__(self, *, cfg: S3Config, multi_tenant: bool):
|
|
39
38
|
self.cfg = cfg
|
|
40
39
|
self.multi_tenant = multi_tenant
|
|
41
40
|
self.client = minio.Minio(
|
|
@@ -69,9 +68,9 @@ class S3Storage:
|
|
|
69
68
|
before=tenacity.before_log(LOG, logging.DEBUG),
|
|
70
69
|
after=tenacity.after_log(LOG, logging.DEBUG),
|
|
71
70
|
)
|
|
72
|
-
def store_document(self, tenant_uuid: str, file_name: str,
|
|
71
|
+
def store_document(self, *, tenant_uuid: str, file_name: str,
|
|
73
72
|
content_type: str, data: bytes,
|
|
74
|
-
metadata:
|
|
73
|
+
metadata: dict | None = None):
|
|
75
74
|
object_name = f'{DOCUMENTS_DIR}/{file_name}'
|
|
76
75
|
if self.multi_tenant:
|
|
77
76
|
object_name = f'{tenant_uuid}/{object_name}'
|
|
@@ -92,7 +91,7 @@ class S3Storage:
|
|
|
92
91
|
before=tenacity.before_log(LOG, logging.DEBUG),
|
|
93
92
|
after=tenacity.after_log(LOG, logging.DEBUG),
|
|
94
93
|
)
|
|
95
|
-
def download_file(self, file_name: str, target_path: pathlib.Path) -> bool:
|
|
94
|
+
def download_file(self, *, file_name: str, target_path: pathlib.Path) -> bool:
|
|
96
95
|
try:
|
|
97
96
|
self.client.fget_object(
|
|
98
97
|
bucket_name=self.cfg.bucket,
|
|
@@ -112,9 +111,9 @@ class S3Storage:
|
|
|
112
111
|
before=tenacity.before_log(LOG, logging.DEBUG),
|
|
113
112
|
after=tenacity.after_log(LOG, logging.DEBUG),
|
|
114
113
|
)
|
|
115
|
-
def store_object(self, tenant_uuid: str, object_name: str,
|
|
114
|
+
def store_object(self, *, tenant_uuid: str, object_name: str,
|
|
116
115
|
content_type: str, data: bytes,
|
|
117
|
-
metadata:
|
|
116
|
+
metadata: dict | None = None):
|
|
118
117
|
if self.multi_tenant:
|
|
119
118
|
object_name = f'{tenant_uuid}/{object_name}'
|
|
120
119
|
with io.BytesIO(data) as file:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dsw-storage
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.14.0
|
|
4
4
|
Summary: Library for managing DSW S3 storage
|
|
5
5
|
Author-email: Marek Suchánek <marek.suchanek@ds-wizard.org>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -11,16 +11,16 @@ Keywords: dsw,s3,bucket,storage
|
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Topic :: Communications :: File Sharing
|
|
17
17
|
Classifier: Topic :: Utilities
|
|
18
|
-
Requires-Python: <4,>=3.
|
|
18
|
+
Requires-Python: <4,>=3.11
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: minio
|
|
22
22
|
Requires-Dist: tenacity
|
|
23
|
-
Requires-Dist: dsw-config==4.
|
|
23
|
+
Requires-Dist: dsw-config==4.14.0
|
|
24
24
|
|
|
25
25
|
# Data Stewardship Wizard: Storage
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = 'dsw-storage'
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.14.0"
|
|
8
8
|
description = 'Library for managing DSW S3 storage'
|
|
9
9
|
readme = 'README.md'
|
|
10
10
|
keywords = ['dsw', 's3', 'bucket', 'storage']
|
|
@@ -16,17 +16,17 @@ classifiers = [
|
|
|
16
16
|
'Development Status :: 5 - Production/Stable',
|
|
17
17
|
'License :: OSI Approved :: Apache Software License',
|
|
18
18
|
'Programming Language :: Python',
|
|
19
|
-
'Programming Language :: Python :: 3.10',
|
|
20
19
|
'Programming Language :: Python :: 3.11',
|
|
20
|
+
'Programming Language :: Python :: 3.12',
|
|
21
21
|
'Topic :: Communications :: File Sharing',
|
|
22
22
|
'Topic :: Utilities',
|
|
23
23
|
]
|
|
24
|
-
requires-python = '>=3.
|
|
24
|
+
requires-python = '>=3.11, <4'
|
|
25
25
|
dependencies = [
|
|
26
26
|
'minio',
|
|
27
27
|
'tenacity',
|
|
28
28
|
# DSW
|
|
29
|
-
"dsw-config==4.
|
|
29
|
+
"dsw-config==4.14.0",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
[project.urls]
|
|
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
|