qctrl-workflow-client 3.1.1__tar.gz → 5.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qctrl-workflow-client
3
- Version: 3.1.1
3
+ Version: 5.0.0
4
4
  Summary: Q-CTRL Client
5
5
  Home-page: https://q-ctrl.com
6
6
  License: https://q-ctrl.com/terms
@@ -9,7 +9,7 @@ Author: Q-CTRL
9
9
  Author-email: support@q-ctrl.com
10
10
  Maintainer: Q-CTRL
11
11
  Maintainer-email: support@q-ctrl.com
12
- Requires-Python: >=3.8,<3.12
12
+ Requires-Python: >=3.9,<3.13
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Intended Audience :: Developers
@@ -19,10 +19,10 @@ Classifier: License :: Other/Proprietary License
19
19
  Classifier: Natural Language :: English
20
20
  Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: Python :: 3
22
- Classifier: Programming Language :: Python :: 3.8
23
22
  Classifier: Programming Language :: Python :: 3.9
24
23
  Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
26
  Classifier: Topic :: Internet :: WWW/HTTP
27
27
  Classifier: Topic :: Scientific/Engineering :: Physics
28
28
  Classifier: Topic :: Scientific/Engineering :: Visualization
@@ -31,8 +31,8 @@ Classifier: Topic :: System :: Distributed Computing
31
31
  Requires-Dist: gql (>=3.4.0,<4.0.0)
32
32
  Requires-Dist: importlib-metadata (>=6.8.0,<7.0.0)
33
33
  Requires-Dist: packaging (>=23.1.0,<24.0.0)
34
- Requires-Dist: qctrl-client (>=9.1.0,<10.0.0)
35
- Requires-Dist: qctrl-commons (>=22.0.0,<23.0.0)
34
+ Requires-Dist: qctrl-client (>=10.1.0,<11.0.0)
35
+ Requires-Dist: qctrl-commons (>=23.0.0,<24.0.0)
36
36
  Requires-Dist: requests (>=2.32.0,<3.0.0)
37
37
  Requires-Dist: tenacity (>=8.1.0,<9.0.0)
