cpg-utils 5.0.1__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.
Files changed (28) hide show
  1. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/PKG-INFO +1 -1
  2. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/constants.py +1 -1
  3. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/cromwell_model.py +8 -8
  4. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils.egg-info/PKG-INFO +1 -1
  5. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/setup.py +1 -1
  6. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/test/test_cromwell.py +42 -0
  7. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/LICENSE +0 -0
  8. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/README.md +0 -0
  9. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/__init__.py +0 -0
  10. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/cloud.py +0 -0
  11. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/cloudpath_hail_az.py +0 -0
  12. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/config.py +0 -0
  13. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/cromwell.py +0 -0
  14. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/dataproc.py +0 -0
  15. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/git.py +0 -0
  16. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/hail_batch.py +0 -0
  17. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/membership.py +0 -0
  18. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/py.typed +0 -0
  19. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils/slack.py +0 -0
  20. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils.egg-info/SOURCES.txt +0 -0
  21. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils.egg-info/dependency_links.txt +0 -0
  22. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils.egg-info/requires.txt +0 -0
  23. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/cpg_utils.egg-info/top_level.txt +0 -0
  24. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/pyproject.toml +0 -0
  25. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/setup.cfg +0 -0
  26. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/test/__init__.py +0 -0
  27. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/test/test_config.py +0 -0
  28. {cpg-utils-5.0.1 → cpg-utils-5.0.2}/test/test_doctests.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cpg-utils
3
- Version: 5.0.1
3
+ Version: 5.0.2
4
4
  Summary: Library of convenience functions specific to the CPG
5
5
  Home-page: https://github.com/populationgenomics/cpg-utils
6
6
  License: MIT
@@ -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 AnsiiColors:
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 AnsiiColors
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: AnsiiColors.BRIGHTGREEN,
45
- ExecutionStatus.succeeded: AnsiiColors.BRIGHTGREEN,
46
- ExecutionStatus.failed: AnsiiColors.BRIGHTRED,
47
- ExecutionStatus.retryablefailure: AnsiiColors.BRIGHTBLUE,
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, AnsiiColors.RESET)
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 = AnsiiColors.RESET
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 = AnsiiColors.RESET
332
+ rcol = AnsiColors.RESET
333
333
  inner_calls = ''
334
334
 
335
335
  if len(calls) > 1 and not expand_completed:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cpg-utils
3
- Version: 5.0.1
3
+ Version: 5.0.2
4
4
  Summary: Library of convenience functions specific to the CPG
5
5
  Home-page: https://github.com/populationgenomics/cpg-utils
6
6
  License: MIT
@@ -8,7 +8,7 @@ with open('README.md') as f:
8
8
  setup(
9
9
  name='cpg-utils',
10
10
  # This tag is automatically updated by bumpversion
11
- version='5.0.1',
11
+ version='5.0.2',
12
12
  description='Library of convenience functions specific to the CPG',
13
13
  long_description=long_description,
14
14
  long_description_content_type='text/markdown',
@@ -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