autoverse-cli 0.26.0__tar.gz → 0.28.0__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 (56) hide show
  1. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/PKG-INFO +1 -1
  2. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/pyproject.toml +2 -2
  3. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/PKG-INFO +1 -1
  4. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/app_version.py +2 -2
  5. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/launcher.py +40 -15
  6. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/launcher_util.py +18 -8
  7. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/simconfig_util.py +1 -1
  8. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/LICENSE +0 -0
  9. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/README.md +0 -0
  10. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/setup.cfg +0 -0
  11. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/SOURCES.txt +0 -0
  12. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/dependency_links.txt +0 -0
  13. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/entry_points.txt +0 -0
  14. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/requires.txt +0 -0
  15. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/autoverse_cli.egg-info/top_level.txt +0 -0
  16. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/__init__.py +0 -0
  17. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/argparse_help.py +0 -0
  18. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/avrs.py +0 -0
  19. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/can_tool.py +0 -0
  20. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/can_tool_util.py +0 -0
  21. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/cfg.py +0 -0
  22. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/race_cloud.py +0 -0
  23. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/race_cloud_bridge_can.py +0 -0
  24. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/race_cloud_cfg_util.py +0 -0
  25. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/race_cloud_fwd_api.py +0 -0
  26. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/race_cloud_util.py +0 -0
  27. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/change_camera.py +0 -0
  28. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/code_booz.py +0 -0
  29. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/demo.py +0 -0
  30. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/dump_sim_config.py +0 -0
  31. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/environment.py +0 -0
  32. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/fault_injection.py +0 -0
  33. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/get_object_config.py +0 -0
  34. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/get_web_viz_meta.py +0 -0
  35. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/leaderboard.py +0 -0
  36. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/list_sim_objects.py +0 -0
  37. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/log_path.py +0 -0
  38. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/misc.py +0 -0
  39. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/move_to_landmark.py +0 -0
  40. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/npc.py +0 -0
  41. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/race_control.py +0 -0
  42. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/request.py +0 -0
  43. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/reset_to_track.py +0 -0
  44. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/rest_request.py +0 -0
  45. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/restart.py +0 -0
  46. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/scenario_control.py +0 -0
  47. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/spawn_object.py +0 -0
  48. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/teleport.py +0 -0
  49. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/toggle_hud.py +0 -0
  50. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/vd.py +0 -0
  51. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/vehicle_input.py +0 -0
  52. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/requests/vehicle_replay.py +0 -0
  53. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/shell_completion.py +0 -0
  54. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/simconfig.py +0 -0
  55. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/tests.py +0 -0
  56. {autoverse_cli-0.26.0 → autoverse_cli-0.28.0}/src/avrs/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoverse-cli
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: The Autoverse CLI
5
5
  Author-email: Dan Kamrath <dan.kamrath@autonomalabs.com>
6
6
  License: # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "autoverse-cli"
