@@ -23,26 +23,6 @@ export const DEFAULT_ASSET_EXCLUDES = [
2323 '.git/' ,
2424] ;
2525
26- const userCustomizePy = `
27- import sys
28- import os
29- from pathlib import Path
30-
31- base_path = Path(__file__).parent
32-
33- for pth_file in base_path.glob('*.pth'):
34- print('Adding', pth_file, base_path)
35- with open(pth_file, 'r') as f:
36- for line in f:
37- module_path_str = str(base_path / line.strip())
38- print('...', module_path_str)
39- if module_path_str not in sys.path:
40- sys.path.insert(0, module_path_str)
41-
42- print('sys.path', sys.path)
43-
44- ` ;
45-
4626interface BundlingCommandOptions {
4727 readonly rootDir : string ;
4828 readonly workspacePackage ?: string ;
@@ -164,21 +144,16 @@ export class Bundling {
164144 ...options . commandHooks ?. beforeBundling ( options . inputDir , options . outputDir ) ?? [ ] ,
165145 ) ;
166146 commands . push ( ...[
167- `while [ -e ${ options . inputDir } /wait.txt ]; do sleep 2; echo Waiting; done` ,
168147 `rsync -rLv ${ excludeArgs . join ( ' ' ) } ${ options . inputDir } / ${ options . outputDir } ` ,
169148 `cd ${ options . outputDir } ` , // uv pip install needs to be run from here for editable deps to relative paths to be resolved
170149 `VIRTUAL_ENV=/tmp/venv uv sync ${ uvCommonArgs } ${ uvPackageArgs } --compile-bytecode --no-dev --frozen --no-editable --link-mode=copy` ,
171150 `VIRTUAL_ENV=/tmp/venv uv export ${ uvCommonArgs } ${ uvPackageArgs } --no-dev --frozen --no-editable > ${ reqsFile } ` ,
172151 `uv pip install -r ${ reqsFile } --target ${ options . outputDir } --reinstall --compile-bytecode --link-mode=copy --editable $(grep -e "^\./" ${ reqsFile } )` ,
173- `sed -i 's|${ options . outputDir } /|.|g' ${ options . outputDir } /*.pth` ,
174152 `rm -rf ${ options . outputDir } /.venv` ,
175- `echo ${ Buffer . from ( userCustomizePy ) . toString ( 'base64' ) } | base64 -d > ${ options . outputDir } /usercustomize.py` ,
176- `while [ -e ${ options . inputDir } /wait2.txt ]; do sleep 2; echo Waiting; done` ,
177153 ] ) ;
178154 commands . push (
179155 ...options . commandHooks ?. afterBundling ( options . inputDir , options . outputDir ) ?? [ ] ,
180156 ) ;
181- console . log ( 'Bundling commands' , { options, commands } ) ;
182157
183158 return commands ;
184159 }
0 commit comments