primitive 0.1.77__py3-none-any.whl → 0.1.79__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.77"
4
+ __version__ = "0.1.79"
primitive/agent/runner.py CHANGED
@@ -48,7 +48,6 @@ class AgentRunner:
48
48
  job_slug: str,
49
49
  max_log_size: int = 10 * 1024 * 1024,
50
50
  log_to_file: bool = True,
51
- job: Optional[JobDescription] = None,
52
51
  ) -> None:
53
52
  self.primitive = primitive
54
53
  self.source_dir = source_dir
@@ -69,37 +68,33 @@ class AgentRunner:
69
68
  format=AgentRunner.log_serializer(),
70
69
  )
71
70
 
72
- # Attempt to load job from file
73
- if not job:
74
- logger.info(f"Scanning directory for job file {self.job_slug}")
75
- yaml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yaml")
76
- yml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yml")
71
+ logger.info(f"Scanning directory for job file {self.job_slug}")
72
+ yaml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yaml")
73
+ yml_file = Path(self.source_dir / ".primitive" / f"{self.job_slug}.yml")
77
74
 
78
- if yaml_file.exists() and yml_file.exists():
79
- logger.error(
80
- f"Found two job descriptions with the same slug: {self.job_slug}"
81
- )
82
- self.primitive.jobs.job_run_update(
83
- self.job_id, status="request_completed", conclusion="failure"
84
- )
85
- raise FileExistsError
86
-
87
- if yaml_file.exists():
88
- self.job = yaml.load(open(yaml_file, "r"), Loader=Loader)
89
- elif yml_file.exists():
90
- self.job = yaml.load(open(yml_file, "r"), Loader=Loader)
91
- else:
92
- logger.error(
93
- f"No job description with matching slug '{self.job_slug}' found"
94
- )
95
- self.primitive.jobs.job_run_update(
96
- self.job_id, status="request_completed", conclusion="failure"
97
- )
98
- raise FileNotFoundError
75
+ if yaml_file.exists() and yml_file.exists():
76
+ logger.error(
77
+ f"Found two job descriptions with the same slug: {self.job_slug}"
78
+ )
79
+ self.primitive.jobs.job_run_update(
80
+ self.job_id, status="request_completed", conclusion="failure"
81
+ )
82
+ raise FileExistsError
99
83
 
100
- logger.info(f"Found job description for {self.job_slug}")
84
+ if yaml_file.exists():
85
+ self.job = yaml.load(open(yaml_file, "r"), Loader=Loader)
86
+ elif yml_file.exists():
87
+ self.job = yaml.load(open(yml_file, "r"), Loader=Loader)
101
88
  else:
102
- self.job = job
89
+ logger.error(
90
+ f"No job description with matching slug '{self.job_slug}' found"
91
+ )
92
+ self.primitive.jobs.job_run_update(
93
+ self.job_id, status="request_completed", conclusion="failure"
94
+ )
95
+ raise FileNotFoundError
96
+
97
+ logger.info(f"Found job description for {self.job_slug}")
103
98
 
104
99
  @staticmethod
105
100
  def log_serializer() -> Callable:
@@ -199,13 +194,14 @@ class AgentRunner:
199
194
  )
200
195
  logger.error(f"{self.job_slug} concluded with error(s)")
201
196
  return
202
-
203
- if total_job_errors > 0:
204
- self.primitive.jobs.job_run_update(
205
- self.job_id, status="request_completed", conclusion="failure"
206
- )
207
- logger.error(f"{self.job_slug} concluded with error(s)")
208
- return
197
+
198
+ # TODO: Remove this for now until we have a setting to enable log parsing
199
+ # if total_job_errors > 0:
200
+ # self.primitive.jobs.job_run_update(
201
+ # self.job_id, status="request_completed", conclusion="failure"
202
+ # )
203
+ # logger.error(f"{self.job_slug} concluded with error(s)")
204
+ # return
209
205
 
210
206
  self.primitive.jobs.job_run_update(
211
207
  self.job_id, status="request_completed", conclusion="success"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primitive
3
- Version: 0.1.77
3
+ Version: 0.1.79
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,4 +1,4 @@
1
- primitive/__about__.py,sha256=kbqG8R_F0oz-29EihqzctjDq_KscoA2FeGo_VPliAkY,130
1
+ primitive/__about__.py,sha256=vzO4WHOLXOFAvlTZ3lOnqtNHo1EekGFzz-ZQ6TeqQ8k,130
2
2
  primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
3
3
  primitive/cli.py,sha256=CiI60bG3UZyNFuLTpchr0KeJRG5SALj455Ob11CegGE,2412
4
4
  primitive/client.py,sha256=PPyIQRvKKSqCF9RRF5mJJ4Vqqolpzy1YXqffNLKIvAA,2390
@@ -7,7 +7,7 @@ primitive/agent/actions.py,sha256=Hosy2o2FntfBtcNqqHuMFq9dm99EVfySy0v2JGeufvc,64
7
7
  primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
8
8
  primitive/agent/process.py,sha256=4dpuO4cZg_SYi0kCoZJrm-ugB_mAnxYWaNbIyUHkoII,3395
9
9
  primitive/agent/provision.py,sha256=rmwnro1K5F8mwtd45XAq7RVQmpDWnbBCQ8X_qgWhm3M,1546
10
- primitive/agent/runner.py,sha256=b2Rdm44-w_1_uMwODjrfMvb75n8vVmCTDsvaiiU7-d8,8442
10
+ primitive/agent/runner.py,sha256=XOOtAcMpngv9qbBGCZyEvVsFgI3gt5n5xTCcgVV5ceM,8301
11
11
  primitive/agent/uploader.py,sha256=OkgwXhWKoECOJnW_ZmpzmUS_cpb-orC_uebNcmf5byw,2948
12
12
  primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  primitive/auth/actions.py,sha256=MPsG9LcKcOPwA7gZ9Ewk0PZJhTQvIrGfODdz4GxSzgA,999
@@ -90,8 +90,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
90
90
  primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
91
91
  primitive/utils/shell.py,sha256=j7E1YwgNWw57dFHVfEbqRNVcPHX0xDefX2vFSNgeI_8,1648
92
92
  primitive/utils/verible.py,sha256=Zb5NUISvcaIgEvgCDBWr-GCoceMa79Tcwvr5Wl9lfnA,2252
93
- primitive-0.1.77.dist-info/METADATA,sha256=M1AExQpHNb6v1fYax1m38IN4XTEJyjfr8Pbhgn2wPW8,3642
94
- primitive-0.1.77.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
- primitive-0.1.77.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
96
- primitive-0.1.77.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
97
- primitive-0.1.77.dist-info/RECORD,,
93
+ primitive-0.1.79.dist-info/METADATA,sha256=B8RbreK13SAPo8mg6_qfIy2p41H6dm5tKKBdM4Vmzso,3642
94
+ primitive-0.1.79.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
95
+ primitive-0.1.79.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
96
+ primitive-0.1.79.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
97
+ primitive-0.1.79.dist-info/RECORD,,