locust-cloud 1.15.2__py3-none-any.whl → 1.16.0__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.
locust_cloud/args.py CHANGED
@@ -70,7 +70,7 @@ def transfer_encode(file_name: str, stream: IO[bytes]) -> dict[str, str]:
70
70
  def transfer_encoded_file(file_path: str) -> dict[str, str]:
71
71
  try:
72
72
  with open(file_path, "rb") as f:
73
- return transfer_encode(file_path, f)
73
+ return transfer_encode(os.path.basename(file_path), f)
74
74
  except FileNotFoundError:
75
75
  raise ArgumentTypeError(f"File not found: {file_path}")
76
76
 
locust_cloud/cloud.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
  import os
3
3
  import sys
4
+ import time
4
5
  import webbrowser
5
6
  from threading import Thread
6
7
 
@@ -91,11 +92,24 @@ def main() -> None:
91
92
  if options.extra_files:
92
93
  payload["extra_files"] = options.extra_files
93
94
 
94
- try:
95
- response = session.post("/deploy", json=payload)
96
- js = response.json()
97
- except requests.exceptions.RequestException as e:
98
- logger.error(f"Failed to deploy the load generators: {e}")
95
+ for attempt in range(1, 16):
96
+ try:
97
+ response = session.post("/deploy", json=payload)
98
+ js = response.json()
99
+
100
+ if response.status_code != 202:
101
+ # 202 means the stack is currently terminating, so we retry
102
+ break
103
+
104
+ if attempt == 1:
105
+ logger.info(js["message"])
106
+
107
+ time.sleep(2)
108
+ except requests.exceptions.RequestException as e:
109
+ logger.error(f"Failed to deploy the load generators: {e}")
110
+ sys.exit(1)
111
+ else:
112
+ logger.error("Your Locust instance is still running, run locust-cloud --delete")
99
113
  sys.exit(1)
100
114
 
101
115
  if response.status_code != 200:
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust-cloud
3
- Version: 1.15.2
3
+ Version: 1.16.0
4
4
  Summary: Locust Cloud
5
5
  Project-URL: Homepage, https://locust.cloud
6
6
  Requires-Python: >=3.11
7
7
  Requires-Dist: configargparse==1.7
8
+ Requires-Dist: gevent>=24.11.1
8
9
  Requires-Dist: platformdirs>=4.3.6
9
10
  Requires-Dist: pyjwt>=2.0
10
11
  Requires-Dist: python-socketio[client]==5.11.4
@@ -1,11 +1,11 @@
1
1
  locust_cloud/apisession.py,sha256=AoU0FGQbyH2qbaTmdyoIMBd_lwZimLtihK0gnpAV6c0,4091
2
- locust_cloud/args.py,sha256=1SaMQ16f_3vaNqnAbjFiBL-6ietp1-qfV2LUjBk6b8k,7100
3
- locust_cloud/cloud.py,sha256=OaUE0bnlRGgLTKhdDCMnonaT-h2pop_cAfcOFOLcwng,5581
2
+ locust_cloud/args.py,sha256=4U_bZaEH1UJR8C7_bH_sX1DRB8m6WBcJh-ewhilFQX0,7118
3
+ locust_cloud/cloud.py,sha256=3sTw5FSLZBtZkdzHj9VisbAUe_jmQH7yOR7oytFEO-M,6052
4
4
  locust_cloud/common.py,sha256=cFrDVKpi9OEmH6giOuj9HoIUFSBArixNtNHzZIgDvPE,992
5
5
  locust_cloud/input_events.py,sha256=MyxccgboHByICuK6VpQCCJhZQqTZAacNmkSpw-gxBEw,3420
6
6
  locust_cloud/web_login.py,sha256=1j2AQoEM6XVSDtE1q0Ryrs4jFEx07r9IQfZCoFAQXJg,2400
7
7
  locust_cloud/websocket.py,sha256=9Q7nTFuAwVhgW74DlJNcHTZXOQ1drsXi8hX9ciZhWlQ,8998
8
- locust_cloud-1.15.2.dist-info/METADATA,sha256=a79gziKM22Yf8cyno1E0GHw2PUPhyj6vDYxA7RoJqkE,497
9
- locust_cloud-1.15.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- locust_cloud-1.15.2.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
11
- locust_cloud-1.15.2.dist-info/RECORD,,
8
+ locust_cloud-1.16.0.dist-info/METADATA,sha256=ZKDDbnD72lqnGEgZ-89MfsSJbSvApn_VH2Co7DpX2Yk,528
9
+ locust_cloud-1.16.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ locust_cloud-1.16.0.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
11
+ locust_cloud-1.16.0.dist-info/RECORD,,