chipfoundry-cli 2.3.14__tar.gz → 2.4.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.3.14 → chipfoundry_cli-2.4.0}/PKG-INFO +42 -15
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/README.md +41 -14
- chipfoundry_cli-2.4.0/chipfoundry_cli/check_refs.py +42 -0
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/chipfoundry_cli/main.py +488 -122
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/chipfoundry_cli/remote_precheck_git.py +106 -0
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/chipfoundry_cli/utils.py +60 -1
- chipfoundry_cli-2.4.0/chipfoundry_cli/version_check.py +204 -0
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/pyproject.toml +1 -1
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/LICENSE +0 -0
- {chipfoundry_cli-2.3.14 → chipfoundry_cli-2.4.0}/chipfoundry_cli/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chipfoundry-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: CLI tool to automate ChipFoundry project submission to SFTP server
|
|
5
5
|
Home-page: https://chipfoundry.io
|
|
6
6
|
License: Apache-2.0
|
|
@@ -256,14 +256,14 @@ cf logout
|
|
|
256
256
|
|
|
257
257
|
- Removes your stored API key from the local config
|
|
258
258
|
|
|
259
|
-
### Initialize a
|
|
259
|
+
### Initialize or Refresh a Project
|
|
260
260
|
|
|
261
261
|
```bash
|
|
262
|
-
cf init [--project-root DIRECTORY]
|
|
262
|
+
cf init [--project-root DIRECTORY] [--shuttle NAME_OR_ID] [--description TEXT]
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
> [!IMPORTANT]
|
|
266
|
-
>
|
|
266
|
+
> Run this first after cloning a repository. It is required before running:
|
|
267
267
|
> - `cf gpio-config`
|
|
268
268
|
> - `cf harden`
|
|
269
269
|
> - `cf precheck`
|
|
@@ -273,14 +273,17 @@ cf init [--project-root DIRECTORY]
|
|
|
273
273
|
> If you skip this step, other commands will show an error directing you to run `cf init` first.
|
|
274
274
|
|
|
275
275
|
**What it does:**
|
|
276
|
-
- **
|
|
277
|
-
- **
|
|
278
|
-
- **
|
|
279
|
-
-
|
|
280
|
-
-
|
|
276
|
+
- **Idempotent refresh**: Running `cf init` again on an already-linked project pulls in the current platform values, pre-fills prompts, and only PUTs the differences you confirm. The `platform_project_id` link is preserved.
|
|
277
|
+
- **Smart defaults**: Auto-detects project name from directory, project type from GDS files, and GitHub repo URL from your `origin` remote (HTTPS or SSH).
|
|
278
|
+
- **Interactive prompts**:
|
|
279
|
+
- When a stored value and a detected value match (or only one exists), press Enter to accept it.
|
|
280
|
+
- When they **differ** (e.g. a stale `github_repo_url` in `.cf/project.json` vs. your current `git remote`), the prompt shows both and Enter accepts the detected value (ground truth). Type `k` or `keep` to keep the current value instead, type a new value to override, or type `clear` to remove the field entirely.
|
|
281
|
+
- **Shuttle selection**: On first init, prompts to select an available shuttle (sorted by nearest deadline).
|
|
282
|
+
- **Platform registration**: Creates the project on the platform and links it automatically.
|
|
283
|
+
- Setting the GitHub repo URL enables `cf precheck --remote` and `cf push --remote`.
|
|
281
284
|
|
|
282
285
|
> [!NOTE]
|
|
283
|
-
> GDS hash is generated during `push`, not `init
|
|
286
|
+
> GDS hash is generated during `push`, not `init`.
|
|
284
287
|
|
|
285
288
|
### Link an Existing Project
|
|
286
289
|
|
|
@@ -590,17 +593,18 @@ cf verify counter_la --dry-run
|
|
|
590
593
|
cf push [OPTIONS]
|
|
591
594
|
```
|
|
592
595
|
|
|
593
|
-
**Prerequisites:** `cf login`, `cf link` (or `cf init`), `cf config`
|
|
596
|
+
**Prerequisites:** `cf login`, `cf link` (or `cf init`), `cf config` (SFTP mode only).
|
|
594
597
|
|
|
595
598
|
**Options:**
|
|
596
599
|
- `--project-root`: Specify project directory
|
|
597
|
-
- `--force-overwrite`: Overwrite existing files on SFTP
|
|
600
|
+
- `--force-overwrite`: Overwrite existing files on SFTP (SFTP mode only)
|
|
598
601
|
- `--submit`: Submit the project for review after upload
|
|
599
602
|
- `--dry-run`: Preview what would be uploaded
|
|
600
|
-
- `--sftp-username`: Override configured username
|
|
601
|
-
- `--sftp-key`: Override configured key path
|
|
603
|
+
- `--sftp-username`: Override configured username (SFTP mode only)
|
|
604
|
+
- `--sftp-key`: Override configured key path (SFTP mode only)
|
|
605
|
+
- `--remote`: HTTPS-only upload via the ChipFoundry GitHub App (no SFTP). Use this when port 22 is blocked by your corporate firewall.
|
|
602
606
|
|
|
603
|
-
**
|
|
607
|
+
**SFTP mode (default):**
|
|
604
608
|
1. Verifies the project is linked to the platform and you are logged in
|
|
605
609
|
2. Collects required project files
|
|
606
610
|
3. Auto-detects project type from GDS file
|
|
@@ -609,6 +613,29 @@ cf push [OPTIONS]
|
|
|
609
613
|
6. Syncs `project.json` data to the platform (GDS hash, version, project ID, slot number)
|
|
610
614
|
7. If `--submit` is used, submits the project for admin review
|
|
611
615
|
|
|
616
|
+
**Remote (HTTPS) mode — `cf push --remote`:**
|
|
617
|
+
|
|
618
|
+
Firewall friendly: only outbound HTTPS is needed. The CLI never uploads file
|
|
619
|
+
contents itself; instead, the platform fetches them from your GitHub repo
|
|
620
|
+
via the ChipFoundry GitHub App at your local HEAD commit.
|
|
621
|
+
|
|
622
|
+
Preconditions:
|
|
623
|
+
- Project has a GitHub repo URL (set via `cf init`, shown in the portal).
|
|
624
|
+
- The ChipFoundry GitHub App is installed on that repo (prompted in the portal).
|
|
625
|
+
- Your local `HEAD` has been pushed to `origin` on some branch (`git push`).
|
|
626
|
+
- Push-critical files at `HEAD` are clean: wrapper GDS, `verilog/rtl/user_defines.v` (when not an openframe project), and `.cf/project.json` (when tracked).
|
|
627
|
+
|
|
628
|
+
What happens:
|
|
629
|
+
1. `cf push --remote` resolves your local HEAD SHA and checks it is reachable from a remote ref.
|
|
630
|
+
2. Platform uses its GitHub App installation token to read the three push-critical files at that commit and stages them into your SFTP landing zone.
|
|
631
|
+
3. `project.json` is synced to the platform, exactly like an SFTP push.
|
|
632
|
+
4. `--submit` submits for review on success.
|
|
633
|
+
|
|
634
|
+
> [!TIP]
|
|
635
|
+
> If `cf push` fails to reach `sftp.chipfoundry.io:22` from inside a corporate
|
|
636
|
+
> network, run `cf push --remote` instead. No VPN required — just outbound
|
|
637
|
+
> HTTPS and a GitHub repo linked to the project.
|
|
638
|
+
|
|
612
639
|
**GDS File Handling:**
|
|
613
640
|
- **Both compressed (`.gz`) and uncompressed (`.gds`) files are supported**
|
|
614
641
|
- **No automatic compression** - files are uploaded as-is
|
|
@@ -230,14 +230,14 @@ cf logout
|
|
|
230
230
|
|
|
231
231
|
- Removes your stored API key from the local config
|
|
232
232
|
|
|
233
|
-
### Initialize a
|
|
233
|
+
### Initialize or Refresh a Project
|
|
234
234
|
|
|
235
235
|
```bash
|
|
236
|
-
cf init [--project-root DIRECTORY]
|
|
236
|
+
cf init [--project-root DIRECTORY] [--shuttle NAME_OR_ID] [--description TEXT]
|
|
237
237
|
```
|
|
238
238
|
|
|
239
239
|
> [!IMPORTANT]
|
|
240
|
-
>
|
|
240
|
+
> Run this first after cloning a repository. It is required before running:
|
|
241
241
|
> - `cf gpio-config`
|
|
242
242
|
> - `cf harden`
|
|
243
243
|
> - `cf precheck`
|
|
@@ -247,14 +247,17 @@ cf init [--project-root DIRECTORY]
|
|
|
247
247
|
> If you skip this step, other commands will show an error directing you to run `cf init` first.
|
|
248
248
|
|
|
249
249
|
**What it does:**
|
|
250
|
-
- **
|
|
251
|
-
- **
|
|
252
|
-
- **
|
|
253
|
-
-
|
|
254
|
-
-
|
|
250
|
+
- **Idempotent refresh**: Running `cf init` again on an already-linked project pulls in the current platform values, pre-fills prompts, and only PUTs the differences you confirm. The `platform_project_id` link is preserved.
|
|
251
|
+
- **Smart defaults**: Auto-detects project name from directory, project type from GDS files, and GitHub repo URL from your `origin` remote (HTTPS or SSH).
|
|
252
|
+
- **Interactive prompts**:
|
|
253
|
+
- When a stored value and a detected value match (or only one exists), press Enter to accept it.
|
|
254
|
+
- When they **differ** (e.g. a stale `github_repo_url` in `.cf/project.json` vs. your current `git remote`), the prompt shows both and Enter accepts the detected value (ground truth). Type `k` or `keep` to keep the current value instead, type a new value to override, or type `clear` to remove the field entirely.
|
|
255
|
+
- **Shuttle selection**: On first init, prompts to select an available shuttle (sorted by nearest deadline).
|
|
256
|
+
- **Platform registration**: Creates the project on the platform and links it automatically.
|
|
257
|
+
- Setting the GitHub repo URL enables `cf precheck --remote` and `cf push --remote`.
|
|
255
258
|
|
|
256
259
|
> [!NOTE]
|
|
257
|
-
> GDS hash is generated during `push`, not `init
|
|
260
|
+
> GDS hash is generated during `push`, not `init`.
|
|
258
261
|
|
|
259
262
|
### Link an Existing Project
|
|
260
263
|
|
|
@@ -564,17 +567,18 @@ cf verify counter_la --dry-run
|
|
|
564
567
|
cf push [OPTIONS]
|
|
565
568
|
```
|
|
566
569
|
|
|
567
|
-
**Prerequisites:** `cf login`, `cf link` (or `cf init`), `cf config`
|
|
570
|
+
**Prerequisites:** `cf login`, `cf link` (or `cf init`), `cf config` (SFTP mode only).
|
|
568
571
|
|
|
569
572
|
**Options:**
|
|
570
573
|
- `--project-root`: Specify project directory
|
|
571
|
-
- `--force-overwrite`: Overwrite existing files on SFTP
|
|
574
|
+
- `--force-overwrite`: Overwrite existing files on SFTP (SFTP mode only)
|
|
572
575
|
- `--submit`: Submit the project for review after upload
|
|
573
576
|
- `--dry-run`: Preview what would be uploaded
|
|
574
|
-
- `--sftp-username`: Override configured username
|
|
575
|
-
- `--sftp-key`: Override configured key path
|
|
577
|
+
- `--sftp-username`: Override configured username (SFTP mode only)
|
|
578
|
+
- `--sftp-key`: Override configured key path (SFTP mode only)
|
|
579
|
+
- `--remote`: HTTPS-only upload via the ChipFoundry GitHub App (no SFTP). Use this when port 22 is blocked by your corporate firewall.
|
|
576
580
|
|
|
577
|
-
**
|
|
581
|
+
**SFTP mode (default):**
|
|
578
582
|
1. Verifies the project is linked to the platform and you are logged in
|
|
579
583
|
2. Collects required project files
|
|
580
584
|
3. Auto-detects project type from GDS file
|
|
@@ -583,6 +587,29 @@ cf push [OPTIONS]
|
|
|
583
587
|
6. Syncs `project.json` data to the platform (GDS hash, version, project ID, slot number)
|
|
584
588
|
7. If `--submit` is used, submits the project for admin review
|
|
585
589
|
|
|
590
|
+
**Remote (HTTPS) mode — `cf push --remote`:**
|
|
591
|
+
|
|
592
|
+
Firewall friendly: only outbound HTTPS is needed. The CLI never uploads file
|
|
593
|
+
contents itself; instead, the platform fetches them from your GitHub repo
|
|
594
|
+
via the ChipFoundry GitHub App at your local HEAD commit.
|
|
595
|
+
|
|
596
|
+
Preconditions:
|
|
597
|
+
- Project has a GitHub repo URL (set via `cf init`, shown in the portal).
|
|
598
|
+
- The ChipFoundry GitHub App is installed on that repo (prompted in the portal).
|
|
599
|
+
- Your local `HEAD` has been pushed to `origin` on some branch (`git push`).
|
|
600
|
+
- Push-critical files at `HEAD` are clean: wrapper GDS, `verilog/rtl/user_defines.v` (when not an openframe project), and `.cf/project.json` (when tracked).
|
|
601
|
+
|
|
602
|
+
What happens:
|
|
603
|
+
1. `cf push --remote` resolves your local HEAD SHA and checks it is reachable from a remote ref.
|
|
604
|
+
2. Platform uses its GitHub App installation token to read the three push-critical files at that commit and stages them into your SFTP landing zone.
|
|
605
|
+
3. `project.json` is synced to the platform, exactly like an SFTP push.
|
|
606
|
+
4. `--submit` submits for review on success.
|
|
607
|
+
|
|
608
|
+
> [!TIP]
|
|
609
|
+
> If `cf push` fails to reach `sftp.chipfoundry.io:22` from inside a corporate
|
|
610
|
+
> network, run `cf push --remote` instead. No VPN required — just outbound
|
|
611
|
+
> HTTPS and a GitHub repo linked to the project.
|
|
612
|
+
|
|
586
613
|
**GDS File Handling:**
|
|
587
614
|
- **Both compressed (`.gz`) and uncompressed (`.gds`) files are supported**
|
|
588
615
|
- **No automatic compression** - files are uploaded as-is
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Known cf-precheck check names with display metadata.
|
|
2
|
+
|
|
3
|
+
Must stay in sync with cf-precheck's ``ALL_CHECKS`` ordering
|
|
4
|
+
(see ``cf-precheck/src/cf_precheck/check_manager.py``). The backend mirrors
|
|
5
|
+
the ref keys in ``chipignite-backend-services/src/precheck_service/check_refs.py``.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import NamedTuple
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PrecheckCheck(NamedTuple):
|
|
14
|
+
ref: str
|
|
15
|
+
surname: str
|
|
16
|
+
optional: bool
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
PRECHECK_CHECKS: tuple[PrecheckCheck, ...] = (
|
|
20
|
+
PrecheckCheck("topcell_check", "Top Cell", False),
|
|
21
|
+
PrecheckCheck("gpio_defines", "GPIO Defines", False),
|
|
22
|
+
PrecheckCheck("pdnmulti", "PDN Multi", False),
|
|
23
|
+
PrecheckCheck("metalcheck", "Metal Check", False),
|
|
24
|
+
PrecheckCheck("xor", "XOR", False),
|
|
25
|
+
PrecheckCheck("magic_drc", "Magic DRC", True),
|
|
26
|
+
PrecheckCheck("klayout_feol", "Klayout FEOL", False),
|
|
27
|
+
PrecheckCheck("klayout_beol", "Klayout BEOL", False),
|
|
28
|
+
PrecheckCheck("klayout_offgrid", "Klayout Offgrid", False),
|
|
29
|
+
PrecheckCheck("klayout_met_min_ca_density", "Klayout Metal Density", False),
|
|
30
|
+
PrecheckCheck(
|
|
31
|
+
"klayout_pin_label_purposes_overlapping_drawing",
|
|
32
|
+
"Klayout Pin Label",
|
|
33
|
+
False,
|
|
34
|
+
),
|
|
35
|
+
PrecheckCheck("klayout_zeroarea", "Klayout ZeroArea", False),
|
|
36
|
+
PrecheckCheck("spike_check", "Spike Check", False),
|
|
37
|
+
PrecheckCheck("illegal_cellname_check", "Illegal Cellname", False),
|
|
38
|
+
PrecheckCheck("lvs", "LVS", False),
|
|
39
|
+
PrecheckCheck("oeb", "OEB", False),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
PRECHECK_CHECK_REFS: frozenset[str] = frozenset(c.ref for c in PRECHECK_CHECKS)
|