chipfoundry-cli 2.3.0__tar.gz → 2.3.1__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.
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/PKG-INFO +1 -1
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/chipfoundry_cli/main.py +42 -3
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/pyproject.toml +1 -1
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/LICENSE +0 -0
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/README.md +0 -0
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/chipfoundry_cli/__init__.py +0 -0
- {chipfoundry_cli-2.3.0 → chipfoundry_cli-2.3.1}/chipfoundry_cli/utils.py +0 -0
|
@@ -3220,6 +3220,28 @@ def repo_update(project_root, repo_owner, repo_name, branch, dry_run):
|
|
|
3220
3220
|
raise click.Abort()
|
|
3221
3221
|
|
|
3222
3222
|
|
|
3223
|
+
def _upload_precheck_results(project_json_path: Path):
|
|
3224
|
+
"""Upload precheck results to the platform (best-effort, never fatal)."""
|
|
3225
|
+
try:
|
|
3226
|
+
with open(project_json_path, "r") as f:
|
|
3227
|
+
pj = json.load(f)
|
|
3228
|
+
precheck_blob = pj.get("precheck")
|
|
3229
|
+
if not precheck_blob:
|
|
3230
|
+
return
|
|
3231
|
+
platform_id = pj.get("project", {}).get("platform_project_id")
|
|
3232
|
+
if not platform_id:
|
|
3233
|
+
return
|
|
3234
|
+
config = load_user_config()
|
|
3235
|
+
if not config.get("api_key"):
|
|
3236
|
+
return
|
|
3237
|
+
_api_put(f"/projects/{platform_id}", {"precheck_results": precheck_blob})
|
|
3238
|
+
console.print("[green]✓ Precheck results synced to platform[/green]")
|
|
3239
|
+
except SystemExit:
|
|
3240
|
+
console.print("[yellow]⚠ Precheck results could not be synced to platform[/yellow]")
|
|
3241
|
+
except Exception:
|
|
3242
|
+
console.print("[yellow]⚠ Precheck results could not be synced to platform[/yellow]")
|
|
3243
|
+
|
|
3244
|
+
|
|
3223
3245
|
@main.command('precheck')
|
|
3224
3246
|
@click.option('--project-root', type=click.Path(exists=True, file_okay=False), help='Path to the project directory (defaults to current directory)')
|
|
3225
3247
|
@click.option('--skip-checks', multiple=True, help='Checks to skip (can be specified multiple times)')
|
|
@@ -3308,6 +3330,7 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3308
3330
|
|
|
3309
3331
|
docker_cmd = [
|
|
3310
3332
|
'docker', 'run', '--rm', '--init',
|
|
3333
|
+
'--platform', 'linux/amd64',
|
|
3311
3334
|
'-v', f'{project_root_path}:{project_root_path}',
|
|
3312
3335
|
'-v', f'{pdk_root}:{pdk_root}',
|
|
3313
3336
|
'-e', f'PDK_ROOT={pdk_root}',
|
|
@@ -3338,7 +3361,7 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3338
3361
|
console.print(f"[cyan]Checking for Docker image updates...[/cyan]")
|
|
3339
3362
|
try:
|
|
3340
3363
|
subprocess.run(
|
|
3341
|
-
['docker', 'pull', docker_image],
|
|
3364
|
+
['docker', 'pull', '--platform', 'linux/amd64', docker_image],
|
|
3342
3365
|
check=True,
|
|
3343
3366
|
capture_output=True,
|
|
3344
3367
|
)
|
|
@@ -3368,6 +3391,10 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3368
3391
|
sys.exit(130)
|
|
3369
3392
|
else:
|
|
3370
3393
|
console.print(f"[red]✗[/red] Precheck failed (exit code {returncode})")
|
|
3394
|
+
|
|
3395
|
+
_upload_precheck_results(project_json_path)
|
|
3396
|
+
|
|
3397
|
+
if returncode != 0:
|
|
3371
3398
|
sys.exit(returncode)
|
|
3372
3399
|
|
|
3373
3400
|
except KeyboardInterrupt:
|
|
@@ -3727,7 +3754,7 @@ def _api_put(path: str, json_data: dict):
|
|
|
3727
3754
|
client.close()
|
|
3728
3755
|
|
|
3729
3756
|
|
|
3730
|
-
_SYNC_KEEP_KEYS = {"project", "tapeout"}
|
|
3757
|
+
_SYNC_KEEP_KEYS = {"project", "tapeout", "precheck"}
|
|
3731
3758
|
|
|
3732
3759
|
|
|
3733
3760
|
def _slim_project_json(pj: dict) -> dict:
|
|
@@ -3862,13 +3889,25 @@ def unlink_cmd():
|
|
|
3862
3889
|
console.print("[green]✓ Platform link removed.[/green] The remote project is not deleted.")
|
|
3863
3890
|
|
|
3864
3891
|
|
|
3892
|
+
DEV_API_URL = 'https://dev-api.chipfoundry.io'
|
|
3893
|
+
|
|
3894
|
+
|
|
3865
3895
|
@main.command('login')
|
|
3866
|
-
|
|
3896
|
+
@click.option('--test', is_flag=True, help='Authenticate against the dev/test platform')
|
|
3897
|
+
def login_cmd(test):
|
|
3867
3898
|
"""Authenticate with ChipFoundry platform via browser."""
|
|
3868
3899
|
import httpx
|
|
3869
3900
|
import webbrowser
|
|
3870
3901
|
import time
|
|
3871
3902
|
|
|
3903
|
+
config = load_user_config()
|
|
3904
|
+
if test:
|
|
3905
|
+
config['api_url'] = DEV_API_URL
|
|
3906
|
+
save_user_config(config)
|
|
3907
|
+
elif config.get('api_url') == DEV_API_URL:
|
|
3908
|
+
del config['api_url']
|
|
3909
|
+
save_user_config(config)
|
|
3910
|
+
|
|
3872
3911
|
api_url = _get_api_url()
|
|
3873
3912
|
console.print("[bold cyan]ChipFoundry CLI Login[/bold cyan]")
|
|
3874
3913
|
console.print(f"Opening browser to authenticate with [bold]{api_url}[/bold]...\n")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|