Skip to content

Commit 3bff70b

Browse files
committed
chore: mid work
1 parent 0dfad7f commit 3bff70b

2 files changed

Lines changed: 1 addition & 42 deletions

File tree

packages/jsii-pacmak/lib/targets/python.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,6 @@ abstract class BasePythonClassType implements PythonType, ISortableType {
436436
);
437437
}
438438

439-
public runtimeRequiredImports(context: EmitContext): PythonImports {
440-
return mergePythonImports(
441-
...this.bases.map((base) => toTypeName(base).requiredImports(context)),
442-
);
443-
}
444-
445439
public addMember(member: PythonBase) {
446440
this.members.push(member);
447441
}
@@ -1520,15 +1514,6 @@ class Class extends BasePythonClassType implements ISortableType {
15201514
);
15211515
}
15221516

1523-
public runtimeRequiredImports(context: EmitContext): PythonImports {
1524-
return mergePythonImports(
1525-
super.runtimeRequiredImports(context),
1526-
...this.interfaces.map((iface) =>
1527-
toTypeName(iface).requiredImports(context),
1528-
),
1529-
);
1530-
}
1531-
15321517
public emit(code: CodeMaker, context: EmitContext) {
15331518
// First we emit our implments decorator
15341519
if (this.interfaces.length > 0) {

packages/jsii-pacmak/lib/targets/python/type-name.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)