3
- version = "0.26.0"
3
+ version = "0.28.0"
4
4
  dependencies = [
5
5
  "boto3",
6
6
  "cantools",
@@ -18,4 +18,4 @@ classifiers = [
18
18
  "Operating System :: OS Independent",
19
19
  ]
20
20
  [project.scripts]
21
- avrs = "avrs.avrs:main"
21
+ avrs = "avrs.avrs:main"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoverse-cli
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: The Autoverse CLI
5
5
  Author-email: Dan Kamrath <dan.kamrath@autonomalabs.com>
6
6
  License: # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI
@@ -2,7 +2,7 @@ import http.client
2
2
  import json
3
3
 
4
4
  def get_app_version():
5
- return '0.26.0'
5
+ return '0.28.0'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
@@ -21,4 +21,4 @@ def check_app_is_latest():
21
21
  # response = connection.getresponse()
22
22
  # if response.status != 200:
23
23
  # print('response had status code {}'.format(response))
24
- # print('{}'.format(response.read().decode('utf-8')))
24
+ # print('{}'.format(response.read().decode('utf-8')))
@@ -4,6 +4,8 @@ import json
4
4
  import logging
5
5
  import http.client
6
6
  import boto3
7
+ import sys
8
+ import shutil
7
9
  from avrs.cfg import *
8
10
  from avrs.launcher_util import *
9
11
 
@@ -111,23 +113,46 @@ class AvrsLauncher:
111
113
  print('Launcher Download Keys Error: {}'.format(dl_keys_status))
112
114
  return
113
115
 
114
- # special case where we want staged version
116
+ # Check if variant is valid (for backwards compatibility, we still proceed even if invalid)
117
+ variant_is_invalid = False
118
+ if args.variant not in ["staged", "feature"]:
119
+ # Ensure variants are loaded
120
+ if 'variants' not in self.cfg:
121
+ (dl_keys_ok, dl_keys_status, self.cfg) = try_get_launcher_download_keys(self.cfg)
122
+ if not dl_keys_ok:
123
+ # If we can't get variants, proceed anyway for backwards compatibility
124
+ pass
125
+ if 'variants' in self.cfg and args.variant not in self.cfg['variants']:
126
+ variant_is_invalid = True
127
+ # Write warning to stderr so it doesn't interfere with scripts parsing stdout
128
+ sys.stderr.write('Warning: "{}" is not a known variant. Available variants: {}\n'.format(
129
+ args.variant, self.cfg['variants']))
130
+
131
+ variant_to_query = "autoverse" if args.variant in ["staged", "feature"] else args.variant
132
+
133
+ # Get latest build info from API
134
+ build_info_ok, build_info_status, latest_version, staged_version, build_info = get_launcher_build_info(
135
+ self.cfg, variant_to_query)
136
+ if not build_info_ok:
137
+ print('Error Getting Latest Version Info: {}'.format(build_info_status))
138
+ return
139
+
115
140
  if args.variant == "staged":
116
- # Get latest build info from API
117
- build_info_ok, build_info_status, latest_version, staged_version = get_launcher_build_info(
118
- self.cfg, "autoverse")
119
- if not build_info_ok:
120
- print('Error Getting Latest Version Info: {}'.format(build_info_status))
121
- return
122
141
  print('{}'.format(staged_version))
142
+ elif args.variant == "feature":
143
+ feature_info = build_info.get('feature', {})
144
+ if isinstance(feature_info, str):
145
+ try:
146
+ feature_info = json.loads(feature_info)
147
+ except json.JSONDecodeError:
148
+ pass
149
+ print('{}'.format(json.dumps(feature_info)))
123
150
  else:
124
- # Get latest build info from API
125
- build_info_ok, build_info_status, latest_version, staged_version = get_launcher_build_info(
126
- self.cfg, args.variant)
127
- if not build_info_ok:
128
- print('Error Getting Latest Version Info: {}'.format(build_info_status))
129
- return
130
151
  print('{}'.format(latest_version))
152
+ if variant_is_invalid:
153
+ # Explain that the output is the default/prod variant version, not the requested variant
154
+ sys.stderr.write('Note: The version shown above is the production version of the default variant, not "{}"\n'.format(
155
+ args.variant))
131
156
 
132
157
  def download_simulator(self, args):
133
158
 
@@ -152,7 +177,7 @@ class AvrsLauncher:
152
177
  return
153
178
 
154
179
  # Get latest build info from API
155
- build_info_ok, build_info_status, latest_version, staged_version = get_launcher_build_info(
180
+ build_info_ok, build_info_status, latest_version, staged_version, _build_info = get_launcher_build_info(
156
181
  self.cfg, args.variant)
157
182
  if not build_info_ok:
158
183
  print('Error Getting Latest Version Info: {}'.format(build_info_status))
@@ -226,4 +251,4 @@ If you are sure, re-run with the --update-existing flag
226
251
  os.chmod(autoverse_exe, st.st_mode | stat.S_IEXEC)
227
252
 
228
253
  print('Cleaning up')
229
- os.remove(dl_path)
254
+ os.remove(dl_path)
@@ -121,7 +121,7 @@ def get_launcher_license_status_string(cfg):
121
121
 
122
122
  def get_launcher_build_info(cfg, variant):
123
123
  """
124
- Contacts API to discover the current latest build version
124
+ Contacts API to discover the current latest build version and returns full build info
125
125
  """
126
126
 
127
127
  api_url = 'zn5boqqk60.execute-api.us-east-1.amazonaws.com'
@@ -134,17 +134,24 @@ def get_launcher_build_info(cfg, variant):
134
134
  response = connection.getresponse()
135
135
 
136
136
  if response.status != 200:
137
- return (False, "get build info api returned {}".format(response.status), "", "")
137
+ return (False, "get build info api returned {}".format(response.status), "", "", {})
138
138
 
139
139
  res_full = json.loads(response.read().decode('utf-8'))
140
- info = json.loads(res_full['body'])
141
- code = res_full['statusCode']
140
+ raw_body = res_full.get('body', "{}")
141
+ info = json.loads(raw_body) if isinstance(raw_body, str) else raw_body
142
+ if not isinstance(info, dict):
143
+ return (False, "get build info api returned unexpected format", "", "", {})
144
+
145
+ code = res_full.get('statusCode')
142
146
  if code != 200:
143
- return (False, "get build info api returned {}".format(code), "", "")
147
+ return (False, "get build info api returned {}".format(code), "", "", info)
148
+
149
+ latest_version = info.get('prod', '')
150
+ if latest_version == '':
151
+ return (False, "get build info api response missing prod", "", "", info)
144
152
 
145
- latest_version = info['prod']
146
153
  staged_version = info.get('staging', latest_version)
147
- return (True, "ok", latest_version, staged_version)
154
+ return (True, "ok", latest_version, staged_version, info)
148
155
 
149
156
  def download_simulator_archive(cfg, source_path, target_path):
150
157
  """
@@ -184,7 +191,10 @@ def s3_download_with_progress(s3_client, s3_bucket, s3_object_key, local_file_pa
184
191
  def progress(chunk):
185
192
  nonlocal downloaded
186
193
  downloaded += chunk
187
- done = int(50 * downloaded / total_length)
194
+ if total_length > 0:
195
+ done = int(50 * downloaded / total_length)
196
+ else:
197
+ done = 0
188
198
  sys.stdout.write("\r[%s%s]" % ('=' * done, ' ' * (50-done)) )
189
199
  sys.stdout.flush()
190
200
 
@@ -130,7 +130,7 @@ def compare_dicts(a, b, parent_key, out_checks):
130
130
 
131
131
  def apply_simconfig_preset(sim_saved_dir, preset_name):
132
132
  cfg_files = SimConfigFiles(sim_saved_dir)
133
- ok, status = cfg_files.valdiate()
133
+ ok, status = cfg_files.validate()
134
134
  if not ok:
135
135
  print(status)
136
136
  return
File without changes
File without changes
File without changes