ayon-python-api 1.2.13.dev0__tar.gz → 1.2.14__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.
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/PKG-INFO +1 -1
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/base.py +5 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/projects.py +33 -16
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/server_api.py +18 -3
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/version.py +1 -1
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/PKG-INFO +1 -1
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/pyproject.toml +2 -2
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/LICENSE +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/README.md +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/__init__.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/__init__.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/actions.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/activities.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/attributes.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/bundles_addons.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/dependency_packages.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/events.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/folders.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/installers.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/links.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/lists.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/products.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/representations.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/secrets.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/tasks.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/thumbnails.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/versions.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/workfiles.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/constants.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/entity_hub.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/events.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/exceptions.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/graphql.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/graphql_queries.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/operations.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/typing.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/utils.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/SOURCES.txt +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/dependency_links.txt +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/requires.txt +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/top_level.txt +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/setup.cfg +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/setup.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/tests/test_entity_hub.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/tests/test_folder_hierarchy.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/tests/test_get_events.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/tests/test_graphql_queries.py +0 -0
- {ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/tests/test_server.py +0 -0
|
@@ -132,6 +132,11 @@ class BaseServerAPI:
|
|
|
132
132
|
) -> Optional[dict[str, Any]]:
|
|
133
133
|
raise NotImplementedError()
|
|
134
134
|
|
|
135
|
+
def get_attributes_for_type(
|
|
136
|
+
self, entity_type: AttributeScope
|
|
137
|
+
) -> set[str]:
|
|
138
|
+
raise NotImplementedError()
|
|
139
|
+
|
|
135
140
|
def get_attributes_fields_for_type(
|
|
136
141
|
self, entity_type: AttributeScope
|
|
137
142
|
) -> set[str]:
|
|
@@ -162,6 +162,9 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
162
162
|
if response.status != 200:
|
|
163
163
|
return None
|
|
164
164
|
project = response.data
|
|
165
|
+
attrib = project["attrib"]
|
|
166
|
+
for attr_name in self.get_attributes_for_type("project"):
|
|
167
|
+
attrib.setdefault(attr_name, None)
|
|
165
168
|
self._fill_project_entity_data(project)
|
|
166
169
|
return project
|
|
167
170
|
|
|
@@ -291,16 +294,14 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
291
294
|
return
|
|
292
295
|
projects_by_name = {p["name"]: p for p in projects}
|
|
293
296
|
|
|
294
|
-
for project in self.get_rest_projects(active, library):
|
|
297
|
+
for project in self.get_rest_projects(active=active, library=library):
|
|
298
|
+
if own_attributes:
|
|
299
|
+
fill_own_attribs(project)
|
|
300
|
+
|
|
295
301
|
name = project["name"]
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
"productTypes",
|
|
300
|
-
"usedTags",
|
|
301
|
-
):
|
|
302
|
-
if key in graphql_p:
|
|
303
|
-
project[key] = graphql_p[key]
|
|
302
|
+
graphql_project = projects_by_name.get(name)
|
|
303
|
+
self._merge_project_graphql_data(project, graphql_project)
|
|
304
|
+
|
|
304
305
|
yield project
|
|
305
306
|
|
|
306
307
|
def get_project(
|
|
@@ -332,6 +333,7 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
332
333
|
graphql_project = next(self._get_graphql_projects(
|
|
333
334
|
None,
|
|
334
335
|
None,
|
|
336
|
+
project_name=project_name,
|
|
335
337
|
fields=graphql_fields,
|
|
336
338
|
own_attributes=own_attributes,
|
|
337
339
|
), None)
|
|
@@ -341,13 +343,9 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
341
343
|
project = self.get_rest_project(project_name)
|
|
342
344
|
if own_attributes:
|
|
343
345
|
fill_own_attribs(project)
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
"usedTags",
|
|
348
|
-
):
|
|
349
|
-
if key in graphql_project:
|
|
350
|
-
project[key] = graphql_project[key]
|
|
346
|
+
|
|
347
|
+
self._merge_project_graphql_data(project, graphql_project)
|
|
348
|
+
|
|
351
349
|
return project
|
|
352
350
|
|
|
353
351
|
def create_project(
|
|
@@ -817,6 +815,25 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
817
815
|
self._fill_project_entity_data(project)
|
|
818
816
|
yield project
|
|
819
817
|
|
|
818
|
+
def _merge_project_graphql_data(
|
|
819
|
+
self,
|
|
820
|
+
rest_project: dict[str, Any],
|
|
821
|
+
graphql_project: Optional[dict[str, Any]],
|
|
822
|
+
) -> None:
|
|
823
|
+
if not graphql_project:
|
|
824
|
+
return
|
|
825
|
+
|
|
826
|
+
for key, value in graphql_project.items():
|
|
827
|
+
if (
|
|
828
|
+
key not in rest_project
|
|
829
|
+
or key in (
|
|
830
|
+
"productBaseTypes",
|
|
831
|
+
"productTypes",
|
|
832
|
+
"usedTags",
|
|
833
|
+
)
|
|
834
|
+
):
|
|
835
|
+
rest_project[key] = value
|
|
836
|
+
|
|
820
837
|
def _get_project_roots_values(
|
|
821
838
|
self,
|
|
822
839
|
project_name: str,
|
|
@@ -1228,6 +1228,20 @@ class ServerAPI(
|
|
|
1228
1228
|
for retry_idx in reversed(range(max_retries)):
|
|
1229
1229
|
try:
|
|
1230
1230
|
response = function(url, **kwargs)
|
|
1231
|
+
|
|
1232
|
+
# Usually these mean, try later.
|
|
1233
|
+
# 502: returned by the proxy: nginx
|
|
1234
|
+
# 503: returned by the server: if no capacity
|
|
1235
|
+
if response.status_code in {502, 503}:
|
|
1236
|
+
new_response = RestApiResponse(response)
|
|
1237
|
+
self.log.warning(
|
|
1238
|
+
"Server returned %s status code."
|
|
1239
|
+
" Retrying with longer delay...",
|
|
1240
|
+
response.status_code
|
|
1241
|
+
)
|
|
1242
|
+
if retry_idx != 0:
|
|
1243
|
+
time.sleep(2)
|
|
1244
|
+
continue
|
|
1231
1245
|
break
|
|
1232
1246
|
|
|
1233
1247
|
except ConnectionRefusedError:
|
|
@@ -1269,7 +1283,8 @@ class ServerAPI(
|
|
|
1269
1283
|
}
|
|
1270
1284
|
)
|
|
1271
1285
|
|
|
1272
|
-
|
|
1286
|
+
if retry_idx != 0:
|
|
1287
|
+
time.sleep(0.1)
|
|
1273
1288
|
|
|
1274
1289
|
if new_response is not None:
|
|
1275
1290
|
return new_response
|
|
@@ -1419,7 +1434,7 @@ class ServerAPI(
|
|
|
1419
1434
|
requests.exceptions.Timeout,
|
|
1420
1435
|
requests.exceptions.ConnectionError,
|
|
1421
1436
|
):
|
|
1422
|
-
if attempt == retries:
|
|
1437
|
+
if attempt == retries - 1:
|
|
1423
1438
|
raise
|
|
1424
1439
|
progress.next_attempt()
|
|
1425
1440
|
|
|
@@ -1838,7 +1853,7 @@ class ServerAPI(
|
|
|
1838
1853
|
requests.exceptions.Timeout,
|
|
1839
1854
|
requests.exceptions.ConnectionError,
|
|
1840
1855
|
):
|
|
1841
|
-
if attempt == retries:
|
|
1856
|
+
if attempt == retries - 1:
|
|
1842
1857
|
raise
|
|
1843
1858
|
progress.next_attempt()
|
|
1844
1859
|
progress.reset_transferred()
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Package declaring Python API for AYON server."""
|
|
2
|
-
__version__ = "1.2.
|
|
2
|
+
__version__ = "1.2.14"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ayon_python_api"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.14"
|
|
4
4
|
description = "AYON Python API"
|
|
5
5
|
license = {file = "LICENSE"}
|
|
6
6
|
readme = {file = "README.md", content-type = "text/markdown"}
|
|
@@ -28,7 +28,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
28
28
|
|
|
29
29
|
[tool.poetry]
|
|
30
30
|
name = "ayon_python_api"
|
|
31
|
-
version = "1.2.
|
|
31
|
+
version = "1.2.14"
|
|
32
32
|
description = "AYON Python API"
|
|
33
33
|
authors = [
|
|
34
34
|
"ynput.io <info@ynput.io>"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/bundles_addons.py
RENAMED
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/dependency_packages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_api/_api_helpers/representations.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/requires.txt
RENAMED
|
File without changes
|
{ayon_python_api-1.2.13.dev0 → ayon_python_api-1.2.14}/ayon_python_api.egg-info/top_level.txt
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
|