38
38
  Requires-Dist: tomli (>=2.0.1,<3.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "qctrl-workflow-client"
3
- version = "3.1.1"
3
+ version = "5.0.0"
4
4
  description = "Q-CTRL Client"
5
5
  license = "https://q-ctrl.com/terms"
6
6
  authors = ["Q-CTRL <support@q-ctrl.com>"]
@@ -45,10 +45,10 @@ classifiers = [
45
45
  "Intended Audience :: Science/Research",
46
46
  "Natural Language :: English",
47
47
  "Operating System :: OS Independent",
48
- "Programming Language :: Python :: 3.8",
49
48
  "Programming Language :: Python :: 3.9",
50
49
  "Programming Language :: Python :: 3.10",
51
50
  "Programming Language :: Python :: 3.11",
51
+ "Programming Language :: Python :: 3.12",
52
52
  "Topic :: Internet :: WWW/HTTP",
53
53
  "Topic :: Scientific/Engineering :: Physics",
54
54
  "Topic :: Scientific/Engineering :: Visualization",
@@ -74,15 +74,15 @@ url = "https://pypi.q-ctrl.com/simple"
74
74
  priority = "primary"
75
75
 
76
76
  [tool.poetry.dependencies]
77
- python = ">=3.8, <3.12"
77
+ python = ">=3.9, <3.13"
78
78
  tomli = "^2.0.1"
79
79
  importlib-metadata = "^6.8.0"
80
80
  gql = "^3.4.0"
81
81
  tenacity = "^8.1.0"
82
82
  requests = "^2.32.0"
83
83
  packaging = "^23.1.0"
84
- qctrl-commons = { version = "^22.0.0", source = "PyPI" }
85
- qctrl-client = { version = "^9.1.0", source = "PyPI" }
84
+ qctrl-commons = { version = "^23.0.0", source = "PyPI" }
85
+ qctrl-client = { version = "^10.1.0", source = "PyPI" }
86
86
 
87
87
  [tool.poetry.group.dev.dependencies]
88
88
  black = "^24.3.0"
@@ -93,7 +93,7 @@ pytest = "^7.2.2"
93
93
  pytest-cov = "^4.0.0"
94
94
  pytest-mock = "^3.10.0"
95
95
  pytest-xdist = "^3.2.1"
96
- qctrl-core-workflow-manager = "^3.2.0"
96
+ qctrl-core-workflow-manager = "^4.0.0"
97
97
 
98
98
  [tool.isort]
99
99
  profile = "black"
@@ -11,14 +11,9 @@
11
11
  # distributed under the License is distributed on an "AS IS" BASIS. See the
12
12
  # License for the specific language.
13
13
 
14
- __version__ = "3.1.1"
14
+ __version__ = "5.0.0"
15
15
 
16
- from .defaults import (
17
- get_authenticated_client_for_product,
18
- get_default_api_url,
19
- get_default_cli_auth,
20
- get_default_oidc_url,
21
- )
16
+ from .defaults import get_authenticated_client_for_product
22
17
  from .functions import (
23
18
  core_workflow,
24
19
  print_warnings,
@@ -13,50 +13,22 @@
13
13
 
14
14
  from __future__ import annotations
15
15
 
16
- import os
17
16
  from typing import Optional
18
17
 
19
- from qctrlclient.auth import (
20
- BaseAuth,
18
+ from qctrlclient import (
21
19
  CliAuth,
22
- )
23
- from qctrlclient.client import (
24
20
  GraphQLClient,
25
- GraphQLClientError,
26
21
  )
22
+ from qctrlclient.auth import BaseAuth
23
+ from qctrlclient.defaults import (
24
+ get_default_cli_auth,
25
+ get_default_oidc_url,
26
+ )
27
+ from qctrlclient.exceptions import GraphQLClientError
27
28
  from qctrlcommons.utils import generate_user_agent
28
29
 
29
- from .globals import global_value
30
30
  from .utils import get_installed_version
31
31
 
32
- _DEFAULT_API_URL = "https://federation-service.q-ctrl.com"
33
- _DEFAULT_OIDC_URL = "https://id.q-ctrl.com"
34
-
35
-
36
- def get_default_api_url() -> str:
37
- """
38
- Return the default API URL. Can be overridden by
39
- setting the `QCTRL_API_URL` environment variable.
40
- """
41
- return os.getenv("QCTRL_API_URL", _DEFAULT_API_URL)
42
-
43
-
44
- def get_default_oidc_url() -> str:
45
- """
46
- Return the default OIDC URL. Can be overridden by
47
- setting the `QCTRL_OIDC_URL` environment variable.
48
- """
49
- return os.getenv("QCTRL_OIDC_URL", _DEFAULT_OIDC_URL)
50
-
51
-
52
- @global_value("DEFAULT_CLI_AUTH")
53
- def get_default_cli_auth() -> CliAuth:
54
- """
55
- Return default `CliAuth` object.
56
- """
57
- url = get_default_oidc_url()
58
- return CliAuth(url)
59
-
60
32
 
61
33
  def get_authenticated_client_for_product(
62
34
  product_access_required: str,
@@ -49,9 +49,6 @@ from .base import BaseRouter
49
49
  _POLL_WAIT_CHAIN = wait_chain(*[wait_fixed(2) for _ in range(15)] + [wait_fixed(10)])
50
50
 
51
51
 
52
- _MAX_PARALLEL_QUERY_COUNT = 5
53
-
54
-
55
52
  class ActionStatus(Enum):
56
53
  """
57
54
  Valid Action statuses.
@@ -752,11 +749,6 @@ class ParallelCollector:
752
749
  if isinstance(exc_value, Exception):
753
750
  return False
754
751
 
755
- if len(self._async_results) > _MAX_PARALLEL_QUERY_COUNT:
756
- raise RuntimeError(
757
- f"Number of parallel calculations: {len(self._async_results)}"
758
- f" exceeds maximum allowed parallel count of {_MAX_PARALLEL_QUERY_COUNT}."
759
- )
760
752
  for result in self._async_results:
761
753
  action = result.pop("async_result", None)
762
754
  assert action is not None
@@ -1,60 +0,0 @@
1
- # Copyright 2024 Q-CTRL. All rights reserved.
2
- #
3
- # Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
4
- # copying or use of this file, via any medium, is strictly prohibited.
5
- # Proprietary and confidential. You may not use this file except in compliance
6
- # with the License. You may obtain a copy of the License at
7
- #
8
- # https://q-ctrl.com/terms
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS. See the
12
- # License for the specific language.
13
-
14
- from functools import wraps
15
- from typing import (
16
- Any,
17
- Callable,
18
- )
19
-
20
- _REGISTRY = {}
21
-
22
-
23
- def global_value(key: str) -> Callable:
24
- """
25
- Add values to a global registry. If the
26
- `key` already exists in the registry, the
27
- stored value is returned.
28
- """
29
-
30
- def decorator(func: Callable) -> Callable:
31
- @wraps(func)
32
- def customized_decorator() -> Any:
33
- try:
34
- value = _REGISTRY[key]
35
- except KeyError:
36
- value = func()
37
- _REGISTRY[key] = value
38
-
39
- return value
40
-
41
- return customized_decorator
42
-
43
- return decorator
44
-
45
-
46
- def update_global_value(key, value: Any):
47
- """Update global registry value."""
48
- if key in _REGISTRY:
49
- _REGISTRY[key] = value
50
- else:
51
- raise KeyError(f"Key not found in the registry: {key}")
52
-
53
-
54
- def invalidate_global_value(*keys: str):
55
- """
56
- Remove the globally registered values, if they exist.
57
- """
58
- for key in keys:
59
- if key in _REGISTRY:
60
- del _REGISTRY[key]