chipfoundry-cli 2.2.1__tar.gz → 2.3.0__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.2.1 → chipfoundry_cli-2.3.0}/PKG-INFO +1 -1
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/chipfoundry_cli/main.py +56 -29
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/pyproject.toml +1 -1
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/LICENSE +0 -0
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/README.md +0 -0
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/chipfoundry_cli/__init__.py +0 -0
- {chipfoundry_cli-2.2.1 → chipfoundry_cli-2.3.0}/chipfoundry_cli/utils.py +0 -0
|
@@ -323,7 +323,16 @@ def init(project_root, shuttle, description):
|
|
|
323
323
|
config = load_user_config()
|
|
324
324
|
username = config.get("sftp_username")
|
|
325
325
|
if not username:
|
|
326
|
-
|
|
326
|
+
try:
|
|
327
|
+
me = _api_get("/auth/cli/whoami")
|
|
328
|
+
username = me.get("sftp_username")
|
|
329
|
+
if username:
|
|
330
|
+
config["sftp_username"] = username
|
|
331
|
+
save_user_config(config)
|
|
332
|
+
except SystemExit:
|
|
333
|
+
pass
|
|
334
|
+
if not username:
|
|
335
|
+
console.print("[bold red]No SFTP account linked to your platform account. Please run 'cf login' first.[/bold red]")
|
|
327
336
|
raise click.Abort()
|
|
328
337
|
|
|
329
338
|
gds_dir = Path(project_root) / 'gds'
|
|
@@ -1313,10 +1322,14 @@ def push(project_root, sftp_host, sftp_username, sftp_key, project_id, project_n
|
|
|
1313
1322
|
console.print("Run [bold]cf login[/bold] to authenticate before pushing.")
|
|
1314
1323
|
raise click.Abort()
|
|
1315
1324
|
if not sftp_username:
|
|
1316
|
-
|
|
1325
|
+
me = _api_get("/auth/cli/whoami")
|
|
1326
|
+
sftp_username = me.get("sftp_username")
|
|
1317
1327
|
if not sftp_username:
|
|
1318
|
-
console.print("[bold red]No SFTP
|
|
1328
|
+
console.print("[bold red]No SFTP account linked to your platform account.[/bold red]")
|
|
1329
|
+
console.print("Contact support or provide --sftp-username.")
|
|
1319
1330
|
raise click.Abort()
|
|
1331
|
+
config["sftp_username"] = sftp_username
|
|
1332
|
+
save_user_config(config)
|
|
1320
1333
|
if not sftp_key:
|
|
1321
1334
|
sftp_key = config.get("sftp_key")
|
|
1322
1335
|
|
|
@@ -1495,10 +1508,14 @@ def pull(project_name, output_dir, sftp_host, sftp_username, sftp_key):
|
|
|
1495
1508
|
console.print("Run [bold]cf login[/bold] to authenticate before pulling.")
|
|
1496
1509
|
raise click.Abort()
|
|
1497
1510
|
if not sftp_username:
|
|
1498
|
-
|
|
1511
|
+
me = _api_get("/auth/cli/whoami")
|
|
1512
|
+
sftp_username = me.get("sftp_username")
|
|
1499
1513
|
if not sftp_username:
|
|
1500
|
-
console.print("[bold red]No SFTP
|
|
1514
|
+
console.print("[bold red]No SFTP account linked to your platform account.[/bold red]")
|
|
1515
|
+
console.print("Contact support or provide --sftp-username.")
|
|
1501
1516
|
raise click.Abort()
|
|
1517
|
+
config["sftp_username"] = sftp_username
|
|
1518
|
+
save_user_config(config)
|
|
1502
1519
|
if not sftp_key:
|
|
1503
1520
|
sftp_key = config.get("sftp_key")
|
|
1504
1521
|
|
|
@@ -1751,10 +1768,14 @@ def status(sftp_host, sftp_username, sftp_key, json_output, show_all):
|
|
|
1751
1768
|
if not platform_id:
|
|
1752
1769
|
console.print("[dim]Tip: Run [bold]cf link[/bold] to connect this project to the platform.[/dim]\n")
|
|
1753
1770
|
if not sftp_username:
|
|
1754
|
-
|
|
1771
|
+
me = _api_get("/auth/cli/whoami")
|
|
1772
|
+
sftp_username = me.get("sftp_username")
|
|
1755
1773
|
if not sftp_username:
|
|
1756
|
-
console.print("[red]No SFTP
|
|
1774
|
+
console.print("[red]No SFTP account linked to your platform account.[/red]")
|
|
1775
|
+
console.print("Contact support or provide --sftp-username.")
|
|
1757
1776
|
raise click.Abort()
|
|
1777
|
+
config["sftp_username"] = sftp_username
|
|
1778
|
+
save_user_config(config)
|
|
1758
1779
|
if not sftp_key:
|
|
1759
1780
|
sftp_key = config.get("sftp_key")
|
|
1760
1781
|
|
|
@@ -1885,10 +1906,14 @@ def tapeouts(sftp_host, sftp_username, sftp_key, limit, days):
|
|
|
1885
1906
|
"""Show all tapeout runs (archived projects) with their timestamps."""
|
|
1886
1907
|
config = load_user_config()
|
|
1887
1908
|
if not sftp_username:
|
|
1888
|
-
|
|
1909
|
+
me = _api_get("/auth/cli/whoami")
|
|
1910
|
+
sftp_username = me.get("sftp_username")
|
|
1889
1911
|
if not sftp_username:
|
|
1890
|
-
console.print("[red]No SFTP
|
|
1912
|
+
console.print("[red]No SFTP account linked to your platform account.[/red]")
|
|
1913
|
+
console.print("Contact support or provide --sftp-username.")
|
|
1891
1914
|
raise click.Abort()
|
|
1915
|
+
config["sftp_username"] = sftp_username
|
|
1916
|
+
save_user_config(config)
|
|
1892
1917
|
if not sftp_key:
|
|
1893
1918
|
sftp_key = config.get("sftp_key")
|
|
1894
1919
|
|
|
@@ -2071,10 +2096,14 @@ def confirm(project_root, sftp_host, sftp_username, sftp_key, project_name):
|
|
|
2071
2096
|
# Load user config for defaults
|
|
2072
2097
|
config = load_user_config()
|
|
2073
2098
|
if not sftp_username:
|
|
2074
|
-
|
|
2099
|
+
me = _api_get("/auth/cli/whoami")
|
|
2100
|
+
sftp_username = me.get("sftp_username")
|
|
2075
2101
|
if not sftp_username:
|
|
2076
|
-
console.print("[bold red]No SFTP
|
|
2102
|
+
console.print("[bold red]No SFTP account linked to your platform account.[/bold red]")
|
|
2103
|
+
console.print("Contact support or provide --sftp-username.")
|
|
2077
2104
|
raise click.Abort()
|
|
2105
|
+
config["sftp_username"] = sftp_username
|
|
2106
|
+
save_user_config(config)
|
|
2078
2107
|
if not sftp_key:
|
|
2079
2108
|
sftp_key = config.get("sftp_key")
|
|
2080
2109
|
|
|
@@ -3275,12 +3304,15 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3275
3304
|
if checks:
|
|
3276
3305
|
precheck_args.extend(list(checks))
|
|
3277
3306
|
|
|
3278
|
-
inner_cmd = 'pip3 install --upgrade -q cf-precheck && cf-precheck ' + ' '.join(precheck_args)
|
|
3307
|
+
inner_cmd = 'pip3 install --upgrade -q --root-user-action=ignore cf-precheck 2>/dev/null && exec cf-precheck ' + ' '.join(precheck_args)
|
|
3279
3308
|
|
|
3280
3309
|
docker_cmd = [
|
|
3281
|
-
'docker', 'run', '--rm',
|
|
3310
|
+
'docker', 'run', '--rm', '--init',
|
|
3282
3311
|
'-v', f'{project_root_path}:{project_root_path}',
|
|
3283
3312
|
'-v', f'{pdk_root}:{pdk_root}',
|
|
3313
|
+
'-e', f'PDK_ROOT={pdk_root}',
|
|
3314
|
+
'-e', f'PDK_PATH={pdk_path}',
|
|
3315
|
+
'-e', f'PDKPATH={pdk_path}',
|
|
3284
3316
|
docker_image,
|
|
3285
3317
|
'bash', '-c', inner_cmd,
|
|
3286
3318
|
]
|
|
@@ -3325,11 +3357,7 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3325
3357
|
console.print("[cyan]Running cf-precheck...[/cyan]\n")
|
|
3326
3358
|
|
|
3327
3359
|
try:
|
|
3328
|
-
process = subprocess.Popen(
|
|
3329
|
-
docker_cmd,
|
|
3330
|
-
preexec_fn=os.setsid if os.name != 'nt' else None
|
|
3331
|
-
)
|
|
3332
|
-
|
|
3360
|
+
process = subprocess.Popen(docker_cmd)
|
|
3333
3361
|
returncode = process.wait()
|
|
3334
3362
|
|
|
3335
3363
|
console.print("")
|
|
@@ -3345,17 +3373,11 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
|
|
|
3345
3373
|
except KeyboardInterrupt:
|
|
3346
3374
|
console.print("\n[yellow]⚠[/yellow] Precheck interrupted by user")
|
|
3347
3375
|
try:
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
process.wait(timeout=5)
|
|
3354
|
-
except Exception:
|
|
3355
|
-
if os.name != 'nt':
|
|
3356
|
-
os.killpg(os.getpgid(process.pid), signal.SIGKILL)
|
|
3357
|
-
else:
|
|
3358
|
-
process.kill()
|
|
3376
|
+
process.terminate()
|
|
3377
|
+
process.wait(timeout=10)
|
|
3378
|
+
except (subprocess.TimeoutExpired, Exception):
|
|
3379
|
+
process.kill()
|
|
3380
|
+
sys.exit(130)
|
|
3359
3381
|
except Exception as e:
|
|
3360
3382
|
console.print(f"\n[red]✗[/red] Error running precheck: {e}")
|
|
3361
3383
|
|
|
@@ -3893,9 +3915,14 @@ def login_cmd():
|
|
|
3893
3915
|
config['api_key'] = api_key
|
|
3894
3916
|
if user_email:
|
|
3895
3917
|
config['user_email'] = user_email
|
|
3918
|
+
sftp_username = poll_data.get('sftp_username')
|
|
3919
|
+
if sftp_username:
|
|
3920
|
+
config['sftp_username'] = sftp_username
|
|
3896
3921
|
save_user_config(config)
|
|
3897
3922
|
|
|
3898
3923
|
console.print(f"\n[green]✓ Logged in as {user_email or 'authenticated user'}[/green]")
|
|
3924
|
+
if sftp_username:
|
|
3925
|
+
console.print(f" SFTP account: {sftp_username}")
|
|
3899
3926
|
console.print(f" API key saved to {get_config_path()}")
|
|
3900
3927
|
return
|
|
3901
3928
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|