ciocore 8.1.0b3__py2.py3-none-any.whl → 8.1.1rc1__py2.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 ciocore might be problematic. Click here for more details.

Binary file
ciocore/package_tree.py CHANGED
@@ -14,7 +14,6 @@ The only functions you should need from this module are:
14
14
 
15
15
  import copy
16
16
  import json
17
- import re
18
17
 
19
18
  WINDOWS = "windows"
20
19
  LINUX = "linux"
@@ -383,11 +382,15 @@ def _find_by_path(tree, path):
383
382
  finds a matching package, we use that package as the root of the tree for the next search. As we
384
383
  are searching for an exact path match, we limit the search to one level deep each time.
385
384
  """
385
+
386
+ if not path:
387
+ return None
388
+
389
+
386
390
  result = None
387
- if path:
388
- for name in [p for p in re.split(r'[\/|]', path) if p]:
389
- tree = _find_by_name(tree, name, 1)
390
- result = tree
391
+ for name in [p for p in path.split("/") if p]:
392
+ tree = _find_by_name(tree, name, 1)
393
+ result = tree
391
394
  return result
392
395
 
393
396
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ciocore
3
- Version: 8.1.0b3
3
+ Version: 8.1.1rc1
4
4
  Summary: Core functionality for Conductor's client tools
5
5
  Home-page: https://github.com/ConductorTechnologies/ciocore
6
6
  Author: conductor
@@ -9,7 +9,8 @@ Classifier: Operating System :: OS Independent
9
9
  Classifier: Programming Language :: Python
10
10
  Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: pyjwt ==1.7.1
12
+ Requires-Dist: requests[use_chardet_on_py3] ==2.28.1
13
+ Requires-Dist: pyjwt ==2.8
13
14
  Requires-Dist: future >=0.18.2
14
15
  Requires-Dist: cioseq <1.0.0,>=0.4.1
15
16
  Requires-Dist: Click <9.0.0,>=8.1.3
@@ -50,13 +51,14 @@ See [CONTRIBUTING](CONTRIBUTING.md)
50
51
 
51
52
  ## Changelog
52
53
 
53
- ## Unreleased:
54
+ ## Version:8.1.1-rc.1 -- 02 Jul 2024
55
+ * Updates jwt python package to 2.8
56
+
57
+
58
+ ## Version:8.1.0 -- 10 Jun 2024
59
+
60
+ * Adds two new calls to the API to get usage; get_compute_usage() and get_storage_usage()
54
61
 
55
- * 8.1.0-beta.2
56
- * Allow bar and fw slash as separators for package paths
57
- * Adds a get_account_data method to the Python API so we can provide account ID in requests
58
- * Remove chardet from requirements as it caused conflicts
59
-
60
62
  ## Version:8.0.1 -- 22 Apr 2024
61
63
 
62
64
  * The uploader now sends all error messages to the dashboard - not just the first error.
@@ -1,20 +1,20 @@
1
- ciocore/VERSION,sha256=2DRqOK9nMlSC11Nee86uSKsieXWZ1KvFlSNzs6gNdTs,12
1
+ ciocore/VERSION,sha256=j0viEX302_aNG5agFpdLMQyNRyfKA41c45xjciv6aLM,10
2
2
  ciocore/__init__.py,sha256=aTP7LeeosQA8BZE67gDV4jgfTK5zxmwZRjiTRu_ZWj0,646
3
- ciocore/api_client.py,sha256=LvxG1EfUte3NjLiuVqFUwP2iBRaUdaNSKt4wMu9Bajs,33508
3
+ ciocore/api_client.py,sha256=SBxEwAiwn2XtH7T_ipefUbWhczXjoNdNbQBur1RV-Bw,32810
4
4
  ciocore/cli.py,sha256=jZ1lOKQiUcrMhsVmD9SVmPMFwHtgDF4SaoAf2-PBS54,15449
5
5
  ciocore/client_db.py,sha256=tTz3bl2xeDPPcYSDS3g3QgV_xYihJMx0Kj6OeN2klK0,12978
6
6
  ciocore/common.py,sha256=mBIS6KiYoQsjWe6aIFUGRRvCMl8BIN2kmLZ4J8icap8,14982
7
7
  ciocore/compat.py,sha256=5uEXPSog_jxsDMaHBswAKEtfyXT25VgU6WNGIhz9PHU,256
8
8
  ciocore/conductor_submit.py,sha256=ONE0LsA5hGavTJIOXXYx8qzl8_vBPADwhd6Ytq_0E0c,9382
9
9
  ciocore/config.py,sha256=rCL7kaFn1tYgSglN8q9Wx6SwMpoXTq0BMQGwPRVwVIg,8973
10
- ciocore/data.py,sha256=_FD0sZLvLrJUXo03as3cb1RsHihL95jDCDz3MoyvNvQ,7315
10
+ ciocore/data.py,sha256=Ji0qUk8nJXBNakoHSqBiVx8O58SbZXyt273SHlEDn3U,7027
11
11
  ciocore/exceptions.py,sha256=4Oq-WX-qiN6kPUdBCHvvd6mtSQ0nCkDbJxWt2CNtpv8,1504
12
12
  ciocore/file_utils.py,sha256=swA7th9WhDEloW69YViRTKB-oeC9UmNdEGegfH1r-Gw,17176
13
13
  ciocore/hardware_set.py,sha256=FlRQiGCLRcSW7Oko_gzgVK8ZqJ_J92eT8e_AleAbS2E,17047
14
14
  ciocore/loggeria.py,sha256=2xdQRFb9NyXynU2O_pSOszJWcpoHgPwTUWJvERg7ODY,15251
15
15
  ciocore/package_environment.py,sha256=MEHV7jfs3NJIEYCIaW8JfJdBmelvPHZMmBzPlXETiRo,7808
16
16
  ciocore/package_query.py,sha256=2m5EBXfu1lmqupZrFF8f8mfkX_PgijpdMxCtFI5e5s0,5574
17
- ciocore/package_tree.py,sha256=r_UBxV5sVthdrFEGOkJlM-8ktKakkwsq_y9aBMz1ti4,15653
17
+ ciocore/package_tree.py,sha256=vkORKXxQ7dO8l0_96eFwm-5AUVL0rP9bhgWYhW_v3lo,15649
18
18
  ciocore/post_install.py,sha256=zu5Ctz2ANbKD-f5G2ODLIhKkWENBi4F3UKKu50OEWrg,1000
19
19
  ciocore/retry.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  ciocore/validator.py,sha256=f_K7gxz122W_i5AxVx6dKhckOygl8TnmQiVj7tyX5zw,2344
@@ -24,13 +24,13 @@ ciocore/auth/server.py,sha256=8btX9-EokUl6q55V8muDmEV2tvvbTBD0BHeWFbwkzUc,3892
24
24
  ciocore/docsite/404.html,sha256=zUCnDe9r5yFZh8MXcTmzDaFyYBuRHz1gvuyJS2rYiTI,17207
25
25
  ciocore/docsite/index.html,sha256=xz215H_KHWBYI1HT7IRpAZ4d1ptUiO8Y4DlOmbEPgPk,20945
26
26
  ciocore/docsite/logo.png,sha256=gArgFFWdw8w985-0TkuGIgU_pW9sziEMZdqytXb5WLo,2825
27
- ciocore/docsite/objects.inv,sha256=la6BNz_7lZoDCr3Nin1oAB7Y7DvIy4ZOKUvR-9hfwko,785
27
+ ciocore/docsite/objects.inv,sha256=XwmLactPEWWC4fAWqHNPBXGsluRxLLTrwDLQqq51ONY,775
28
28
  ciocore/docsite/sitemap.xml,sha256=M_V85zl0y2adRvzJAnoCxlZH_Hl7TLnIb1A-6l_xGmI,109
29
- ciocore/docsite/sitemap.xml.gz,sha256=em4iu7zKmOkZgFbmMbI_E6t_BlR_viXFUAOuB44IrWY,127
30
- ciocore/docsite/apidoc/api_client/index.html,sha256=qXLzKggMPnORGOzywLCYVD2Lre1M_3y3dli8fdj3ulo,193119
29
+ ciocore/docsite/sitemap.xml.gz,sha256=o3msedXC3uTmo0K7j_uAk2fndPXqtET5XrX2Tj5Tdc8,127
30
+ ciocore/docsite/apidoc/api_client/index.html,sha256=mh9VwU1J3Ks6MWvo5a-PcUt5GYdm8s7KsIVDWfnOeXY,188372
31
31
  ciocore/docsite/apidoc/apidoc/index.html,sha256=KGsHBY6GBF380w338GfOIMWnwAyyLvw2i1RQFORdwlE,26171
32
32
  ciocore/docsite/apidoc/config/index.html,sha256=n3koKPRUza5-uHUt8hK8H8XyH6HG_U2CsGobdaN4KfY,72559
33
- ciocore/docsite/apidoc/data/index.html,sha256=cXDztSoMYKeHP5cz370AoyMjKOH-gmF6oYCZk0psNGY,51962
33
+ ciocore/docsite/apidoc/data/index.html,sha256=QhqiXUd_3qk_jGRYB5JiqlJTem8Jg7aKa5mPPDT1978,50850
34
34
  ciocore/docsite/apidoc/hardware_set/index.html,sha256=4GEBYy5uLVlJqvdG71RdyrN7sKKuxszxipgmRi_NCbM,123042
35
35
  ciocore/docsite/apidoc/package_environment/index.html,sha256=1d4hVlBXPy4bldkBH1GsRjVd-bxdYANmB-Mg7xIAC_4,69248
36
36
  ciocore/docsite/apidoc/package_tree/index.html,sha256=7GaOHXeM_oKH8Db25f2-h5kUI1R6pcp0bXxW1COCJxs,109393
@@ -81,7 +81,7 @@ ciocore/docsite/cmdline/downloader/index.html,sha256=917XE3waukGnIXI9qxl0zYEf3vH
81
81
  ciocore/docsite/cmdline/packages/index.html,sha256=Ssb2R7eSubBNR824oc3jjhJfrG3JKOPojA-uiAczgeQ,20923
82
82
  ciocore/docsite/cmdline/uploader/index.html,sha256=TtLbHNlu4ofZ4bQBqam87RelWdHnVDSL7_rw_YqBbC8,25123
83
83
  ciocore/docsite/how-to-guides/index.html,sha256=rF-DMyk4k_jGUJRF3dKtMMiOgXS8OvBqAn-zxWy3AGs,20100
84
- ciocore/docsite/search/search_index.json,sha256=PZRdMiiSfYE_yytH50tR7cYO1CRmlknnrbM2BFDl2Oc,190641
84
+ ciocore/docsite/search/search_index.json,sha256=vBLU-rkC0pxOPX0O3MNKXRKGfgsaS1-91KsV17Gf9SY,189092
85
85
  ciocore/docsite/stylesheets/extra.css,sha256=_Cxe9Dhg1BBi6Kqaz_iZD9z9VyqxA9vtONRjP4PVic0,354
86
86
  ciocore/docsite/stylesheets/tables.css,sha256=LE_zwGRxGcdPIy-9QiVPecOzlEBSqZb_WP5vDkFE0ZM,3235
87
87
  ciocore/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -103,7 +103,7 @@ tests/extra_env_fixtures.py,sha256=8qvU4d8SXGKzRVNR5whVqKCQOwOVMiFVfbKBAjxa2gE,1
103
103
  tests/instance_type_fixtures.py,sha256=uIzQduqKQVgjllMuyXaYnRC-pwqk5lnTx3NY2M5Nujo,4320
104
104
  tests/package_fixtures.py,sha256=CsJnhB7oYzIxJH7b1tCOPyvnnVSCqEbSPhtCnsHL-nA,5070
105
105
  tests/project_fixtures.py,sha256=iBm_th_JtAw76vlNu7Jjhh9tLH4oOaNi-MgtPzCV7yQ,138
106
- tests/test_api_client.py,sha256=qQATQRBBUYr0G2deZHeCflNvvPo36CJyn_5xS29YPUA,16244
106
+ tests/test_api_client.py,sha256=4jhj-YrBPcLj7XZn3ngguau2DPxpCYGMSuqPJ3hW0GQ,14497
107
107
  tests/test_base_downloader.py,sha256=SS7tWKv2ZZhpUDk4UCg1TkrNrpntjSewgzLl1mEubSE,3603
108
108
  tests/test_cli.py,sha256=_WTs2SWlEgd6wtg1hmOBlFnbWVdFLvqp0KqNhy-y2e8,5532
109
109
  tests/test_common.py,sha256=tY_-SY-JmJX09UehFs9RIDqZ785AmhfTl6eVKJeIUFY,763
@@ -120,8 +120,8 @@ tests/test_uploader.py,sha256=B1llTJt_fqR6e_V_Jxfw9z73QgkFlEPU87xLYGzt-TQ,2914
120
120
  tests/test_validator.py,sha256=2fY66ayNc08PGyj2vTI-V_1yeCWJDngkj2zkUM5TTCI,1526
121
121
  tests/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
122
  tests/mocks/glob.py,sha256=J2MH7nqi6NJOHuGdVWxhfeBd700_Ckj6cLh_8jSNkfg,215
123
- ciocore-8.1.0b3.dist-info/METADATA,sha256=2xTpGaHNdwWS50Z-TLAAokcROv9uxcY2Y_DD4-YwPKM,18644
124
- ciocore-8.1.0b3.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
125
- ciocore-8.1.0b3.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
126
- ciocore-8.1.0b3.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
127
- ciocore-8.1.0b3.dist-info/RECORD,,
123
+ ciocore-8.1.1rc1.dist-info/METADATA,sha256=ORBjTBeOK4OzFMCEAAEpsWR759YukXem_TtE88LyKbU,18640
124
+ ciocore-8.1.1rc1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
125
+ ciocore-8.1.1rc1.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
126
+ ciocore-8.1.1rc1.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
127
+ ciocore-8.1.1rc1.dist-info/RECORD,,
tests/test_api_client.py CHANGED
@@ -14,11 +14,9 @@ except ImportError:
14
14
 
15
15
  from ciocore import api_client
16
16
 
17
-
17
+ from ciocore.api_client import request_extra_environment
18
18
  from ciocore.api_client import _get_compute_usage, get_compute_usage
19
19
  from ciocore.api_client import _get_storage_usage, get_storage_usage
20
- from ciocore.api_client import request_extra_environment, get_account_data
21
-
22
20
 
23
21
  class ApiClientTest(unittest.TestCase):
24
22
  @staticmethod
@@ -338,44 +336,4 @@ class TestGetStorageUsage(unittest.TestCase):
338
336
  '2024-01-04': {'cost': 5.102, 'GiB': 850.36},
339
337
  '2024-01-05': {'cost': 5.102, 'GiB': 850.35},
340
338
  '2024-01-06': {'cost': 5.732, 'GiB': 955.32}
341
- })
342
-
343
- class TestGetAccountData(unittest.TestCase):
344
-
345
- @mock.patch('ciocore.api_client.read_conductor_credentials')
346
- @mock.patch('ciocore.api_client.jwt.decode')
347
- def test_get_account_data_success(self, mock_decode, mock_read_credentials):
348
- # Setup the mocks
349
- mock_token = 'mocked_token'
350
- mock_read_credentials.return_value = mock_token
351
- mock_payload = {
352
- "email": "user@example.com",
353
- "aud": "com.domain",
354
- "account": "123456",
355
- "id": "user_id",
356
- "role": 0,
357
- "iat": 1609459200, # 2021-01-01 00:00:00 UTC
358
- "exp": 1612137600, # 2021-02-01 00:00:00 UTC
359
- }
360
- mock_decode.return_value = mock_payload
361
-
362
- account_data = get_account_data()
363
-
364
- # Assertions
365
- self.assertIsNotNone(account_data)
366
- self.assertEqual(account_data['email'], mock_payload['email'])
367
- self.assertEqual(account_data['domain'], 'domain')
368
- self.assertEqual(account_data['account_id'], mock_payload['account'])
369
- self.assertEqual(account_data['user_id'], mock_payload['id'])
370
- self.assertEqual(account_data['role'], mock_payload['role'])
371
- self.assertEqual(account_data['issued'], datetime.datetime.fromtimestamp(mock_payload['iat']))
372
- self.assertEqual(account_data['expiry'], datetime.datetime.fromtimestamp(mock_payload['exp']))
373
- self.assertEqual(account_data['token'], mock_token)
374
-
375
- @mock.patch('ciocore.api_client.read_conductor_credentials')
376
- def test_get_account_data_no_token(self, mock_read_credentials):
377
- mock_read_credentials.return_value = None
378
-
379
- # Call it
380
- account_data = get_account_data()
381
- self.assertIsNone(account_data)
339
+ })