primitive 0.1.75__py3-none-any.whl → 0.1.77__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.75"
4
+ __version__ = "0.1.77"
@@ -1,7 +1,11 @@
1
+ from typing import List
2
+ from pathlib import Path
1
3
  from subprocess import Popen, PIPE
2
4
  import shlex
5
+ import glob
3
6
  import selectors
4
7
  from loguru import logger
8
+ from abc import abstractmethod
5
9
 
6
10
 
7
11
  class Process:
@@ -11,7 +15,9 @@ class Process:
11
15
  env,
12
16
  workdir: str = ".",
13
17
  ):
14
- self.cmd = shlex.split(cmd)
18
+ self.cmd = Process.expand_glob_in_cmd(
19
+ cmd_parts=shlex.split(cmd), workdir=workdir
20
+ )
15
21
  self.env = env
16
22
  self.workdir = workdir
17
23
  self.process = None
@@ -90,6 +96,24 @@ class Process:
90
96
  if self.process:
91
97
  self.process.kill()
92
98
 
99
+ @abstractmethod
100
+ def expand_glob_in_cmd(cmd_parts: List[str], workdir: Path):
101
+ # Characters that indicate a glob pattern
102
+ glob_chars = {"*", "?", "[", "]", "{", "}"}
103
+ expanded_cmd = []
104
+ for part in cmd_parts:
105
+ if any(c in part for c in glob_chars):
106
+ matches = glob.glob(str(workdir / part))
107
+ if matches:
108
+ expanded_cmd.extend(
109
+ [str(Path(match).relative_to(workdir)) for match in matches]
110
+ )
111
+ else:
112
+ expanded_cmd.append(part)
113
+ else:
114
+ expanded_cmd.append(part)
115
+ return expanded_cmd
116
+
93
117
  @property
94
118
  def errors(self) -> int:
95
119
  return self._errors
primitive/agent/runner.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import os
2
2
  import threading
3
3
  import typing
4
- import json
5
4
  from pathlib import Path, PurePath
6
5
  from time import sleep
7
6
  from typing import Dict, Iterable, List, Optional, TypedDict, Callable
@@ -109,18 +108,16 @@ class AgentRunner:
109
108
  if "step" in record["extra"]:
110
109
  step = record["extra"]["step"]
111
110
 
112
- log = {
113
- "time": record["time"].strftime("%Y-%m-%d %H:%M:%S.%f"),
114
- "utc": record["time"].strftime("%Y-%m-%d %H:%M:%S.%f%z"),
115
- "level": record["level"].name,
116
- "message": record["message"],
117
- "name": record["name"],
118
- "step": step,
119
- }
120
-
121
- record["extra"]["serialized"] = json.dumps(log)
111
+ log = (
112
+ "<green>{time:YYYY-MM-DD HH:mm:ss.SSS!UTC}</green> | "
113
+ "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
114
+ "<level>{level}</level> | "
115
+ f"{step} | "
116
+ "<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - "
117
+ "<level>{message}</level>\n"
118
+ )
122
119
 
123
- return "{extra[serialized]}\n"
120
+ return log
124
121
 
125
122
  return fmt
126
123
 
@@ -1,11 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: primitive
3
- Version: 0.1.75
3
+ Version: 0.1.77
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
7
7
  Author-email: Dylan Stein <dylan@primitive.tech>, Chase Zimmerman <chase@primitive.tech>
8
- License: MIT
8
+ License-Expression: MIT
9
+ License-File: LICENSE.txt
9
10
  Classifier: Development Status :: 4 - Beta
10
11
  Classifier: Programming Language :: Python
11
12
  Classifier: Programming Language :: Python :: 3
@@ -97,19 +98,10 @@ git config --global user.name “<firstName lastName>”
97
98
  brew install make
98
99
  fish_add_path /opt/homebrew/opt/make/libexec/gnubin
99
100
 
100
- # install pyenv (python version manager)
101
- brew install pyenv
102
- set -Ux PYENV_ROOT $HOME/.pyenv
103
- fish_add_path $PYENV_ROOT/bin
104
- echo 'pyenv init - | source' >> ~/.config/fish/config.fish
105
-
106
- # install the latest version of python
107
- pyenv install 3.12.2
108
- pyenv global 3.12.2
109
- pip install --upgrade pip
110
-
111
101
  # install uv
112
- pip install uv
102
+ curl -LsSf https://astral.sh/uv/install.sh | sh
103
+ uv python install
104
+ fish_add_path "$(uv python dir)/bin"
113
105
  ```
114
106
 
115
107
  ### Repository Setup
@@ -1,13 +1,13 @@
1
- primitive/__about__.py,sha256=Bul_OkVAMsvB_xpBccZPfwejz2cQB4hlKoEdtbMbwZk,130
1
+ primitive/__about__.py,sha256=kbqG8R_F0oz-29EihqzctjDq_KscoA2FeGo_VPliAkY,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
5
5
  primitive/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  primitive/agent/actions.py,sha256=Hosy2o2FntfBtcNqqHuMFq9dm99EVfySy0v2JGeufvc,6474
7
7
  primitive/agent/commands.py,sha256=-dVDilELfkGfbZB7qfEPs77Dm1oT62qJj4tsIk4KoxI,254
8
- primitive/agent/process.py,sha256=7o8axjJ1OauKaFBL0jbZL9tGlZdZbDCXAdT5F-S_XQ8,2541
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=WHmlfSRHngY6mNwpykIe90LxYGoIMTBB-F2h5KVV-VE,8504
10
+ primitive/agent/runner.py,sha256=b2Rdm44-w_1_uMwODjrfMvb75n8vVmCTDsvaiiU7-d8,8442
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.75.dist-info/METADATA,sha256=HiUBrRvmKwbwLrH1cNgWekEQo2hPZPuqgmyZElGbSh0,3806
94
- primitive-0.1.75.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
95
- primitive-0.1.75.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
96
- primitive-0.1.75.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
97
- primitive-0.1.75.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any