Skip to content

Commit 17f6dcf

Browse files
committed
Added using CHIPFLOW_ROOT for pins.lock file
1 parent 381c8a8 commit 17f6dcf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chipflow_lib/pin_lock.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from typing import Any, List, Dict, Tuple
88

9-
from chipflow_lib import _parse_config, ChipFlowError
9+
from chipflow_lib import _parse_config, _ensure_chipflow_root, ChipFlowError
1010
from chipflow_lib.platforms import PACKAGE_DEFINITIONS, PIN_ANNOTATION_SCHEMA, top_interfaces
1111
from chipflow_lib.platforms.utils import LockFile, Package, PortMap, Port
1212
from chipflow_lib.config_models import Config
@@ -86,7 +86,8 @@ def lock_pins() -> None:
8686
used_pins = set()
8787
oldlock = None
8888

89-
lockfile = Path('pins.lock')
89+
chipflow_root = _ensure_chipflow_root()
90+
lockfile = Path(chipflow_root, 'pins.lock')
9091
if lockfile.exists():
9192
json_string = lockfile.read_text()
9293
oldlock = LockFile.model_validate_json(json_string)
@@ -167,7 +168,7 @@ def lock_pins() -> None:
167168
port_map=port_map,
168169
metadata=interfaces)
169170

170-
with open('pins.lock', 'w') as f:
171+
with open(lockfile, 'w') as f:
171172
f.write(newlock.model_dump_json(indent=2, serialize_as_any=True))
172173

173174

0 commit comments

Comments
 (0)