opentf-toolkit-nightly 0.57.0.dev1106__py3-none-any.whl → 0.57.0.dev1114__py3-none-any.whl

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.
@@ -16,8 +16,8 @@
16
16
 
17
17
  from typing import Any, Dict, List, NoReturn, Optional, Tuple, Union
18
18
 
19
- import itertools
20
19
  import logging
20
+ import os
21
21
  import sys
22
22
 
23
23
  from functools import wraps
@@ -289,7 +289,7 @@ def authorizer(resource: str, verb: str):
289
289
  if not payload:
290
290
  return make_status_response('Unauthorized', 'No JWT payload.')
291
291
  user = payload['sub']
292
- if not 'namespaces' in g and not is_user_authorized(
292
+ if 'namespaces' not in g and not is_user_authorized(
293
293
  user, resource, verb, current_app.config['CONTEXT']
294
294
  ):
295
295
  return make_status_response(
@@ -568,7 +568,13 @@ def run_app(app: Flask) -> None:
568
568
  app.logger.info(f'Serving on http://{context["host"]}:{context["port"]}')
569
569
  _app = app
570
570
 
571
- serve(_app, host=context['host'], port=context['port'], server_name=app.name)
571
+ serve(
572
+ _app,
573
+ host=context['host'],
574
+ port=context['port'],
575
+ server_name=app.name,
576
+ threads=get_context_parameter(app, 'waitress_threads_count', default=4),
577
+ )
572
578
 
573
579
 
574
580
  ########################################################################
@@ -715,15 +721,14 @@ def validate_pipeline(
715
721
  """
716
722
  try:
717
723
  jobs = {}
718
- for job in workflow['jobs']:
719
- needs = workflow['jobs'][job].get('needs')
720
- if needs:
724
+ for job_name, job_definition in workflow['jobs'].items():
725
+ if needs := job_definition.get('needs'):
721
726
  if isinstance(needs, list):
722
- jobs[job] = set(needs)
727
+ jobs[job_name] = set(needs)
723
728
  else:
724
- jobs[job] = {needs}
729
+ jobs[job_name] = {needs}
725
730
  else:
726
- jobs[job] = set()
731
+ jobs[job_name] = set()
727
732
  for src, dependencies in jobs.items():
728
733
  for dep in dependencies:
729
734
  if dep not in jobs:
@@ -735,20 +740,3 @@ def validate_pipeline(
735
740
  return True, [list(items) for items in toposort(jobs)]
736
741
  except CircularDependencyError as err:
737
742
  return False, str(err)
738
-
739
-
740
- def get_execution_sequence(workflow: Dict[str, Any]) -> Optional[List[str]]:
741
- """Return an execution sequence for jobs.
742
-
743
- # Required parameters
744
-
745
- - workflow: a dictionary
746
-
747
- # Returned value
748
-
749
- `None` or a list of jobs names.
750
- """
751
- ok, result = validate_pipeline(workflow)
752
- if ok:
753
- return list(itertools.chain.from_iterable(result))
754
- return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.57.0.dev1106
3
+ Version: 0.57.0.dev1114
4
4
  Summary: OpenTestFactory Orchestrator Toolkit
5
5
  Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
6
6
  Author: Martin Lafaix
@@ -1,4 +1,4 @@
1
- opentf/commons/__init__.py,sha256=3gZyXpN2Dmpkn-MRE_Ns1kYHiGyQfXQ8YF25fErVXwE,22728
1
+ opentf/commons/__init__.py,sha256=AnnUMqwHwYnZxMhGdAwFGNbKIcr4HNVRUEfUuB2ub-c,22481
2
2
  opentf/commons/auth.py,sha256=bM2Z3kxm2Wku1lKXaRAIg37LHvXWAXIZIqjplDfN2P8,15899
3
3
  opentf/commons/config.py,sha256=dyus4K5Zdmcftc3Y9Z1YRkzA1KwiRLHoeAlg2_A49QM,7876
4
4
  opentf/commons/datasources.py,sha256=lIQf81riLHWYj1bG0Mxez7rf9cxSL50NVOf2bmKkWT4,26032
@@ -55,8 +55,8 @@ opentf/scripts/startup.py,sha256=Da2zo93pBWbdRmj-wgekgLcF94rpNc3ZkbvR8R0w8XY,212
55
55
  opentf/toolkit/__init__.py,sha256=nbllYXON3Rzd-hU7Cred7r4hPaCPbfSJmoY7cQ6RShc,22589
56
56
  opentf/toolkit/channels.py,sha256=6xcVKHUK2FdyVKIQmPQbakngfVuQDzCcD_lInOdKpro,17171
57
57
  opentf/toolkit/core.py,sha256=6nud1vqcfjs9swZu_Z-rbvdbejtrlSjOd8eZXIF0ChE,9795
58
- opentf_toolkit_nightly-0.57.0.dev1106.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
59
- opentf_toolkit_nightly-0.57.0.dev1106.dist-info/METADATA,sha256=cvfIn7vsCaFTCwbtH9WAQY6LzB5b9B_2p0bRoTEdEmA,1946
60
- opentf_toolkit_nightly-0.57.0.dev1106.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
61
- opentf_toolkit_nightly-0.57.0.dev1106.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
62
- opentf_toolkit_nightly-0.57.0.dev1106.dist-info/RECORD,,
58
+ opentf_toolkit_nightly-0.57.0.dev1114.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
59
+ opentf_toolkit_nightly-0.57.0.dev1114.dist-info/METADATA,sha256=YK4Vicw6_wpIItsKKHLygjI4NBy52sEcmXccAskl9ck,1946
60
+ opentf_toolkit_nightly-0.57.0.dev1114.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
61
+ opentf_toolkit_nightly-0.57.0.dev1114.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
62
+ opentf_toolkit_nightly-0.57.0.dev1114.dist-info/RECORD,,