cpg-utils 5.0.0__tar.gz → 5.0.2__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.
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/PKG-INFO +1 -1
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/constants.py +1 -1
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/cromwell_model.py +8 -8
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils.egg-info/PKG-INFO +1 -1
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/setup.py +13 -5
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/test/test_cromwell.py +42 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/LICENSE +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/README.md +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/__init__.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/cloud.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/cloudpath_hail_az.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/config.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/cromwell.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/dataproc.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/git.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/hail_batch.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/membership.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/py.typed +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils/slack.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils.egg-info/SOURCES.txt +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils.egg-info/dependency_links.txt +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils.egg-info/requires.txt +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/cpg_utils.egg-info/top_level.txt +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/pyproject.toml +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/setup.cfg +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/test/__init__.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/test/test_config.py +0 -0
- {cpg-utils-5.0.0 → cpg-utils-5.0.2}/test/test_doctests.py +0 -0
|
@@ -21,7 +21,7 @@ CROMWELL_AUDIENCE = os.getenv('CROMWELL_AUDIENCE', DEFAULT_CROMWELL_AUDIENCE)
|
|
|
21
21
|
CROMWELL_URL = os.getenv('CROMWELL_URL', DEFAULT_CROMWELL_URL)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class AnsiColors:
|
|
25
25
|
"""
|
|
26
26
|
Lookup table: https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit
|
|
27
27
|
"""
|
|
@@ -7,7 +7,7 @@ import datetime
|
|
|
7
7
|
|
|
8
8
|
from tabulate import tabulate
|
|
9
9
|
|
|
10
|
-
from cpg_utils.constants import
|
|
10
|
+
from cpg_utils.constants import AnsiColors
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class ExecutionStatus(Enum):
|
|
@@ -41,17 +41,17 @@ class ExecutionStatus(Enum):
|
|
|
41
41
|
@property
|
|
42
42
|
def _colors(self):
|
|
43
43
|
return {
|
|
44
|
-
ExecutionStatus.done:
|
|
45
|
-
ExecutionStatus.succeeded:
|
|
46
|
-
ExecutionStatus.failed:
|
|
47
|
-
ExecutionStatus.retryablefailure:
|
|
44
|
+
ExecutionStatus.done: AnsiColors.BRIGHTGREEN,
|
|
45
|
+
ExecutionStatus.succeeded: AnsiColors.BRIGHTGREEN,
|
|
46
|
+
ExecutionStatus.failed: AnsiColors.BRIGHTRED,
|
|
47
|
+
ExecutionStatus.retryablefailure: AnsiColors.BRIGHTBLUE,
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
def symbol(self):
|
|
51
51
|
return self._symbols.get(self, '?')
|
|
52
52
|
|
|
53
53
|
def color(self):
|
|
54
|
-
return self._colors.get(self,
|
|
54
|
+
return self._colors.get(self, AnsiColors.RESET)
|
|
55
55
|
|
|
56
56
|
def is_finished(self):
|
|
57
57
|
_finished_states = {
|
|
@@ -296,7 +296,7 @@ class CallMetadata:
|
|
|
296
296
|
color, rcol = '', ''
|
|
297
297
|
if not monochrome:
|
|
298
298
|
color = self.executionStatus.color() if self.executionStatus else ''
|
|
299
|
-
rcol =
|
|
299
|
+
rcol = AnsiColors.RESET
|
|
300
300
|
|
|
301
301
|
extras_str = "".join("\n" + indent(e, ' ') for e in extras)
|
|
302
302
|
return f'{color}[{symbol}] {name} ({duration_str}){extras_str}{rcol}'
|
|
@@ -329,7 +329,7 @@ def prepare_inner_calls_string(
|
|
|
329
329
|
color, rcol = '', ''
|
|
330
330
|
if not monochrome:
|
|
331
331
|
color = collapsed_status.color() if collapsed_status else ''
|
|
332
|
-
rcol =
|
|
332
|
+
rcol = AnsiColors.RESET
|
|
333
333
|
inner_calls = ''
|
|
334
334
|
|
|
335
335
|
if len(calls) > 1 and not expand_completed:
|
|
@@ -5,13 +5,10 @@ from setuptools import find_packages, setup
|
|
|
5
5
|
with open('README.md') as f:
|
|
6
6
|
long_description = f.read()
|
|
7
7
|
|
|
8
|
-
with open('requirements.txt') as f:
|
|
9
|
-
requirements = f.read().splitlines()
|
|
10
|
-
|
|
11
8
|
setup(
|
|
12
9
|
name='cpg-utils',
|
|
13
10
|
# This tag is automatically updated by bumpversion
|
|
14
|
-
version='5.0.
|
|
11
|
+
version='5.0.2',
|
|
15
12
|
description='Library of convenience functions specific to the CPG',
|
|
16
13
|
long_description=long_description,
|
|
17
14
|
long_description_content_type='text/markdown',
|
|
@@ -21,7 +18,18 @@ setup(
|
|
|
21
18
|
package_data={
|
|
22
19
|
'cpg_utils': ['py.typed'],
|
|
23
20
|
},
|
|
24
|
-
install_requires=
|
|
21
|
+
install_requires=[
|
|
22
|
+
'boto3==1.28.56',
|
|
23
|
+
'botocore==1.31.56',
|
|
24
|
+
'cloudpathlib[all]',
|
|
25
|
+
'frozendict',
|
|
26
|
+
'google-auth>=1.27.0',
|
|
27
|
+
'google-cloud-secret-manager',
|
|
28
|
+
'requests',
|
|
29
|
+
'tabulate',
|
|
30
|
+
'toml',
|
|
31
|
+
'deprecated',
|
|
32
|
+
],
|
|
25
33
|
keywords='bioinformatics',
|
|
26
34
|
classifiers=[
|
|
27
35
|
'Environment :: Console',
|
|
@@ -3,6 +3,7 @@ import unittest
|
|
|
3
3
|
from unittest.mock import MagicMock, patch
|
|
4
4
|
|
|
5
5
|
from cpg_utils.cromwell import run_cromwell_workflow
|
|
6
|
+
from cpg_utils.cromwell_model import WorkflowMetadataModel
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class TestCromwellWrapper(unittest.TestCase):
|
|
@@ -86,3 +87,44 @@ class TestCromwellWrapper(unittest.TestCase):
|
|
|
86
87
|
wf_options['final_workflow_outputs_dir'],
|
|
87
88
|
'test://default-bucket/output-prefix',
|
|
88
89
|
)
|
|
90
|
+
|
|
91
|
+
def test_cromwell_status_format(self):
|
|
92
|
+
"""
|
|
93
|
+
Check parsing some basic cromwell metadata, and formatting it for display
|
|
94
|
+
"""
|
|
95
|
+
model = WorkflowMetadataModel.parse(
|
|
96
|
+
{
|
|
97
|
+
'id': '<mocked-id>',
|
|
98
|
+
'submission': '2021-07-09T09:46:00.000Z',
|
|
99
|
+
'start': '2021-07-09T09:47:00.000Z',
|
|
100
|
+
'end': '2021-07-09T09:48:00.000Z',
|
|
101
|
+
'calls': {
|
|
102
|
+
'wf.print': [
|
|
103
|
+
{
|
|
104
|
+
'name': 'print',
|
|
105
|
+
'executionStatus': 'succeeded',
|
|
106
|
+
'start': '2021-07-09T09:47:00.000Z',
|
|
107
|
+
'end': '2021-07-09T09:48:00.000Z',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
)
|
|
113
|
+
resp = model.display(expand_completed=True, monochrome=True)
|
|
114
|
+
|
|
115
|
+
status_str = """
|
|
116
|
+
----------- ------------------------
|
|
117
|
+
Workflow ID <mocked-id>
|
|
118
|
+
Name
|
|
119
|
+
Status preparing
|
|
120
|
+
Submitted 2021-07-09T09:46:00.000Z
|
|
121
|
+
Start 2021-07-09T09:47:00.000Z
|
|
122
|
+
End 2021-07-09T09:48:00.000Z
|
|
123
|
+
Duration 1m:0s
|
|
124
|
+
Walltime 2m:0s
|
|
125
|
+
----------- ------------------------
|
|
126
|
+
Jobs:
|
|
127
|
+
[#] print (1m:0s)
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
self.assertEqual(status_str.strip(), resp.strip())
|
|
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
|