nextmv 0.28.2__tar.gz → 0.28.3.dev1__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 (61) hide show
  1. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/PKG-INFO +1 -1
  2. nextmv-0.28.3.dev1/nextmv/__about__.py +1 -0
  3. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/application.py +19 -6
  4. nextmv-0.28.2/nextmv/__about__.py +0 -1
  5. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/.gitignore +0 -0
  6. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/LICENSE +0 -0
  7. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/README.md +0 -0
  8. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/__entrypoint__.py +0 -0
  9. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/__init__.py +0 -0
  10. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/base_model.py +0 -0
  11. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/__init__.py +0 -0
  12. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/acceptance_test.py +0 -0
  13. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/account.py +0 -0
  14. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/batch_experiment.py +0 -0
  15. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/client.py +0 -0
  16. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/input_set.py +0 -0
  17. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/instance.py +0 -0
  18. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/manifest.py +0 -0
  19. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/package.py +0 -0
  20. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/run.py +0 -0
  21. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/safe.py +0 -0
  22. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/scenario.py +0 -0
  23. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/secrets.py +0 -0
  24. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/status.py +0 -0
  25. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/cloud/version.py +0 -0
  26. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/deprecated.py +0 -0
  27. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/input.py +0 -0
  28. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/logger.py +0 -0
  29. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/model.py +0 -0
  30. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/options.py +0 -0
  31. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/nextmv/output.py +0 -0
  32. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/pyproject.toml +0 -0
  33. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/requirements.txt +0 -0
  34. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/__init__.py +0 -0
  35. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/__init__.py +0 -0
  36. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/app.yaml +0 -0
  37. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_application.py +0 -0
  38. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_client.py +0 -0
  39. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_manifest.py +0 -0
  40. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_package.py +0 -0
  41. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_run.py +0 -0
  42. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_safe_name_id.py +0 -0
  43. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/cloud/test_scenario.py +0 -0
  44. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/__init__.py +0 -0
  45. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options1.py +0 -0
  46. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options2.py +0 -0
  47. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options3.py +0 -0
  48. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options4.py +0 -0
  49. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options5.py +0 -0
  50. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options6.py +0 -0
  51. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options7.py +0 -0
  52. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/scripts/options_deprecated.py +0 -0
  53. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_base_model.py +0 -0
  54. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_entrypoint/__init__.py +0 -0
  55. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_entrypoint/test_entrypoint.py +0 -0
  56. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_input.py +0 -0
  57. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_logger.py +0 -0
  58. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_model.py +0 -0
  59. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_options.py +0 -0
  60. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_output.py +0 -0
  61. {nextmv-0.28.2 → nextmv-0.28.3.dev1}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextmv
3
- Version: 0.28.2
3
+ Version: 0.28.3.dev1
4
4
  Summary: The all-purpose Python SDK for Nextmv
5
5
  Project-URL: Homepage, https://www.nextmv.io
6
6
  Project-URL: Documentation, https://www.nextmv.io/docs/python-sdks/nextmv/installation
@@ -0,0 +1 @@
1
+ __version__ = "v0.28.3.dev1"
@@ -3174,7 +3174,7 @@ class Application:
3174
3174
  raise ValueError(f"Unknown scenario input type: {scenario.scenario_input.scenario_input_type}")
3175
3175
 
3176
3176
 
3177
- def poll(polling_options: PollingOptions, polling_func: Callable[[], tuple[Any, bool]]) -> Any:
3177
+ def poll(polling_options: PollingOptions, polling_func: Callable[[], tuple[Any, bool]]) -> Any: # noqa: C901
3178
3178
  """
3179
3179
  Poll a function until it succeeds or the polling strategy is exhausted.
3180
3180
 
@@ -3253,6 +3253,7 @@ def poll(polling_options: PollingOptions, polling_func: Callable[[], tuple[Any,
3253
3253
  stopped = False
3254
3254
 
3255
3255
  # Begin the polling process.
3256
+ max_reached = False
3256
3257
  for ix in range(polling_options.max_tries):
3257
3258
  # Check is we should stop polling according to the stop callback.
3258
3259
  if polling_options.stop is not None and polling_options.stop():
@@ -3279,12 +3280,24 @@ def poll(polling_options: PollingOptions, polling_func: Callable[[], tuple[Any,
3279
3280
  )
3280
3281
 
3281
3282
  # Calculate the delay.
3282
- delay = polling_options.delay # Base
3283
- delay += polling_options.backoff * (2**ix) # Add exponential backoff.
3284
- delay += random.uniform(0, polling_options.jitter) # Add jitter.
3283
+ delay = 0.0
3284
+ if max_reached:
3285
+ # If we already reached the maximum, we don't want to further calculate the
3286
+ # delay to avoid overflows.
3287
+ delay = polling_options.max_delay
3288
+ delay += random.uniform(0, polling_options.jitter) # Add jitter.
3289
+ else:
3290
+ delay = polling_options.delay # Base
3291
+ delay += polling_options.backoff * (2**ix) # Add exponential backoff.
3292
+ delay += random.uniform(0, polling_options.jitter) # Add jitter.
3293
+
3294
+ # We cannot exceed the max delay.
3295
+ if delay >= polling_options.max_delay:
3296
+ max_reached = True
3297
+ delay = polling_options.max_delay
3285
3298
 
3286
- # Sleep for the calculated delay. We cannot exceed the max delay.
3287
- sleep_duration = min(delay, polling_options.max_delay)
3299
+ # Sleep for the calculated delay.
3300
+ sleep_duration = delay
3288
3301
  if polling_options.verbose:
3289
3302
  log(f"polling | sleeping for duration: {sleep_duration}")
3290
3303
 
@@ -1 +0,0 @@
1
- __version__ = "v0.28.2"
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