bluer-objects 6.29.1__py3-none-any.whl → 6.30.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.

@@ -9,5 +9,5 @@ function test_bluer_objects_gif() {
9
9
  --frame_duration 200 \
10
10
  --output_filename test.gif \
11
11
  --scale 2 \
12
- --suffix .jpg
12
+ --suffix .png
13
13
  }
bluer_objects/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} data objects for Bash."
6
6
 
7
- VERSION = "6.29.1"
7
+ VERSION = "6.30.1"
8
8
 
9
9
  REPO_NAME = "bluer-objects"
10
10
 
bluer_objects/config.env CHANGED
@@ -1,7 +1,3 @@
1
- VANWATCH_TEST_OBJECT=vanwatch-test-object-v2
2
-
3
- DATABRICKS_WORKSPACE=abcli-v4
4
-
5
1
  ABCLI_MLFLOW_URL_SUBDOMAIN=ml
6
2
 
7
3
  ABCLI_MLFLOW_EXPERIMENT_PREFIX=experiment/
bluer_objects/env.py CHANGED
@@ -30,13 +30,9 @@ abcli_path_git = get_env(
30
30
 
31
31
  ABCLI_PATH_STATIC = get_env("ABCLI_PATH_STATIC")
32
32
 
33
- VANWATCH_TEST_OBJECT = get_env("VANWATCH_TEST_OBJECT")
34
-
35
33
  # https://www.randomtextgenerator.com/
36
34
  DUMMY_TEXT = "This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text. This is some dummy text."
37
35
 
38
- DATABRICKS_WORKSPACE = get_env("DATABRICKS_WORKSPACE")
39
-
40
36
  ABCLI_MLFLOW_EXPERIMENT_PREFIX = get_env("ABCLI_MLFLOW_EXPERIMENT_PREFIX")
41
37
 
42
38
  ABCLI_S3_OBJECT_PREFIX = "to-be-removed"
@@ -81,7 +81,7 @@ def post_to_object(
81
81
  ):
82
82
  return False
83
83
 
84
- return not upload or objects.upload(
84
+ return not upload or storage.upload(
85
85
  object_name=object_name,
86
86
  filename="metadata.yaml",
87
87
  )
bluer_objects/objects.py CHANGED
@@ -12,51 +12,6 @@ from bluer_objects.host import shell
12
12
  from bluer_objects.logger import logger
13
13
 
14
14
 
15
- def download(
16
- object_name: str,
17
- filename: str = "",
18
- overwrite: bool = False,
19
- ) -> bool:
20
- if not ABCLI_S3_OBJECT_PREFIX:
21
- logger.error("ABCLI_S3_OBJECT_PREFIX is not set.")
22
- return False
23
-
24
- if not object_name:
25
- logger.error("object_name not found.")
26
- return False
27
-
28
- if (
29
- filename
30
- and not overwrite
31
- and file.exists(
32
- path_of(
33
- object_name=object_name,
34
- filename=filename,
35
- )
36
- )
37
- ):
38
- return True
39
-
40
- return (
41
- shell(
42
- "aws s3 cp {}/{}/{} {}".format(
43
- ABCLI_S3_OBJECT_PREFIX,
44
- object_name,
45
- filename,
46
- object_path(object_name, create=True),
47
- )
48
- )
49
- if filename
50
- else shell(
51
- "aws s3 sync {}/{}/ {}".format(
52
- ABCLI_S3_OBJECT_PREFIX,
53
- object_name,
54
- object_path(object_name, create=True),
55
- )
56
- )
57
- )
58
-
59
-
60
15
  def list_of_files(
61
16
  object_name: str,
62
17
  cloud: bool = False,
@@ -130,34 +85,3 @@ def unique_object(
130
85
  logger.info(f"📂 {object_name}")
131
86
 
132
87
  return object_name
133
-
134
-
135
- def upload(
136
- object_name: str,
137
- filename: str = "",
138
- ) -> bool:
139
- if not ABCLI_S3_OBJECT_PREFIX:
140
- logger.error("ABCLI_S3_OBJECT_PREFIX is not set.")
141
- return False
142
-
143
- if not object_name:
144
- logger.error("object_name not found.")
145
- return False
146
-
147
- return (
148
- shell(
149
- "aws s3 cp {} {}/{}/".format(
150
- path_of(filename=filename, object_name=object_name),
151
- ABCLI_S3_OBJECT_PREFIX,
152
- object_name,
153
- )
154
- )
155
- if filename
156
- else shell(
157
- "aws s3 sync {} {}/{}/".format(
158
- object_path(object_name, create=True),
159
- ABCLI_S3_OBJECT_PREFIX,
160
- object_name,
161
- )
162
- )
163
- )
@@ -31,6 +31,14 @@ class WebDAVzipInterface(StorageInterface):
31
31
  object_path = objects.object_path(object_name=object_name)
32
32
  zip_filename = f"{object_path}.zip"
33
33
 
34
+ try:
35
+ if not self.client.check(remote_path=f"{object_name}.zip"):
36
+ logger.warning(f"{object_name} doesn't exist.")
37
+ return True
38
+ except Exception as e:
39
+ logger.error(e)
40
+ return False
41
+
34
42
  try:
35
43
  self.client.download_sync(
36
44
  remote_path=f"{object_name}.zip",
@@ -10,10 +10,6 @@ def test_required_env():
10
10
 
11
11
 
12
12
  def test_bluer_objects_env():
13
- assert env.VANWATCH_TEST_OBJECT
14
-
15
- assert env.DATABRICKS_WORKSPACE
16
-
17
13
  assert env.ABCLI_MLFLOW_EXPERIMENT_PREFIX
18
14
 
19
15
  assert env.BLUER_OBJECTS_STORAGE_INTERFACE in [
@@ -1,29 +1,13 @@
1
1
  import pytest
2
+ import numpy as np
2
3
 
3
- from blueness import module
4
-
5
- from bluer_objects import file, objects, NAME
6
- from bluer_objects import storage
7
- from bluer_objects.env import VANWATCH_TEST_OBJECT
8
4
  from bluer_objects.logger import logger
9
5
 
10
- NAME = module.name(__file__, NAME)
11
-
12
6
 
13
7
  @pytest.fixture
14
8
  def test_image():
15
- object_name = VANWATCH_TEST_OBJECT
16
-
17
- assert storage.download(object_name)
18
-
19
- success, matrix = file.load_image(
20
- objects.path_of(
21
- "Victoria41East.jpg",
22
- object_name,
23
- )
24
- )
25
- assert success
9
+ matrix = (np.random.rand(512, 512, 3) * 255).astype(np.uint8)
26
10
 
27
11
  yield matrix
28
12
 
29
- logger.info(f"deleting {NAME}.test_object ...")
13
+ logger.info(f"deleting test_image ...")
@@ -3,28 +3,25 @@ import glob
3
3
 
4
4
  from bluer_objects import objects
5
5
  from bluer_objects import storage
6
+ from bluer_objects.tests.test_objects import test_object
6
7
  from bluer_objects.graphics.gif import generate_animated_gif
7
8
 
8
9
 
9
10
  @pytest.mark.parametrize(
10
- ["object_name", "scale"],
11
+ ["scale"],
11
12
  [
12
- ["void", 1],
13
- ["2024-05-07-18-45-13-31678", 2],
13
+ [1],
14
+ [2],
14
15
  ],
15
16
  )
16
17
  def test_graphics_gif_generate_animated_gif(
17
- object_name: str,
18
+ test_object,
18
19
  scale: int,
19
20
  ):
20
- assert storage.download(object_name)
21
-
22
- list_of_images = list(glob.glob(objects.path_of("*.png", object_name)))
23
- if object_name != "void":
24
- assert list_of_images
21
+ list_of_images = list(glob.glob(objects.path_of("*.png", test_object)))
25
22
 
26
23
  assert generate_animated_gif(
27
24
  list_of_images,
28
- objects.path_of("test.gif", object_name),
25
+ objects.path_of("test.gif", test_object),
29
26
  scale=scale,
30
27
  )
@@ -35,7 +35,7 @@ def test_storage():
35
35
  filename=filename,
36
36
  )
37
37
 
38
- assert objects.upload(object_name=object_name)
38
+ assert storage.upload(object_name=object_name)
39
39
 
40
40
  for filename in [
41
41
  "this.yaml",
@@ -46,4 +46,4 @@ def test_storage():
46
46
  filename=filename,
47
47
  )
48
48
 
49
- assert objects.download(object_name=object_name)
49
+ assert storage.download(object_name=object_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_objects
3
- Version: 6.29.1
3
+ Version: 6.30.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
  [![pylint](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-objects.svg)](https://pypi.org/project/bluer-objects/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-objects)](https://pypistats.org/packages/bluer-objects)
55
55
 
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).
56
+ built by 🌀 [`bluer_options-5.28.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`bluer_objects-6.30.1`](https://github.com/kamangir/bluer-objects).
57
57
 
58
58
  built by 🌀 [`blueness-3.96.1`](https://github.com/kamangir/blueness).
@@ -1,9 +1,9 @@
1
- bluer_objects/__init__.py,sha256=vOYHFwxCmf0GZnqlNpeVRfaFJTjASYtfPiyXEcm7pMI,310
1
+ bluer_objects/__init__.py,sha256=-90ce4BLP_OEPVn-L9eX4kRnqwMH4tA9itNo91xL1vw,310
2
2
  bluer_objects/__main__.py,sha256=Yqfov833_hJuRne19WrGhT5DWAPtdffpoMxeSXS7EGw,359
3
- bluer_objects/config.env,sha256=eGjonR_ifC-IdiRnsmV3cyVTEnJqWTMmSuniXw9bncE,193
4
- bluer_objects/env.py,sha256=t_eG6SGEuuKXWtpOvFwuzL8H0SnaKEhOFIwWoIKzymo,1337
3
+ bluer_objects/config.env,sha256=TzX3WyJjwEs9V-NzK3FBUyePhb0i2ZoCja-lhDF_xJU,116
4
+ bluer_objects/env.py,sha256=4g_JNKr1uBh8bg39zXLYOCizlWD9_0fpDUYliNgpmj4,1225
5
5
  bluer_objects/markdown.py,sha256=PhAwCTHIisO9qOpKHeb63U5oD9Zi8LnIQKTx_OWS4wE,938
6
- bluer_objects/objects.py,sha256=TWbb6jeVvHJcLPutftXb724zxIiAy6aq3q4SLYgvPns,3462
6
+ bluer_objects/objects.py,sha256=RUFtGn3owSvRBgIX7TRLjlMFEz_vn8fZic5Z10LhuJ8,1691
7
7
  bluer_objects/path.py,sha256=9uspZqObI29NerVDF30uILLaouDtloASh0Mywyq2_ew,3946
8
8
  bluer_objects/sample.env,sha256=rYG7y_Vyhcjj8PTeSSJToh56NLke0jvedkcnldvrQ6k,47
9
9
  bluer_objects/urls.py,sha256=paHaYlLMQOI46-EYNch5ohu9Q09BMkF2vvJy1QufrVI,19
@@ -49,7 +49,7 @@ bluer_objects/.abcli/storage/rm.sh,sha256=kD4LY0QQXr_1EknzIHveC_I0sPFo6onfCkqtc9
49
49
  bluer_objects/.abcli/storage/status.sh,sha256=4vV49LOFp7xoT2Wg9aNa44m69Z6xOsKcU7w5e2NrnX8,371
50
50
  bluer_objects/.abcli/tests/README.sh,sha256=ToCOfpurKI1Zkl-bXzA-Yowc038jPn6Cx-_EuosgxCY,147
51
51
  bluer_objects/.abcli/tests/clone.sh,sha256=1tRa7LV4DZUcapu4mAg6hC1p8xo1K3v-IANdr_rI11k,858
52
- bluer_objects/.abcli/tests/gif.sh,sha256=CBBLdV3KkJ-aHwSTwQ1BzoG0MNr3bgXP3aw4mETtSbc,267
52
+ bluer_objects/.abcli/tests/gif.sh,sha256=Xwi7mBej7txuogTl_PG27vv42TJC0xp91AUztCq3JuI,267
53
53
  bluer_objects/.abcli/tests/help.sh,sha256=eIKFdVt-KMqMLVzKbu2XWgvDqc6chsHnpE43qOkMmK0,1773
54
54
  bluer_objects/.abcli/tests/host.sh,sha256=yvWymyoJgdCjrNFQuvw9rB4GWakjgyuf4iqGhswC0QA,133
55
55
  bluer_objects/.abcli/tests/ls.sh,sha256=CbJUpEhAinnK606oWmqTumOYw0YywOMOOPh4hX5ZVAs,198
@@ -90,7 +90,7 @@ bluer_objects/metadata/__init__.py,sha256=B8cmMOMMO53mTwD2LJUFbSjvangSkpLqhR3oVI
90
90
  bluer_objects/metadata/__main__.py,sha256=UAZBsf3AMUo-OHIgg4gS5_OowDOIO2T_zjismL3AfkI,2272
91
91
  bluer_objects/metadata/enums.py,sha256=aMlAZckl_IjPZcGZhpJa7mb9MTDQ-gWuaQtJJQeHlho,759
92
92
  bluer_objects/metadata/get.py,sha256=1eS1O-GghJ7mYCIiwcQRFwyAd1b3CUafmajAwja9HB8,1803
93
- bluer_objects/metadata/post.py,sha256=2t0PUsJPLg8Ww4irqgi_m8EuqSddjw83LRnu-pvZlLk,2062
93
+ bluer_objects/metadata/post.py,sha256=1r0yLmIuEPrKJ_-RfALC5ajpLzmUqEjLYoIQMuI4Jjw,2062
94
94
  bluer_objects/mlflow/__init__.py,sha256=GVPXTclqYAyu-iJoLeHSgTaMeoMpVaczFgU4PavS3QA,523
95
95
  bluer_objects/mlflow/__main__.py,sha256=uPRUT0x__m1jJ-TTRHmzSdv3AEFM2oKGqOJOG6wdSMk,5819
96
96
  bluer_objects/mlflow/cache.py,sha256=RQu9hLI6oRhCvj0N1VLcynSutjsxU4wQDo7N3m3i3ho,310
@@ -101,18 +101,18 @@ bluer_objects/mlflow/runs.py,sha256=v1IKRvxbuKkengESnG-xdUXxxNSkALMeBmfMQwrUKSs,
101
101
  bluer_objects/mlflow/tags.py,sha256=8uBYRrE4weTLrwPqo-c4M21FEVRANf7SGCcxpoCPhuM,2475
102
102
  bluer_objects/mlflow/testing.py,sha256=cJH5Ki02fJN_Xos1j9yvwQChXvMkOa9i12vtDKmkbNc,842
103
103
  bluer_objects/storage/WebDAV.py,sha256=KPO8ZkxrheyB9j3f9WZJ1flAycPrN2PK7fXwTQAqlcw,2891
104
- bluer_objects/storage/WebDAVzip.py,sha256=G5PJOSRDs25-sQ7F6iWrNcshvFp6rkl9bg_G1-FQjyI,2166
104
+ bluer_objects/storage/WebDAVzip.py,sha256=xWQK8OKcd3_Q7W0DQMStvgRiICW3hsHdFZzdWpji2nw,2428
105
105
  bluer_objects/storage/__init__.py,sha256=9Fs7z8cDGvgZ13YFRTfSPOYFbedEoicyTl2slwqNPng,1001
106
106
  bluer_objects/storage/__main__.py,sha256=3PaNaWa6rbsuQEKMaEwBqp0YZQP6-HdnBp7cra6j4vU,866
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/test_env.py,sha256=w5wj96nK8iQkct1As-ztINJAOTFvBv-BQtX4UcyggLo,621
110
+ bluer_objects/tests/test_env.py,sha256=Gjjb9FoQ6MPvFwX8pdx74aND8Ye_Bb-8XpaaKOZtw-4,547
111
111
  bluer_objects/tests/test_file_load_save.py,sha256=mNCo3ay55ktc5L6SPpNyrpsJrGfVpYi66EgunlAN-Uw,2406
112
112
  bluer_objects/tests/test_fullname.py,sha256=xWFf9qqzDQ-4RxRyvyR9GWZyU5qNrKxru94UUKMJfPk,80
113
- bluer_objects/tests/test_graphics.py,sha256=2YKD-PTIo5e_FHgGaMsTm2MGfgd2KzmSJhOFOTzstYc,598
113
+ bluer_objects/tests/test_graphics.py,sha256=pAKoIEq2erodUbA_5dA80ER8vJ6P3JKXZkFYkJGifSs,239
114
114
  bluer_objects/tests/test_graphics_frame.py,sha256=wRW3MjnfS8edNHiWi_BFJBULoLs1JlJhpFeuCoW5I6A,267
115
- bluer_objects/tests/test_graphics_gif.py,sha256=2h06j-NhQ0JbNy3mvkxZZMxDsODqYEqFNvksezBiZ5Q,692
115
+ bluer_objects/tests/test_graphics_gif.py,sha256=5vIRJiu1XZ7sjQ2R1VpdiqZszPx4DoZnTCd9UvFjJPY,590
116
116
  bluer_objects/tests/test_graphics_screen.py,sha256=26GMDxImz57oWb8mFrNBtiGnctfjO0oNpzi1GLaHEro,138
117
117
  bluer_objects/tests/test_graphics_signature.py,sha256=CVV257E3A5KBwqEDpRXShN-ful1zFwV9S-z-06oFkxM,1588
118
118
  bluer_objects/tests/test_graphics_text.py,sha256=_jLZVuAcQQYlKpATeQCBpPMa8UhKQ__bFYR1bedO5EE,314
@@ -123,10 +123,10 @@ bluer_objects/tests/test_metadata.py,sha256=jT39xsP4u3dq6ZWmmVwHlk0D_33Uv_-McNBd
123
123
  bluer_objects/tests/test_mlflow.py,sha256=B7CvITThv6YmDB1la9_H2sF2VLt8urpNDQ0YnC1n8HU,1381
124
124
  bluer_objects/tests/test_objects.py,sha256=kFgD8HZbjaCUOjkaHqR5cnePz0V_sntrrQO9qijVwA4,2137
125
125
  bluer_objects/tests/test_path.py,sha256=JjONWyhZyMM_u1SzD1RI_iZ5vYJDUe-B51fbbHczIig,85
126
- bluer_objects/tests/test_storage.py,sha256=pRXIStIDwo-7L-Z-cg1iEvv0tDh7cuW1-I2vY6Cm6lg,1127
126
+ bluer_objects/tests/test_storage.py,sha256=2tJ6Hev9ShId9Qn-0FXDw41HWjcl3wymcB_Bv1FJWi4,1127
127
127
  bluer_objects/tests/test_version.py,sha256=Lyf3PMcA22e17BNRk_2VgPrtao6dWEgVoXo68Uds8SE,75
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,,
128
+ bluer_objects-6.30.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
129
+ bluer_objects-6.30.1.dist-info/METADATA,sha256=8uqMOdE8I6LPPdPfT7PtDpc5UTAhSMQ23pFnlyYqgaA,2748
130
+ bluer_objects-6.30.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
131
+ bluer_objects-6.30.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
132
+ bluer_objects-6.30.1.dist-info/RECORD,,