diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 2e616be024..989281c22d 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1085,7 +1085,7 @@ class EnumMember implements PythonBase { interface ModuleOpts { assembly: spec.Assembly; assemblyFilename: string; - loadAssembly: boolean; + loadAssembly?: boolean; package?: Package; } @@ -1103,7 +1103,7 @@ class PythonModule implements PythonType { ) { this.assembly = opts.assembly; this.assemblyFilename = opts.assemblyFilename; - this.loadAssembly = opts.loadAssembly; + this.loadAssembly = !!opts.loadAssembly; this.package = opts.package; } @@ -1148,10 +1148,18 @@ class PythonModule implements PythonType { const params = [ `"${this.assembly.name}"`, `"${this.assembly.version}"`, - `"${this.assembly.targets!.python!.module}"`, + '__name__[0:-6]', // Removing the "._jsii" from the tail! `"${this.assemblyFilename}"`, ]; code.line(`__jsii_assembly__ = jsii.JSIIAssembly.load(${params.join(', ')})`); + } else { + // Then we must import the ._jsii subpackage. + code.line(); + let distanceFromRoot = 0; + for (let curr = this.fqn!; curr !== this.assembly.name; curr = curr.substring(0, curr.lastIndexOf('.'))) { + distanceFromRoot++; + } + code.line(`from ${'.'.repeat(distanceFromRoot + 1)}_jsii import *`); } code.line(); @@ -1785,7 +1793,7 @@ class PythonGenerator extends Generator { { assembly: assm, assemblyFilename: this.getAssemblyFileName(), - loadAssembly: false, + loadAssembly: true, package: this.package, }, ); @@ -1815,7 +1823,6 @@ class PythonGenerator extends Generator { { assembly: this.assembly, assemblyFilename: this.getAssemblyFileName(), - loadAssembly: true, package: this.package, } ); diff --git a/packages/jsii-pacmak/test/build-test.sh b/packages/jsii-pacmak/test/build-test.sh index fbfc68648c..383c885ed8 100755 --- a/packages/jsii-pacmak/test/build-test.sh +++ b/packages/jsii-pacmak/test/build-test.sh @@ -17,12 +17,22 @@ clean_dists() { for dir in $packagedirs; do rm -rf $dir/dist; done } -# Single target, recursive build to a certain location outdir=$(mktemp -d) +final_cleanup() { + rm -rf ${outdir} +} +trap final_cleanup EXIT + +# Prepare Python venv to avoid depending on system stuff +venv="${outdir}/.env" +python3 -m venv ${venv} +. ${venv}/bin/activate +pip install pip~=20.0.2 setuptools~=46.1.3 wheel~=0.34.2 twine~=3.1.1 + +# Single target, recursive build to a certain location clean_dists echo "Testing SINGLE TARGET, RECURSIVE build." ../bin/jsii-pacmak -o ${outdir} --recurse ../../jsii-calc -rm -rf ${outdir} # Multiple targets, build one-by-one into own directory clean_dists diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py index fe124745a2..825b4503fd 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py @@ -8,7 +8,7 @@ import jsii.compat import publication -__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-base-of-base", "0.0.0", "scope.jsii_calc_base_of_base", "jsii-calc-base-of-base@0.0.0.jsii.tgz") +from ._jsii import * @jsii.interface(jsii_type="@scope/jsii-calc-base-of-base.IVeryBaseInterface") @@ -62,6 +62,6 @@ def __repr__(self) -> str: return 'VeryBaseProps(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) -__all__ = ["IVeryBaseInterface", "Very", "VeryBaseProps", "__jsii_assembly__"] +__all__ = ["IVeryBaseInterface", "Very", "VeryBaseProps"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py index 8286c95df3..588f8d2ad9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py @@ -8,6 +8,8 @@ import jsii.compat import publication -__all__ = [] +__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-base-of-base", "0.0.0", __name__[0:-6], "jsii-calc-base-of-base@0.0.0.jsii.tgz") + +__all__ = ["__jsii_assembly__"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/__init__.py index a77738bf34..b4c66389ca 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/__init__.py @@ -10,7 +10,7 @@ import scope.jsii_calc_base_of_base -__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-base", "0.0.0", "scope.jsii_calc_base", "jsii-calc-base@0.0.0.jsii.tgz") +from ._jsii import * class Base(metaclass=jsii.JSIIAbstractClass, jsii_type="@scope/jsii-calc-base.Base"): @@ -82,6 +82,6 @@ def bar(self) -> None: return jsii.invoke(self, "bar", []) -__all__ = ["Base", "BaseProps", "IBaseInterface", "__jsii_assembly__"] +__all__ = ["Base", "BaseProps", "IBaseInterface"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/_jsii/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/_jsii/__init__.py index 2b6e82f761..aa5078d717 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/_jsii/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/python/src/scope/jsii_calc_base/_jsii/__init__.py @@ -10,6 +10,8 @@ import scope.jsii_calc_base_of_base -__all__ = [] +__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-base", "0.0.0", __name__[0:-6], "jsii-calc-base@0.0.0.jsii.tgz") + +__all__ = ["__jsii_assembly__"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py index ce6a6b6cc7..f370eec11f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/__init__.py @@ -11,7 +11,7 @@ import scope.jsii_calc_base import scope.jsii_calc_base_of_base -__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-lib", "0.0.0", "scope.jsii_calc_lib", "jsii-calc-lib@0.0.0.jsii.tgz") +from ._jsii import * @jsii.enum(jsii_type="@scope/jsii-calc-lib.EnumFromScopedModule") @@ -384,6 +384,6 @@ def to_string(self) -> str: return jsii.invoke(self, "toString", []) -__all__ = ["EnumFromScopedModule", "IDoublable", "IFriendly", "IThreeLevelsInterface", "MyFirstStruct", "Number", "Operation", "StructWithOnlyOptionals", "Value", "__jsii_assembly__"] +__all__ = ["EnumFromScopedModule", "IDoublable", "IFriendly", "IThreeLevelsInterface", "MyFirstStruct", "Number", "Operation", "StructWithOnlyOptionals", "Value"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/_jsii/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/_jsii/__init__.py index 181a0c1151..c1c51263f9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/_jsii/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/python/src/scope/jsii_calc_lib/_jsii/__init__.py @@ -11,6 +11,8 @@ import scope.jsii_calc_base import scope.jsii_calc_base_of_base -__all__ = [] +__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-lib", "0.0.0", __name__[0:-6], "jsii-calc-lib@0.0.0.jsii.tgz") + +__all__ = ["__jsii_assembly__"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py index 8c40bc3512..a529348702 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py @@ -42,7 +42,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from ._jsii import * class AbstractClassBase(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.AbstractClassBase"): @@ -8354,6 +8354,6 @@ def next(self) -> jsii.Number: return jsii.invoke(self, "next", []) -__all__ = ["AbstractClass", "AbstractClassBase", "AbstractClassReturner", "AbstractSuite", "Add", "AllTypes", "AllTypesEnum", "AllowedMethodNames", "AmbiguousParameters", "AnonymousImplementationProvider", "AsyncVirtualMethods", "AugmentableClass", "BaseJsii976", "Bell", "BinaryOperation", "Calculator", "CalculatorProps", "ChildStruct982", "ClassThatImplementsTheInternalInterface", "ClassThatImplementsThePrivateInterface", "ClassWithCollections", "ClassWithDocs", "ClassWithJavaReservedWords", "ClassWithMutableObjectLiteralProperty", "ClassWithPrivateConstructorAndAutomaticProperties", "ConfusingToJackson", "ConfusingToJacksonStruct", "ConstructorPassesThisOut", "Constructors", "ConsumePureInterface", "ConsumerCanRingBell", "ConsumersOfThisCrazyTypeSystem", "DataRenderer", "DefaultedConstructorArgument", "Demonstrate982", "DeprecatedClass", "DeprecatedEnum", "DeprecatedStruct", "DerivedStruct", "DiamondInheritanceBaseLevelStruct", "DiamondInheritanceFirstMidLevelStruct", "DiamondInheritanceSecondMidLevelStruct", "DiamondInheritanceTopLevelStruct", "DisappointingCollectionSource", "DoNotOverridePrivates", "DoNotRecognizeAnyAsOptional", "DocumentedClass", "DontComplainAboutVariadicAfterOptional", "DoubleTrouble", "EnumDispenser", "EraseUndefinedHashValues", "EraseUndefinedHashValuesOptions", "ExperimentalClass", "ExperimentalEnum", "ExperimentalStruct", "ExportedBaseClass", "ExtendsInternalInterface", "GiveMeStructs", "Greetee", "GreetingAugmenter", "IAnonymousImplementationProvider", "IAnonymouslyImplementMe", "IAnotherPublicInterface", "IBell", "IBellRinger", "IConcreteBellRinger", "IDeprecatedInterface", "IExperimentalInterface", "IExtendsPrivateInterface", "IFriendlier", "IFriendlyRandomGenerator", "IInterfaceImplementedByAbstractClass", "IInterfaceThatShouldNotBeADataType", "IInterfaceWithInternal", "IInterfaceWithMethods", "IInterfaceWithOptionalMethodArguments", "IInterfaceWithProperties", "IInterfaceWithPropertiesExtension", "IJSII417Derived", "IJSII417PublicBaseOfBase", "IJsii487External", "IJsii487External2", "IJsii496", "IMutableObjectLiteral", "INonInternalInterface", "IObjectWithProperty", "IOptionalMethod", "IPrivatelyImplemented", "IPublicInterface", "IPublicInterface2", "IRandomNumberGenerator", "IReturnJsii976", "IReturnsNumber", "IStableInterface", "IStructReturningDelegate", "ImplementInternalInterface", "Implementation", "ImplementsInterfaceWithInternal", "ImplementsInterfaceWithInternalSubclass", "ImplementsPrivateInterface", "ImplictBaseOfBase", "InbetweenClass", "InterfaceCollections", "InterfacesMaker", "JSII417Derived", "JSII417PublicBaseOfBase", "JSObjectLiteralForInterface", "JSObjectLiteralToNative", "JSObjectLiteralToNativeClass", "JavaReservedWords", "Jsii487Derived", "Jsii496Derived", "JsiiAgent", "JsonFormatter", "LoadBalancedFargateServiceProps", "MethodNamedProperty", "Multiply", "Negate", "NestedStruct", "NodeStandardLibrary", "NullShouldBeTreatedAsUndefined", "NullShouldBeTreatedAsUndefinedData", "NumberGenerator", "ObjectRefsInCollections", "ObjectWithPropertyProvider", "Old", "OptionalArgumentInvoker", "OptionalConstructorArgument", "OptionalStruct", "OptionalStructConsumer", "OverridableProtectedMember", "OverrideReturnsObject", "ParentStruct982", "PartiallyInitializedThisConsumer", "Polymorphism", "Power", "PropertyNamedProperty", "PublicClass", "PythonReservedWords", "ReferenceEnumFromScopedPackage", "ReturnsPrivateImplementationOfInterface", "RootStruct", "RootStructValidator", "RuntimeTypeChecking", "SecondLevelStruct", "SingleInstanceTwoTypes", "SingletonInt", "SingletonIntEnum", "SingletonString", "SingletonStringEnum", "SmellyStruct", "SomeTypeJsii976", "StableClass", "StableEnum", "StableStruct", "StaticContext", "Statics", "StringEnum", "StripInternal", "StructA", "StructB", "StructParameterType", "StructPassing", "StructUnionConsumer", "StructWithJavaReservedWords", "Sum", "SupportsNiceJavaBuilder", "SupportsNiceJavaBuilderProps", "SupportsNiceJavaBuilderWithRequiredProps", "SyncVirtualMethods", "Thrower", "TopLevelStruct", "UnaryOperation", "UnionProperties", "UseBundledDependency", "UseCalcBase", "UsesInterfaceWithProperties", "VariadicInvoker", "VariadicMethod", "VirtualMethodPlayground", "VoidCallback", "WithPrivatePropertyInConstructor", "__jsii_assembly__"] +__all__ = ["AbstractClass", "AbstractClassBase", "AbstractClassReturner", "AbstractSuite", "Add", "AllTypes", "AllTypesEnum", "AllowedMethodNames", "AmbiguousParameters", "AnonymousImplementationProvider", "AsyncVirtualMethods", "AugmentableClass", "BaseJsii976", "Bell", "BinaryOperation", "Calculator", "CalculatorProps", "ChildStruct982", "ClassThatImplementsTheInternalInterface", "ClassThatImplementsThePrivateInterface", "ClassWithCollections", "ClassWithDocs", "ClassWithJavaReservedWords", "ClassWithMutableObjectLiteralProperty", "ClassWithPrivateConstructorAndAutomaticProperties", "ConfusingToJackson", "ConfusingToJacksonStruct", "ConstructorPassesThisOut", "Constructors", "ConsumePureInterface", "ConsumerCanRingBell", "ConsumersOfThisCrazyTypeSystem", "DataRenderer", "DefaultedConstructorArgument", "Demonstrate982", "DeprecatedClass", "DeprecatedEnum", "DeprecatedStruct", "DerivedStruct", "DiamondInheritanceBaseLevelStruct", "DiamondInheritanceFirstMidLevelStruct", "DiamondInheritanceSecondMidLevelStruct", "DiamondInheritanceTopLevelStruct", "DisappointingCollectionSource", "DoNotOverridePrivates", "DoNotRecognizeAnyAsOptional", "DocumentedClass", "DontComplainAboutVariadicAfterOptional", "DoubleTrouble", "EnumDispenser", "EraseUndefinedHashValues", "EraseUndefinedHashValuesOptions", "ExperimentalClass", "ExperimentalEnum", "ExperimentalStruct", "ExportedBaseClass", "ExtendsInternalInterface", "GiveMeStructs", "Greetee", "GreetingAugmenter", "IAnonymousImplementationProvider", "IAnonymouslyImplementMe", "IAnotherPublicInterface", "IBell", "IBellRinger", "IConcreteBellRinger", "IDeprecatedInterface", "IExperimentalInterface", "IExtendsPrivateInterface", "IFriendlier", "IFriendlyRandomGenerator", "IInterfaceImplementedByAbstractClass", "IInterfaceThatShouldNotBeADataType", "IInterfaceWithInternal", "IInterfaceWithMethods", "IInterfaceWithOptionalMethodArguments", "IInterfaceWithProperties", "IInterfaceWithPropertiesExtension", "IJSII417Derived", "IJSII417PublicBaseOfBase", "IJsii487External", "IJsii487External2", "IJsii496", "IMutableObjectLiteral", "INonInternalInterface", "IObjectWithProperty", "IOptionalMethod", "IPrivatelyImplemented", "IPublicInterface", "IPublicInterface2", "IRandomNumberGenerator", "IReturnJsii976", "IReturnsNumber", "IStableInterface", "IStructReturningDelegate", "ImplementInternalInterface", "Implementation", "ImplementsInterfaceWithInternal", "ImplementsInterfaceWithInternalSubclass", "ImplementsPrivateInterface", "ImplictBaseOfBase", "InbetweenClass", "InterfaceCollections", "InterfacesMaker", "JSII417Derived", "JSII417PublicBaseOfBase", "JSObjectLiteralForInterface", "JSObjectLiteralToNative", "JSObjectLiteralToNativeClass", "JavaReservedWords", "Jsii487Derived", "Jsii496Derived", "JsiiAgent", "JsonFormatter", "LoadBalancedFargateServiceProps", "MethodNamedProperty", "Multiply", "Negate", "NestedStruct", "NodeStandardLibrary", "NullShouldBeTreatedAsUndefined", "NullShouldBeTreatedAsUndefinedData", "NumberGenerator", "ObjectRefsInCollections", "ObjectWithPropertyProvider", "Old", "OptionalArgumentInvoker", "OptionalConstructorArgument", "OptionalStruct", "OptionalStructConsumer", "OverridableProtectedMember", "OverrideReturnsObject", "ParentStruct982", "PartiallyInitializedThisConsumer", "Polymorphism", "Power", "PropertyNamedProperty", "PublicClass", "PythonReservedWords", "ReferenceEnumFromScopedPackage", "ReturnsPrivateImplementationOfInterface", "RootStruct", "RootStructValidator", "RuntimeTypeChecking", "SecondLevelStruct", "SingleInstanceTwoTypes", "SingletonInt", "SingletonIntEnum", "SingletonString", "SingletonStringEnum", "SmellyStruct", "SomeTypeJsii976", "StableClass", "StableEnum", "StableStruct", "StaticContext", "Statics", "StringEnum", "StripInternal", "StructA", "StructB", "StructParameterType", "StructPassing", "StructUnionConsumer", "StructWithJavaReservedWords", "Sum", "SupportsNiceJavaBuilder", "SupportsNiceJavaBuilderProps", "SupportsNiceJavaBuilderWithRequiredProps", "SyncVirtualMethods", "Thrower", "TopLevelStruct", "UnaryOperation", "UnionProperties", "UseBundledDependency", "UseCalcBase", "UsesInterfaceWithProperties", "VariadicInvoker", "VariadicMethod", "VirtualMethodPlayground", "VoidCallback", "WithPrivatePropertyInConstructor"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/_jsii/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/_jsii/__init__.py index 6e6b14b45b..3ad851f278 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/_jsii/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/_jsii/__init__.py @@ -12,6 +12,8 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__all__ = [] +__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", __name__[0:-6], "jsii-calc@0.0.0.jsii.tgz") + +__all__ = ["__jsii_assembly__"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/composition/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/composition/__init__.py index b7a64123b5..33c528a25d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/composition/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/composition/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from .._jsii import * class CompositeOperation(scope.jsii_calc_lib.Operation, metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.composition.CompositeOperation"): @@ -137,6 +137,6 @@ def expression(self) -> scope.jsii_calc_lib.Value: return jsii.get(self, "expression") -__all__ = ["CompositeOperation", "__jsii_assembly__"] +__all__ = ["CompositeOperation"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/derived_class_has_no_properties/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/derived_class_has_no_properties/__init__.py index e609c623c1..19020277c3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/derived_class_has_no_properties/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/derived_class_has_no_properties/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from .._jsii import * class Base(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DerivedClassHasNoProperties.Base"): @@ -46,6 +46,6 @@ def __init__(self) -> None: jsii.create(jsii_calc.DerivedClassHasNoProperties.Derived, self, []) -__all__ = ["Base", "Derived", "__jsii_assembly__"] +__all__ = ["Base", "Derived"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py index ceb15d672b..016c644c11 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from .._jsii import * class Foo(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.InterfaceInNamespaceIncludesClasses.Foo"): @@ -68,6 +68,6 @@ def __repr__(self) -> str: return 'Hello(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) -__all__ = ["Foo", "Hello", "__jsii_assembly__"] +__all__ = ["Foo", "Hello"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py index d36afe84bb..5f34c37787 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from .._jsii import * @jsii.data_type(jsii_type="jsii-calc.InterfaceInNamespaceOnlyInterface.Hello", jsii_struct_bases=[], name_mapping={'foo': 'foo'}) @@ -46,6 +46,6 @@ def __repr__(self) -> str: return 'Hello(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) -__all__ = ["Hello", "__jsii_assembly__"] +__all__ = ["Hello"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/__init__.py index 4cb3f16a6e..f9438120f7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/__init__.py @@ -14,7 +14,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from .._jsii import * @jsii.implements(nested_submodule.deeplyNested.INamespaced) @@ -71,6 +71,6 @@ def all_types(self, value: typing.Optional[jsii_calc.AllTypes]): jsii.set(self, "allTypes", value) -__all__ = ["MyClass", "__jsii_assembly__"] +__all__ = ["MyClass"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/back_references/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/back_references/__init__.py index 6f25586aba..268f7790be 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/back_references/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/back_references/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from ..._jsii import * @jsii.data_type(jsii_type="jsii-calc.submodule.back_references.MyClassReference", jsii_struct_bases=[], name_mapping={'reference': 'reference'}) @@ -46,6 +46,6 @@ def __repr__(self) -> str: return 'MyClassReference(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) -__all__ = ["MyClassReference", "__jsii_assembly__"] +__all__ = ["MyClassReference"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/child/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/child/__init__.py index 95a1ed3e80..088b7f65eb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/child/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/child/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from ..._jsii import * @jsii.enum(jsii_type="jsii-calc.submodule.child.Awesomeness") @@ -84,6 +84,6 @@ def __repr__(self) -> str: return 'Structure(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) -__all__ = ["Awesomeness", "Goodness", "Structure", "__jsii_assembly__"] +__all__ = ["Awesomeness", "Goodness", "Structure"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/__init__.py index bb70fedc8e..585af1263a 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/__init__.py @@ -13,7 +13,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from ..._jsii import * @jsii.implements(deeplyNested.INamespaced) @@ -57,6 +57,6 @@ def goodness(self) -> jsii_calc.submodule.child.Goodness: return jsii.get(self, "goodness") -__all__ = ["Namespaced", "__jsii_assembly__"] +__all__ = ["Namespaced"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/deeply_nested/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/deeply_nested/__init__.py index 93f8d24fcb..a0e4d40562 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/deeply_nested/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/submodule/nested_submodule/deeply_nested/__init__.py @@ -12,7 +12,7 @@ import scope.jsii_calc_base_of_base import scope.jsii_calc_lib -__jsii_assembly__ = jsii.JSIIAssembly.load("jsii-calc", "0.0.0", "jsii_calc", "jsii-calc@0.0.0.jsii.tgz") +from ...._jsii import * @jsii.interface(jsii_type="jsii-calc.submodule.nested_submodule.deeplyNested.INamespaced") @@ -51,6 +51,6 @@ def defined_at(self) -> str: return jsii.get(self, "definedAt") -__all__ = ["INamespaced", "__jsii_assembly__"] +__all__ = ["INamespaced"] publication.publish()