@@ -152,32 +152,6 @@ export function mergePythonImports(
152152 return result ;
153153}
154154
155- /**
156- * Subtract one PythonImports set from another.
157- * Returns imports that are in `all` but not in `runtime`.
158- * If all items for a package are subtracted, the package is omitted entirely.
159- */
160- export function subtractPythonImports (
161- all : PythonImports ,
162- runtime : PythonImports ,
163- ) : PythonImports {
164- const result : Record < string , Set < string > > = { } ;
165- for ( const [ pkg , items ] of Object . entries ( all ) ) {
166- const runtimeItems = runtime [ pkg ] ;
167- if ( runtimeItems == null ) {
168- result [ pkg ] = new Set ( items ) ;
169- } else {
170- const remaining = new Set (
171- [ ...items ] . filter ( ( item ) => ! runtimeItems . has ( item ) ) ,
172- ) ;
173- if ( remaining . size > 0 ) {
174- result [ pkg ] = remaining ;
175- }
176- }
177- }
178- return result ;
179- }
180-
181155/**
182156 * Check if a PythonImports object has any entries.
183157 */
@@ -519,7 +493,7 @@ export function toPythonFqn(fqn: string, rootAssm: Assembly) {
519493 * relativeImportPath('A.B.C', 'A.B') === '..';
520494 * relativeImportPath('A.B', 'A.B.C') === '.C';
521495 */
522- export function relativeImportPath ( fromPkg : string , toPkg : string ) : string {
496+ function relativeImportPath ( fromPkg : string , toPkg : string ) : string {
523497 if ( toPkg . startsWith ( fromPkg ) ) {
524498 // from A.B to A.B.C === .C
525499 return `.${ toPkg . substring ( fromPkg . length + 1 ) } ` ;
0 commit comments