sumo-wrapper-python 1.5.0__tar.gz → 1.6.1__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.
- sumo_wrapper_python-1.6.1/.github/pull_request_template.md +15 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/PKG-INFO +1 -1
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/_auth_provider.py +2 -2
- sumo_wrapper_python-1.6.1/src/sumo/wrapper/_version.py +24 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/login.py +14 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/sumo_client.py +5 -2
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/PKG-INFO +1 -1
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/SOURCES.txt +1 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/tests/test_sumo_thin_client.py +3 -4
- sumo_wrapper_python-1.5.0/src/sumo/wrapper/_version.py +0 -34
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.github/workflows/build_docs.yaml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.github/workflows/linting.yml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.github/workflows/publish_release.yml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.github/workflows/pytest.yml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.gitignore +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.pre-commit-config.yaml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.readthedocs.yaml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/CONTRIBUTING.md +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/LICENSE +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/README.md +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/SECURITY.md +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/Makefile +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/_static/equinor-logo.png +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/_static/equinor-logo2.jpg +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/_static/equinor_logo.jpg +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/_static/equinor_logo_only.jpg +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/_templates/layout.html +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/api.rst +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/conf.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/index.rst +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/make.bat +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/docs/sumo-wrapper-python.rst +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/pyproject.toml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/setup.cfg +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/__init__.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/__init__.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/_blob_client.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/_decorators.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/_logging.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo/wrapper/_retry_strategy.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/dependency_links.txt +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/entry_points.txt +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/requires.txt +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/src/sumo_wrapper_python.egg-info/top_level.txt +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/tests/conftest.py +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/tests/testdata/case.yml +0 -0
- {sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/tests/testdata/surface.yml +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Issue
|
|
2
|
+
_Link to the issue resolved by this PR._
|
|
3
|
+
|
|
4
|
+
## Description
|
|
5
|
+
_Description of the approach taken to solve the issue._
|
|
6
|
+
|
|
7
|
+
## How to test
|
|
8
|
+
_How to verify the changes._
|
|
9
|
+
|
|
10
|
+
## Checklist
|
|
11
|
+
- [ ] No redundant \`print()\` statements, commented-out code, or other remnants from the development 👀
|
|
12
|
+
- [ ] New/refactored code is following same conventions as the rest of the code base 🧬
|
|
13
|
+
- [ ] New/refactored code is tested ⚙
|
|
14
|
+
- [ ] Documentation has been updated 🧾
|
|
15
|
+
- [ ] Commits are semantic ✅
|
|
@@ -325,8 +325,8 @@ class AuthProviderDeviceCode(AuthProvider):
|
|
|
325
325
|
if "error" in flow:
|
|
326
326
|
print(
|
|
327
327
|
"\n\n \033[31m"
|
|
328
|
-
+ "Failed to initiate device-code login. Err: %s"
|
|
329
|
-
|
|
328
|
+
+ "Failed to initiate device-code login. Err: %s\033[0m"
|
|
329
|
+
% json.dumps(flow, indent=4)
|
|
330
330
|
)
|
|
331
331
|
return
|
|
332
332
|
flow["expires_at"] = (
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '1.6.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 6, 1)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'g298e73c63'
|
|
@@ -8,6 +8,8 @@ logger.setLevel(level="CRITICAL")
|
|
|
8
8
|
|
|
9
9
|
modes = ["interactive", "devicecode", "silent"]
|
|
10
10
|
|
|
11
|
+
fmu_sumo_uploader_client_id = "a65dc4cc-3dec-43df-9599-e66d3abc4dca"
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
def get_parser() -> ArgumentParser:
|
|
13
15
|
parser = ArgumentParser(description="Login to Sumo on azure")
|
|
@@ -47,6 +49,16 @@ def get_parser() -> ArgumentParser:
|
|
|
47
49
|
help="Print access token",
|
|
48
50
|
)
|
|
49
51
|
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"-u",
|
|
54
|
+
"--uploader",
|
|
55
|
+
dest="client_id",
|
|
56
|
+
action="store_const",
|
|
57
|
+
const=fmu_sumo_uploader_client_id,
|
|
58
|
+
default=None,
|
|
59
|
+
help="Use fmu-sumo-uploader client registration",
|
|
60
|
+
)
|
|
61
|
+
|
|
50
62
|
return parser
|
|
51
63
|
|
|
52
64
|
|
|
@@ -54,6 +66,7 @@ def main():
|
|
|
54
66
|
args = get_parser().parse_args()
|
|
55
67
|
logger.setLevel(level=args.verbosity)
|
|
56
68
|
env = args.env
|
|
69
|
+
client_id = args.client_id
|
|
57
70
|
mode = args.mode
|
|
58
71
|
is_interactive = mode == "interactive"
|
|
59
72
|
is_devicecode = mode == "devicecode"
|
|
@@ -71,6 +84,7 @@ def main():
|
|
|
71
84
|
env,
|
|
72
85
|
interactive=is_interactive,
|
|
73
86
|
devicecode=is_devicecode,
|
|
87
|
+
client_id=client_id,
|
|
74
88
|
)
|
|
75
89
|
token = sumo.authenticate()
|
|
76
90
|
|
|
@@ -26,6 +26,8 @@ WELL_KNOWN = os.environ.get(
|
|
|
26
26
|
"SUMOCONNECTIONINFO", "https://api.sumo.equinor.com/well-known"
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
+
well_known = None
|
|
30
|
+
|
|
29
31
|
|
|
30
32
|
class SumoClient:
|
|
31
33
|
"""Authenticate and perform requests to the Sumo API."""
|
|
@@ -70,8 +72,9 @@ class SumoClient:
|
|
|
70
72
|
"""
|
|
71
73
|
|
|
72
74
|
logger.setLevel(verbosity)
|
|
73
|
-
|
|
74
|
-
well_known
|
|
75
|
+
global well_known
|
|
76
|
+
if well_known is None:
|
|
77
|
+
well_known = httpx.get(WELL_KNOWN).json()
|
|
75
78
|
if env not in well_known["envs"]:
|
|
76
79
|
raise ValueError(f"Invalid environment: {env}")
|
|
77
80
|
|
|
@@ -50,8 +50,7 @@ def _upload_child_level_json(conn, parent_id, json):
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def _delete_object(conn, object_id):
|
|
53
|
-
response = conn.delete(f"/objects('{object_id}')")
|
|
54
|
-
|
|
53
|
+
response = conn.delete(f"/objects('{object_id}')")
|
|
55
54
|
return response
|
|
56
55
|
|
|
57
56
|
|
|
@@ -144,7 +143,7 @@ def test_upload_search_delete_ensemble_child(token):
|
|
|
144
143
|
|
|
145
144
|
# Delete Ensemble
|
|
146
145
|
result = _delete_object(conn=sumo_client, object_id=case_id)
|
|
147
|
-
assert result == "Accepted"
|
|
146
|
+
assert result.text == "Accepted."
|
|
148
147
|
|
|
149
148
|
sleep(40)
|
|
150
149
|
|
|
@@ -210,7 +209,7 @@ def test_upload_duplicate_ensemble(token):
|
|
|
210
209
|
# Delete Ensemble
|
|
211
210
|
sleep(5)
|
|
212
211
|
result = _delete_object(conn=conn, object_id=case_id1)
|
|
213
|
-
assert result == "Accepted"
|
|
212
|
+
assert result.text == "Accepted."
|
|
214
213
|
|
|
215
214
|
# Ugly: sumo-core has a cache for case objects, which has a
|
|
216
215
|
# time-to-live of 60 seconds. If there are multiple replicas
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools-scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
TYPE_CHECKING = False
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from typing import Tuple
|
|
16
|
-
from typing import Union
|
|
17
|
-
|
|
18
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
|
-
else:
|
|
21
|
-
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
|
-
|
|
24
|
-
version: str
|
|
25
|
-
__version__: str
|
|
26
|
-
__version_tuple__: VERSION_TUPLE
|
|
27
|
-
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
|
-
|
|
31
|
-
__version__ = version = '1.5.0'
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 5, 0)
|
|
33
|
-
|
|
34
|
-
__commit_id__ = commit_id = 'g2790997c5'
|
|
File without changes
|
|
File without changes
|
{sumo_wrapper_python-1.5.0 → sumo_wrapper_python-1.6.1}/.github/workflows/publish_release.yml
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|