blocks-cli 0.1.26__tar.gz → 0.1.27__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 (26) hide show
  1. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/PKG-INFO +1 -1
  2. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/push.py +10 -10
  3. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/config/auth.py +4 -2
  4. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/setup.py +1 -1
  5. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/LICENSE +0 -0
  6. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/MANIFEST.in +0 -0
  7. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/README.md +0 -0
  8. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/__init__.py +0 -0
  9. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/api.py +0 -0
  10. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/builds.py +0 -0
  11. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/bundles.py +0 -0
  12. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/__base__.py +0 -0
  13. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/__init__.py +0 -0
  14. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/configure.py +0 -0
  15. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/create.py +0 -0
  16. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/init.py +0 -0
  17. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/commands/test.py +0 -0
  18. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/config/__init__.py +0 -0
  19. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/config/config.py +0 -0
  20. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/console.py +0 -0
  21. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/fs.py +0 -0
  22. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/package.py +0 -0
  23. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli/registration.py +0 -0
  24. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/blocks_cli.egg-info/SOURCES.txt +0 -0
  25. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/requirements.txt +0 -0
  26. {blocks-cli-0.1.26 → blocks-cli-0.1.27}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blocks-cli
3
- Version: 0.1.26
3
+ Version: 0.1.27
4
4
  Summary: CLI tool for Blocks, a platform for writing custom AI-enabled codebase automations in Python. Leverage a full codebase-aware API. Automatically trigger automations from Github, Slack, and other providers.
5
5
  Home-page: https://github.com/BlocksOrg/sdk
6
6
  Author: BlocksOrg
@@ -58,9 +58,6 @@ def push(file: Path = typer.Argument(..., help="Name of blocks file to push.")):
58
58
  # working directory from where the command was invoked
59
59
  cwd = file.resolve().parent
60
60
 
61
- # parent folder name
62
- parent_folder_name = cwd.name
63
-
64
61
  git_remote_url = None
65
62
 
66
63
  try:
@@ -115,11 +112,13 @@ def push(file: Path = typer.Argument(..., help="Name of blocks file to push.")):
115
112
  task_kwargs = automation.get("task_kwargs", {})
116
113
 
117
114
  automation_name = task_kwargs.get("name")
118
- vcpus = task_kwargs.get("vcpus", 1)
119
- memory_mib = task_kwargs.get("memory_mib", 1024)
120
- gpu_count = task_kwargs.get("gpu_count", 0)
121
- gpu_type = task_kwargs.get("gpu_type", "")
122
115
 
116
+ # compute resource fields
117
+ runner = task_kwargs.get("runner")
118
+ vcpus = task_kwargs.get("vcpus")
119
+ memory = task_kwargs.get("memory")
120
+ gpu_count = task_kwargs.get("gpu_count")
121
+ gpu_type = task_kwargs.get("gpu_type")
123
122
  repos: list = trigger_kwargs.get("repos", [])
124
123
 
125
124
  if len(repos) == 0 and git_remote_url:
@@ -132,9 +131,10 @@ def push(file: Path = typer.Argument(..., help="Name of blocks file to push.")):
132
131
  # Extract known fields
133
132
  automation_config = {
134
133
  "name": automation_name,
135
- "import_path": f"{parent_folder_name}/{file.name}:{function_name}",
134
+ "import_path": f"{file.name}:{function_name}",
135
+ "runner": runner,
136
136
  "vcpus": vcpus,
137
- "memory_mib": memory_mib,
137
+ "memory": memory,
138
138
  "gpu_count": gpu_count,
139
139
  "gpu_type": gpu_type,
140
140
  "trigger_alias": trigger_alias,
@@ -145,7 +145,7 @@ def push(file: Path = typer.Argument(..., help="Name of blocks file to push.")):
145
145
  # Add any additional args that weren't explicitly handled
146
146
  additional_task_kwargs = {
147
147
  k: v
148
- for k, v in trigger_kwargs.items()
148
+ for k, v in task_kwargs.items()
149
149
  if k not in ["vcpus", "memory_mib", "gpu_count", "gpu_type", "name"]
150
150
  }
151
151
  automation_config["trigger_kwargs"] = trigger_kwargs
@@ -7,6 +7,7 @@ class AuthConfig(BaseModel):
7
7
 
8
8
  uid: Optional[str] = ""
9
9
  puid: Optional[str] = ""
10
+ wid: Optional[str] = ""
10
11
  # Corresponds to env variable BLOCKS_AUTH__API_KEY
11
12
  api_key: Optional[str] = ""
12
13
 
@@ -36,10 +37,11 @@ class AuthConfig(BaseModel):
36
37
  def get_auth_headers(self) -> dict:
37
38
  from blocks_cli.console import console
38
39
  headers = {}
39
- if self.uid and self.puid:
40
- console.print("⚠️ Using uid and puid for auth headers. This is intended for development purposes only.", style="yellow bold")
40
+ if self.uid and self.puid and self.wid:
41
+ console.print("⚠️ Using uid, puid and wid for auth headers. This is intended for development purposes only.", style="yellow bold")
41
42
  headers["x-blocks-uid"] = self.uid
42
43
  headers["x-blocks-puid"] = self.puid
44
+ headers["x-blocks-wid"] = self.wid
43
45
  else:
44
46
  headers["Authorization"] = f"ApiKey {self.api_key}"
45
47
 
@@ -6,7 +6,7 @@ with open("requirements.txt") as f:
6
6
 
7
7
  setup(
8
8
  name="blocks-cli",
9
- version="0.1.26",
9
+ version="0.1.27",
10
10
  packages=find_packages(),
11
11
  include_package_data=True,
12
12
  install_requires=requirements,
File without changes
File without changes
File without changes
File without changes