primitive 0.1.54__tar.gz → 0.1.56__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 (62) hide show
  1. {primitive-0.1.54 → primitive-0.1.56}/PKG-INFO +1 -1
  2. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/__about__.py +1 -1
  3. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/uploader.py +26 -10
  4. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/files/actions.py +11 -1
  5. {primitive-0.1.54 → primitive-0.1.56}/.git-hooks/pre-commit +0 -0
  6. {primitive-0.1.54 → primitive-0.1.56}/.gitattributes +0 -0
  7. {primitive-0.1.54 → primitive-0.1.56}/.github/workflows/lint.yml +0 -0
  8. {primitive-0.1.54 → primitive-0.1.56}/.github/workflows/publish.yml +0 -0
  9. {primitive-0.1.54 → primitive-0.1.56}/.gitignore +0 -0
  10. {primitive-0.1.54 → primitive-0.1.56}/.vscode/settings.json +0 -0
  11. {primitive-0.1.54 → primitive-0.1.56}/LICENSE.txt +0 -0
  12. {primitive-0.1.54 → primitive-0.1.56}/Makefile +0 -0
  13. {primitive-0.1.54 → primitive-0.1.56}/README.md +0 -0
  14. {primitive-0.1.54 → primitive-0.1.56}/linux setup.md +0 -0
  15. {primitive-0.1.54 → primitive-0.1.56}/pyproject.toml +0 -0
  16. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/__init__.py +0 -0
  17. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/actions.py +0 -0
  18. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/commands.py +0 -0
  19. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/process.py +0 -0
  20. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/provision.py +0 -0
  21. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/agent/runner.py +0 -0
  22. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/auth/__init__.py +0 -0
  23. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/auth/actions.py +0 -0
  24. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/auth/commands.py +0 -0
  25. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/cli.py +0 -0
  26. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/client.py +0 -0
  27. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/daemons/actions.py +0 -0
  28. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/daemons/commands.py +0 -0
  29. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/daemons/launch_agents.py +0 -0
  30. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/daemons/launch_service.py +0 -0
  31. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/files/commands.py +0 -0
  32. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/git/__init__.py +0 -0
  33. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/git/actions.py +0 -0
  34. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/git/commands.py +0 -0
  35. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/graphql/__init__.py +0 -0
  36. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/graphql/sdk.py +0 -0
  37. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/hardware/actions.py +0 -0
  38. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/hardware/commands.py +0 -0
  39. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/jobs/actions.py +0 -0
  40. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/jobs/commands.py +0 -0
  41. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/lint/actions.py +0 -0
  42. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/lint/commands.py +0 -0
  43. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/organizations/actions.py +0 -0
  44. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/organizations/commands.py +0 -0
  45. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/projects/__init__.py +0 -0
  46. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/projects/actions.py +0 -0
  47. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/projects/commands.py +0 -0
  48. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/sim/__init__.py +0 -0
  49. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/sim/actions.py +0 -0
  50. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/sim/commands.py +0 -0
  51. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/actions.py +0 -0
  52. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/auth.py +0 -0
  53. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/cache.py +0 -0
  54. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/config.py +0 -0
  55. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/files.py +0 -0
  56. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/git.py +0 -0
  57. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/memory_size.py +0 -0
  58. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/printer.py +0 -0
  59. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/shell.py +0 -0
  60. {primitive-0.1.54 → primitive-0.1.56}/src/primitive/utils/verible.py +0 -0
  61. {primitive-0.1.54 → primitive-0.1.56}/tests/__init__.py +0 -0
  62. {primitive-0.1.54 → primitive-0.1.56}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: primitive
3
- Version: 0.1.54
3
+ Version: 0.1.56
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
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@primitive.tech>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.1.54"
4
+ __version__ = "0.1.56"
@@ -1,5 +1,6 @@
1
1
  import typing
2
2
  import shutil
3
+ import os
3
4
  from loguru import logger
4
5
  from pathlib import Path, PurePath
5
6
  from ..utils.cache import get_artifacts_cache
@@ -15,8 +16,10 @@ class Uploader:
15
16
  ):
16
17
  self.primitive = primitive
17
18
 
18
- def upload_file(self, path: Path, prefix: str) -> str:
19
- file_upload_response = self.primitive.files.file_upload(path, key_prefix=prefix)
19
+ def upload_file(self, path: Path, prefix: str, job_run_id: str) -> str:
20
+ file_upload_response = self.primitive.files.file_upload(
21
+ path, key_prefix=prefix, job_run_id=job_run_id
22
+ )
20
23
  return file_upload_response.json()["data"]["fileUpload"]["id"]
21
24
 
22
25
  def scan(self) -> None:
@@ -31,20 +34,33 @@ class Uploader:
31
34
  for job_cache in subdirs:
32
35
  job_run_id = job_cache.name
33
36
 
34
- files = sorted(
35
- [
36
- w_path / file
37
- for w_path, _, w_files in job_cache.walk()
38
- for file in w_files
39
- ],
40
- key=lambda p: p.stat().st_size,
41
- )
37
+ files = None
38
+ has_walk = getattr(job_cache, "walk", None)
39
+ if has_walk:
40
+ files = sorted(
41
+ [
42
+ w_path / file
43
+ for w_path, _, w_files in job_cache.walk()
44
+ for file in w_files
45
+ ],
46
+ key=lambda p: p.stat().st_size,
47
+ )
48
+ else:
49
+ files = sorted(
50
+ [
51
+ Path(Path(w_path) / file)
52
+ for w_path, _, w_files in os.walk(job_cache)
53
+ for file in w_files
54
+ ],
55
+ key=lambda p: p.stat().st_size,
56
+ )
42
57
 
43
58
  file_ids = []
44
59
  for file in files:
45
60
  upload_id = self.upload_file(
46
61
  file,
47
62
  prefix=str(PurePath(file).relative_to(job_cache.parent).parent),
63
+ job_run_id=job_run_id,
48
64
  )
49
65
 
50
66
  if upload_id:
@@ -43,7 +43,13 @@ class Files(BaseAction):
43
43
  return result
44
44
 
45
45
  @guard
46
- def file_upload(self, path: Path, is_public: bool = False, key_prefix: str = ""):
46
+ def file_upload(
47
+ self,
48
+ path: Path,
49
+ is_public: bool = False,
50
+ key_prefix: str = "",
51
+ job_run_id: str = "",
52
+ ):
47
53
  file_path = str(path.resolve())
48
54
  if path.exists() is False:
49
55
  raise FileNotFoundError(f"File not found at {file_path}")
@@ -54,6 +60,8 @@ class Files(BaseAction):
54
60
  + file_path
55
61
  + """\", "keyPrefix": \""""
56
62
  + key_prefix
63
+ + """\", "jobRunId": \""""
64
+ + job_run_id
57
65
  + """\" } } }"""
58
66
  ) # noqa
59
67
 
@@ -63,6 +71,8 @@ class Files(BaseAction):
63
71
  + file_path
64
72
  + """\", "keyPrefix": \""""
65
73
  + key_prefix
74
+ + """\", "jobRunId": \""""
75
+ + job_run_id
66
76
  + """\" } } }"""
67
77
  ) # noqa
68
78
  body = {
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