primitive 0.1.57__py3-none-any.whl → 0.1.58__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.
primitive/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@primitive.tech>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.1.57"
4
+ __version__ = "0.1.58"
@@ -119,18 +119,23 @@ class Agent(BaseAction):
119
119
  job_run["jobSettings"]["rootDirectory"]
120
120
  )
121
121
 
122
- runner = AgentRunner(
123
- primitive=self.primitive,
124
- source_dir=source_dir,
125
- job_id=job_run["id"],
126
- job_slug=job_run["job"]["slug"],
127
- )
128
-
129
- # Execute job
130
- runner.execute()
131
-
132
- # Clean up
133
- shutil.rmtree(path=downloaded_git_repository_dir)
122
+ try:
123
+ # Initialize Runner
124
+ runner = AgentRunner(
125
+ primitive=self.primitive,
126
+ source_dir=source_dir,
127
+ job_id=job_run["id"],
128
+ job_slug=job_run["job"]["slug"],
129
+ )
130
+ except Exception as e:
131
+ # Log Error
132
+ logger.error(f"Error initializing agent runner: {e}")
133
+ else:
134
+ # Execute job
135
+ runner.execute()
136
+ finally:
137
+ # Clean up
138
+ shutil.rmtree(path=downloaded_git_repository_dir)
134
139
 
135
140
  sleep(5)
136
141
  except KeyboardInterrupt:
primitive/agent/runner.py CHANGED
@@ -1,5 +1,4 @@
1
1
  import yaml
2
- import sys
3
2
  import typing
4
3
  import os
5
4
  import threading
@@ -72,7 +71,8 @@ class AgentRunner:
72
71
  logger.error(
73
72
  f"Found two job descriptions with the same slug: {self.job_slug}"
74
73
  )
75
- sys.exit(1)
74
+ self.conclude(conclusion="failure")
75
+ raise FileExistsError
76
76
 
77
77
  if yaml_file.exists():
78
78
  self.job = yaml.load(open(yaml_file, "r"), Loader=Loader)
@@ -82,7 +82,8 @@ class AgentRunner:
82
82
  logger.error(
83
83
  f"No job description with matching slug '{self.job_slug}' found"
84
84
  )
85
- sys.exit(1)
85
+ self.conclude(conclusion="failure")
86
+ raise FileNotFoundError
86
87
 
87
88
  logger.info(f"Found job description for {self.job_slug}")
88
89
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: primitive
3
- Version: 0.1.57
3
+ Version: 0.1.58
4
4
  Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
5
5
  Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
6
6
  Project-URL: Source, https://github.com//primitivecorp/primitive-cli
@@ -1,12 +1,12 @@
1
- primitive/__about__.py,sha256=LQN9vk9uq3Gl6JCwiPoXCjz8HPrZ4CCKTZ5dYftcQMw,130
1
+ primitive/__about__.py,sha256=S0YUSrE8kYLnnrDEf3Zg8iyjiV8CQb2jsfZ4uoquTtc,130
2
2
  primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
3
3
  primitive/cli.py,sha256=VQPSewC6ouGdEG9W1gllawGJTydpOY0Lzg7LURXcqQg,2374
4
4
  primitive/client.py,sha256=vSJkifx450czuLvu0f2o-viSCC0p2f1UicA-2P5cJAw,2188
5
- primitive/agent/actions.py,sha256=m1FGvtOHdrZRP-YC31bFoUj-ZunXlFFW4NnPH9Bpzc0,5499
5
+ primitive/agent/actions.py,sha256=BnGHzh63R4ST_EqEB_hYEOzVwbzEaGKOZTaZo0vb6Vg,5818
6
6
  primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
7
7
  primitive/agent/process.py,sha256=2ZY3YoJHvoukrsCAZIt-AF2YKY4HEO5_jWji5K3W9fM,2267
8
8
  primitive/agent/provision.py,sha256=3EEzOV-ria6zf-pvfNddad1lzzd1QmfKInTIjmwX71Y,1673
9
- primitive/agent/runner.py,sha256=6hbDjww7L0mZv_Ag_BJ2Q9QU5Ihyi0935PpUYoYiqJM,6769
9
+ primitive/agent/runner.py,sha256=wkvXjXxD7dg0XeZIvatpI12RSifYzRYUIL9NX42oRus,6876
10
10
  primitive/agent/uploader.py,sha256=5ZxonvRlMGRVBYx3hPEaWiPio5lMPi_zhtxz64V5S-A,2379
11
11
  primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  primitive/auth/actions.py,sha256=2vZEC3LLAXj6eBBmt_2OEDEcBIb3uLkkNjgbZTIaQsY,1095
@@ -46,8 +46,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
46
46
  primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
47
47
  primitive/utils/shell.py,sha256=-7UjQaBqSGHzEEyX8pNjeYFFP0P3lVnDV0OkgPz1qHU,1050
48
48
  primitive/utils/verible.py,sha256=r7c_hfqvL0UicMmIzK3Cy_BfZI1ZpcfBeLqKEWFWqJo,2252
49
- primitive-0.1.57.dist-info/METADATA,sha256=j82RnR6qXihnzfjwwweYOx_TwtLapLCOQpAkqqaWeuU,3782
50
- primitive-0.1.57.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
51
- primitive-0.1.57.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
52
- primitive-0.1.57.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
53
- primitive-0.1.57.dist-info/RECORD,,
49
+ primitive-0.1.58.dist-info/METADATA,sha256=3QDuLyoZeKRlghEHBplLVLthic-a3o64edGzI3XHmzE,3782
50
+ primitive-0.1.58.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
51
+ primitive-0.1.58.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
52
+ primitive-0.1.58.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
53
+ primitive-0.1.58.dist-info/RECORD,,