bluer-objects 6.27.1__py3-none-any.whl → 6.29.1__py3-none-any.whl
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.
Potentially problematic release.
This version of bluer-objects might be problematic. Click here for more details.
- bluer_objects/__init__.py +1 -1
- bluer_objects/env.py +0 -3
- bluer_objects/tests/test_env.py +0 -2
- bluer_objects/tests/test_file_load_save.py +12 -5
- bluer_objects/tests/test_objects.py +39 -10
- bluer_objects/tests/test_storage.py +49 -0
- {bluer_objects-6.27.1.dist-info → bluer_objects-6.29.1.dist-info}/METADATA +2 -2
- {bluer_objects-6.27.1.dist-info → bluer_objects-6.29.1.dist-info}/RECORD +11 -12
- bluer_objects/tests/test_download.py +0 -52
- bluer_objects/tests/test_upload.py +0 -76
- {bluer_objects-6.27.1.dist-info → bluer_objects-6.29.1.dist-info}/WHEEL +0 -0
- {bluer_objects-6.27.1.dist-info → bluer_objects-6.29.1.dist-info}/licenses/LICENSE +0 -0
- {bluer_objects-6.27.1.dist-info → bluer_objects-6.29.1.dist-info}/top_level.txt +0 -0
bluer_objects/__init__.py
CHANGED
bluer_objects/env.py
CHANGED
|
@@ -37,9 +37,6 @@ DUMMY_TEXT = "This is some dummy text. This is some dummy text. This is some dum
|
|
|
37
37
|
|
|
38
38
|
DATABRICKS_WORKSPACE = get_env("DATABRICKS_WORKSPACE")
|
|
39
39
|
|
|
40
|
-
DATABRICKS_HOST = get_env("DATABRICKS_HOST")
|
|
41
|
-
DATABRICKS_TOKEN = get_env("DATABRICKS_TOKEN")
|
|
42
|
-
|
|
43
40
|
ABCLI_MLFLOW_EXPERIMENT_PREFIX = get_env("ABCLI_MLFLOW_EXPERIMENT_PREFIX")
|
|
44
41
|
|
|
45
42
|
ABCLI_S3_OBJECT_PREFIX = "to-be-removed"
|
bluer_objects/tests/test_env.py
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import pytest
|
|
2
|
-
from typing import Callable, Union, Tuple
|
|
2
|
+
from typing import Callable, Union, Tuple
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
5
5
|
from bluer_options import string
|
|
6
6
|
|
|
7
|
-
from bluer_objects import file, objects
|
|
7
|
+
from bluer_objects import file, objects
|
|
8
8
|
from bluer_objects.file.load import (
|
|
9
9
|
load_image,
|
|
10
10
|
load_json,
|
|
11
11
|
load_matrix,
|
|
12
12
|
load_text,
|
|
13
|
+
load_yaml,
|
|
13
14
|
)
|
|
14
15
|
from bluer_objects.file.save import (
|
|
15
16
|
save_image,
|
|
16
17
|
save_json,
|
|
17
18
|
save_matrix,
|
|
18
19
|
save_text,
|
|
20
|
+
save_yaml,
|
|
19
21
|
)
|
|
20
22
|
from bluer_objects.tests.test_objects import test_object
|
|
21
23
|
|
|
@@ -29,19 +31,24 @@ from bluer_objects.tests.test_objects import test_object
|
|
|
29
31
|
[
|
|
30
32
|
[
|
|
31
33
|
load_image,
|
|
32
|
-
"
|
|
34
|
+
"test-00.png",
|
|
33
35
|
save_image,
|
|
34
36
|
],
|
|
35
37
|
[
|
|
36
38
|
load_json,
|
|
37
|
-
"
|
|
39
|
+
"test.json",
|
|
38
40
|
save_json,
|
|
39
41
|
],
|
|
40
42
|
[
|
|
41
43
|
load_text,
|
|
42
|
-
"
|
|
44
|
+
"test.yaml",
|
|
43
45
|
save_text,
|
|
44
46
|
],
|
|
47
|
+
[
|
|
48
|
+
load_yaml,
|
|
49
|
+
"test.yaml",
|
|
50
|
+
save_yaml,
|
|
51
|
+
],
|
|
45
52
|
],
|
|
46
53
|
)
|
|
47
54
|
def test_file_load_save(
|
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
import numpy as np
|
|
2
3
|
|
|
3
|
-
from
|
|
4
|
+
from bluer_options import string
|
|
4
5
|
|
|
5
|
-
from bluer_objects import file, path, objects
|
|
6
|
+
from bluer_objects import file, path, objects
|
|
6
7
|
from bluer_objects import storage
|
|
7
|
-
from bluer_objects.env import VANWATCH_TEST_OBJECT
|
|
8
8
|
from bluer_objects.logger import logger
|
|
9
9
|
|
|
10
|
-
NAME = module.name(__file__, NAME)
|
|
11
|
-
|
|
12
10
|
|
|
13
11
|
@pytest.fixture
|
|
14
12
|
def test_object():
|
|
15
|
-
object_name =
|
|
13
|
+
object_name = objects.unique_object("test_object")
|
|
14
|
+
for suffix in range(10):
|
|
15
|
+
assert file.save_image(
|
|
16
|
+
objects.path_of(
|
|
17
|
+
object_name=object_name,
|
|
18
|
+
filename=f"test-{suffix:02d}.png",
|
|
19
|
+
),
|
|
20
|
+
(np.random.rand(512, 512, 3) * 255).astype(np.uint8),
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
depth = 10
|
|
24
|
+
data = {
|
|
25
|
+
string.random(length=depth): string.random(length=depth) for _ in range(depth)
|
|
26
|
+
}
|
|
16
27
|
|
|
17
|
-
assert
|
|
28
|
+
assert file.save_yaml(
|
|
29
|
+
objects.path_of(
|
|
30
|
+
object_name=object_name,
|
|
31
|
+
filename="test.yaml",
|
|
32
|
+
),
|
|
33
|
+
data,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
assert file.save_json(
|
|
37
|
+
objects.path_of(
|
|
38
|
+
object_name=object_name,
|
|
39
|
+
filename="test.json",
|
|
40
|
+
),
|
|
41
|
+
data,
|
|
42
|
+
)
|
|
18
43
|
|
|
19
44
|
yield object_name
|
|
20
45
|
|
|
21
|
-
logger.info(f"deleting
|
|
46
|
+
logger.info(f"deleting test_object ...")
|
|
22
47
|
|
|
23
48
|
|
|
24
49
|
@pytest.mark.parametrize(
|
|
@@ -29,6 +54,10 @@ def test_objects_list_of_files(
|
|
|
29
54
|
test_object,
|
|
30
55
|
cloud: bool,
|
|
31
56
|
):
|
|
57
|
+
if cloud:
|
|
58
|
+
# TODO: enable when implemented
|
|
59
|
+
return
|
|
60
|
+
|
|
32
61
|
list_of_files = [
|
|
33
62
|
file.name_and_extension(filename)
|
|
34
63
|
for filename in objects.list_of_files(
|
|
@@ -37,7 +66,7 @@ def test_objects_list_of_files(
|
|
|
37
66
|
)
|
|
38
67
|
]
|
|
39
68
|
|
|
40
|
-
assert "
|
|
69
|
+
assert "test-00.png" in list_of_files
|
|
41
70
|
|
|
42
71
|
|
|
43
72
|
def test_object_object_path():
|
|
@@ -51,7 +80,7 @@ def test_objects_path_of(test_object):
|
|
|
51
80
|
assert file.exists(
|
|
52
81
|
objects.path_of(
|
|
53
82
|
object_name=test_object,
|
|
54
|
-
filename="
|
|
83
|
+
filename="test-00.png",
|
|
55
84
|
)
|
|
56
85
|
)
|
|
57
86
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from bluer_options import string
|
|
2
|
+
|
|
3
|
+
from bluer_objects import file, objects
|
|
4
|
+
from bluer_objects import storage
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_storage():
|
|
8
|
+
object_name = objects.unique_object("test_storage")
|
|
9
|
+
|
|
10
|
+
depth = 10
|
|
11
|
+
|
|
12
|
+
for filename in [
|
|
13
|
+
"this.yaml",
|
|
14
|
+
"that.yaml",
|
|
15
|
+
"subfolder/this.yaml",
|
|
16
|
+
"subfolder/that.yaml",
|
|
17
|
+
]:
|
|
18
|
+
assert file.save_yaml(
|
|
19
|
+
objects.path_of(
|
|
20
|
+
object_name=object_name,
|
|
21
|
+
filename=filename,
|
|
22
|
+
),
|
|
23
|
+
{
|
|
24
|
+
string.random(length=depth): string.random(length=depth)
|
|
25
|
+
for _ in range(depth)
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
for filename in [
|
|
30
|
+
"this.yaml",
|
|
31
|
+
"subfolder/this.yaml",
|
|
32
|
+
]:
|
|
33
|
+
assert storage.upload(
|
|
34
|
+
object_name=object_name,
|
|
35
|
+
filename=filename,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
assert objects.upload(object_name=object_name)
|
|
39
|
+
|
|
40
|
+
for filename in [
|
|
41
|
+
"this.yaml",
|
|
42
|
+
"subfolder/this.yaml",
|
|
43
|
+
]:
|
|
44
|
+
assert storage.download(
|
|
45
|
+
object_name=object_name,
|
|
46
|
+
filename=filename,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
assert objects.download(object_name=object_name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bluer_objects
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.29.1
|
|
4
4
|
Summary: 🌀 data objects for Bash.
|
|
5
5
|
Home-page: https://github.com/kamangir/bluer-objects
|
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
|
@@ -53,6 +53,6 @@ Also home to [blue README](https://github.com/kamangir/bluer-objects/blob/main/b
|
|
|
53
53
|
|
|
54
54
|
[](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml) [](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml) [](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml) [](https://pypi.org/project/bluer-objects/) [](https://pypistats.org/packages/bluer-objects)
|
|
55
55
|
|
|
56
|
-
built by 🌀 [`bluer_options-5.
|
|
56
|
+
built by 🌀 [`bluer_options-5.28.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`bluer_objects-6.29.1`](https://github.com/kamangir/bluer-objects).
|
|
57
57
|
|
|
58
58
|
built by 🌀 [`blueness-3.96.1`](https://github.com/kamangir/blueness).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
bluer_objects/__init__.py,sha256=
|
|
1
|
+
bluer_objects/__init__.py,sha256=vOYHFwxCmf0GZnqlNpeVRfaFJTjASYtfPiyXEcm7pMI,310
|
|
2
2
|
bluer_objects/__main__.py,sha256=Yqfov833_hJuRne19WrGhT5DWAPtdffpoMxeSXS7EGw,359
|
|
3
3
|
bluer_objects/config.env,sha256=eGjonR_ifC-IdiRnsmV3cyVTEnJqWTMmSuniXw9bncE,193
|
|
4
|
-
bluer_objects/env.py,sha256=
|
|
4
|
+
bluer_objects/env.py,sha256=t_eG6SGEuuKXWtpOvFwuzL8H0SnaKEhOFIwWoIKzymo,1337
|
|
5
5
|
bluer_objects/markdown.py,sha256=PhAwCTHIisO9qOpKHeb63U5oD9Zi8LnIQKTx_OWS4wE,938
|
|
6
6
|
bluer_objects/objects.py,sha256=TWbb6jeVvHJcLPutftXb724zxIiAy6aq3q4SLYgvPns,3462
|
|
7
7
|
bluer_objects/path.py,sha256=9uspZqObI29NerVDF30uILLaouDtloASh0Mywyq2_ew,3946
|
|
@@ -107,9 +107,8 @@ bluer_objects/storage/__main__.py,sha256=3PaNaWa6rbsuQEKMaEwBqp0YZQP6-HdnBp7cra6
|
|
|
107
107
|
bluer_objects/storage/base.py,sha256=DLD7zqgWcJqXjq1l72pxX07uo7rc-Y0PqeOy9S4EZQw,859
|
|
108
108
|
bluer_objects/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
109
|
bluer_objects/tests/test_README.py,sha256=5D4UV8VcjbeAPThsYVynYtVFuP8gwMAhIjEWuOQZsWs,89
|
|
110
|
-
bluer_objects/tests/
|
|
111
|
-
bluer_objects/tests/
|
|
112
|
-
bluer_objects/tests/test_file_load_save.py,sha256=LrakotJz-GPNoF8HCT-CRLWDif6lsKmnaLzOzlSwFp0,2312
|
|
110
|
+
bluer_objects/tests/test_env.py,sha256=w5wj96nK8iQkct1As-ztINJAOTFvBv-BQtX4UcyggLo,621
|
|
111
|
+
bluer_objects/tests/test_file_load_save.py,sha256=mNCo3ay55ktc5L6SPpNyrpsJrGfVpYi66EgunlAN-Uw,2406
|
|
113
112
|
bluer_objects/tests/test_fullname.py,sha256=xWFf9qqzDQ-4RxRyvyR9GWZyU5qNrKxru94UUKMJfPk,80
|
|
114
113
|
bluer_objects/tests/test_graphics.py,sha256=2YKD-PTIo5e_FHgGaMsTm2MGfgd2KzmSJhOFOTzstYc,598
|
|
115
114
|
bluer_objects/tests/test_graphics_frame.py,sha256=wRW3MjnfS8edNHiWi_BFJBULoLs1JlJhpFeuCoW5I6A,267
|
|
@@ -122,12 +121,12 @@ bluer_objects/tests/test_logger_matrix.py,sha256=krJPUdlQTLD8P8EjkrlmJVw6Iylwbl8
|
|
|
122
121
|
bluer_objects/tests/test_markdown.py,sha256=KtCWKIDs4U1M3qAGFMYhzVpdGiDV2VU8z7dCaU3s3Ec,217
|
|
123
122
|
bluer_objects/tests/test_metadata.py,sha256=jT39xsP4u3dq6ZWmmVwHlk0D_33Uv_-McNBdy_ba2DM,4264
|
|
124
123
|
bluer_objects/tests/test_mlflow.py,sha256=B7CvITThv6YmDB1la9_H2sF2VLt8urpNDQ0YnC1n8HU,1381
|
|
125
|
-
bluer_objects/tests/test_objects.py,sha256=
|
|
124
|
+
bluer_objects/tests/test_objects.py,sha256=kFgD8HZbjaCUOjkaHqR5cnePz0V_sntrrQO9qijVwA4,2137
|
|
126
125
|
bluer_objects/tests/test_path.py,sha256=JjONWyhZyMM_u1SzD1RI_iZ5vYJDUe-B51fbbHczIig,85
|
|
127
|
-
bluer_objects/tests/
|
|
126
|
+
bluer_objects/tests/test_storage.py,sha256=pRXIStIDwo-7L-Z-cg1iEvv0tDh7cuW1-I2vY6Cm6lg,1127
|
|
128
127
|
bluer_objects/tests/test_version.py,sha256=Lyf3PMcA22e17BNRk_2VgPrtao6dWEgVoXo68Uds8SE,75
|
|
129
|
-
bluer_objects-6.
|
|
130
|
-
bluer_objects-6.
|
|
131
|
-
bluer_objects-6.
|
|
132
|
-
bluer_objects-6.
|
|
133
|
-
bluer_objects-6.
|
|
128
|
+
bluer_objects-6.29.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
|
129
|
+
bluer_objects-6.29.1.dist-info/METADATA,sha256=z8bpGNUdJ8oJjWRSSHH-fIKZnLX9uzAFoqHKH71moKc,2748
|
|
130
|
+
bluer_objects-6.29.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
131
|
+
bluer_objects-6.29.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
|
|
132
|
+
bluer_objects-6.29.1.dist-info/RECORD,,
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from bluer_objects import file, objects
|
|
5
|
-
from bluer_objects import storage
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@pytest.mark.parametrize(
|
|
9
|
-
["object_name", "filename"],
|
|
10
|
-
[[VANWATCH_TEST_OBJECT, "vancouver.geojson"]],
|
|
11
|
-
)
|
|
12
|
-
def test_objects_download(
|
|
13
|
-
object_name: str,
|
|
14
|
-
filename: str,
|
|
15
|
-
):
|
|
16
|
-
filename_fullpath = objects.path_of(
|
|
17
|
-
filename=filename,
|
|
18
|
-
object_name=object_name,
|
|
19
|
-
)
|
|
20
|
-
if file.exists(filename_fullpath):
|
|
21
|
-
assert file.delete(filename_fullpath)
|
|
22
|
-
|
|
23
|
-
assert not file.exists(filename_fullpath)
|
|
24
|
-
|
|
25
|
-
assert objects.storage(object_name=object_name)
|
|
26
|
-
|
|
27
|
-
assert file.exists(filename_fullpath)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@pytest.mark.parametrize(
|
|
31
|
-
["object_name", "filename"],
|
|
32
|
-
[[VANWATCH_TEST_OBJECT, "vancouver.geojson"]],
|
|
33
|
-
)
|
|
34
|
-
def test_objects_download_filename(
|
|
35
|
-
object_name: str,
|
|
36
|
-
filename: str,
|
|
37
|
-
):
|
|
38
|
-
filename_fullpath = objects.path_of(
|
|
39
|
-
filename=filename,
|
|
40
|
-
object_name=object_name,
|
|
41
|
-
)
|
|
42
|
-
if file.exists(filename_fullpath):
|
|
43
|
-
assert file.delete(filename_fullpath)
|
|
44
|
-
|
|
45
|
-
assert not file.exists(filename_fullpath)
|
|
46
|
-
|
|
47
|
-
assert storage.download(
|
|
48
|
-
object_name=object_name,
|
|
49
|
-
filename=filename,
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
assert file.exists(filename_fullpath)
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from blueness import module
|
|
4
|
-
|
|
5
|
-
from bluer_objects import file, objects, NAME
|
|
6
|
-
from bluer_objects import storage
|
|
7
|
-
|
|
8
|
-
NAME = module.name(__file__, NAME)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.mark.parametrize(
|
|
12
|
-
["filename"],
|
|
13
|
-
[["vancouver.geojson"]],
|
|
14
|
-
)
|
|
15
|
-
def test_objects_upload(
|
|
16
|
-
filename: str,
|
|
17
|
-
):
|
|
18
|
-
assert storage.download(object_name=VANWATCH_TEST_OBJECT)
|
|
19
|
-
|
|
20
|
-
object_name = objects.unique_object("test_objects_upload_filename")
|
|
21
|
-
|
|
22
|
-
source_filename = objects.path_of(
|
|
23
|
-
filename=filename,
|
|
24
|
-
object_name=VANWATCH_TEST_OBJECT,
|
|
25
|
-
)
|
|
26
|
-
destination_filename = objects.path_of(
|
|
27
|
-
filename=filename,
|
|
28
|
-
object_name=object_name,
|
|
29
|
-
)
|
|
30
|
-
assert file.copy(source_filename, destination_filename)
|
|
31
|
-
|
|
32
|
-
assert objects.upload(object_name=object_name)
|
|
33
|
-
|
|
34
|
-
assert file.delete(destination_filename)
|
|
35
|
-
assert not file.exists(destination_filename)
|
|
36
|
-
|
|
37
|
-
assert storage.download(object_name=object_name)
|
|
38
|
-
|
|
39
|
-
assert file.exists(destination_filename)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
@pytest.mark.parametrize(
|
|
43
|
-
["filename"],
|
|
44
|
-
[["vancouver.geojson"]],
|
|
45
|
-
)
|
|
46
|
-
def test_objects_upload_filename(
|
|
47
|
-
filename: str,
|
|
48
|
-
):
|
|
49
|
-
assert storage.download(object_name=VANWATCH_TEST_OBJECT)
|
|
50
|
-
|
|
51
|
-
object_name = objects.unique_object("test_objects_upload_filename")
|
|
52
|
-
|
|
53
|
-
source_filename = objects.path_of(
|
|
54
|
-
filename=filename,
|
|
55
|
-
object_name=VANWATCH_TEST_OBJECT,
|
|
56
|
-
)
|
|
57
|
-
destination_filename = objects.path_of(
|
|
58
|
-
filename=filename,
|
|
59
|
-
object_name=object_name,
|
|
60
|
-
)
|
|
61
|
-
assert file.copy(source_filename, destination_filename)
|
|
62
|
-
|
|
63
|
-
assert objects.upload(
|
|
64
|
-
object_name=object_name,
|
|
65
|
-
filename=filename,
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
assert file.delete(destination_filename)
|
|
69
|
-
assert not file.exists(destination_filename)
|
|
70
|
-
|
|
71
|
-
assert storage.download(
|
|
72
|
-
object_name=object_name,
|
|
73
|
-
filename=filename,
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
assert file.exists(destination_filename)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|