Skip to content

Commit 6095aa6

Browse files
Upgrade cf-precheck inside Docker container before running
Ensures the container always has the latest cf-precheck version from PyPI, regardless of when the Docker image was last built. Made-with: Cursor
1 parent fcbaf7a commit 6095aa6

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

chipfoundry_cli/main.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,25 +3260,30 @@ def precheck(project_root, skip_checks, magic_drc, checks, dry_run):
32603260

32613261
docker_image = 'chipfoundry/mpw_precheck:latest'
32623262

3263-
docker_cmd = [
3264-
'docker', 'run', '--rm',
3265-
'-v', f'{project_root_path}:{project_root_path}',
3266-
'-v', f'{pdk_root}:{pdk_root}',
3267-
docker_image,
3268-
'cf-precheck',
3263+
precheck_args = [
32693264
'-i', str(project_root_path),
32703265
'-p', str(pdk_path),
32713266
'-c', '/opt/caravel',
32723267
]
32733268

32743269
if magic_drc:
3275-
docker_cmd.append('--magic-drc')
3270+
precheck_args.append('--magic-drc')
32763271

32773272
if skip_checks:
3278-
docker_cmd.extend(['--skip-checks'] + list(skip_checks))
3273+
precheck_args.extend(['--skip-checks'] + list(skip_checks))
32793274

32803275
if checks:
3281-
docker_cmd.extend(list(checks))
3276+
precheck_args.extend(list(checks))
3277+
3278+
inner_cmd = 'pip3 install --upgrade -q cf-precheck && cf-precheck ' + ' '.join(precheck_args)
3279+
3280+
docker_cmd = [
3281+
'docker', 'run', '--rm',
3282+
'-v', f'{project_root_path}:{project_root_path}',
3283+
'-v', f'{pdk_root}:{pdk_root}',
3284+
docker_image,
3285+
'bash', '-c', inner_cmd,
3286+
]
32823287

32833288
checks_display = ', '.join(checks) if checks else 'All checks'
32843289
console.print("\n" + "="*60)

0 commit comments

Comments
 (0)