Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): imports between subpackages are broken #1528

Merged
merged 18 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3a6fa30
fix(python): imports between subpackages are broken
RomainMuller Apr 10, 2020
f56caf2
move typing imports descriptor to constant
RomainMuller Apr 14, 2020
bbe7fc8
add code to back a submodule import from a dependency
RomainMuller Apr 14, 2020
7f1346b
Merge remote-tracking branch 'origin/master' into rmuller/redo-python…
RomainMuller Apr 14, 2020
4a5d4c7
added test that loads namespaces from dependencies
RomainMuller Apr 14, 2020
78c012f
fixup test expectations
RomainMuller Apr 14, 2020
c53214e
more fixed up test expectations
RomainMuller Apr 14, 2020
f99aed4
Merge branch 'master' into rmuller/redo-python-name-resolver
RomainMuller Apr 15, 2020
315ac09
Merge remote-tracking branch 'origin/master' into rmuller/redo-python…
RomainMuller Apr 16, 2020
d9e0b1c
Merge remote-tracking branch 'origin/rmuller/redo-python-name-resolve…
RomainMuller Apr 16, 2020
7bcd976
reduce unnecessary changes
RomainMuller Apr 16, 2020
af3757f
Merge remote-tracking branch 'origin/master' into rmuller/redo-python…
RomainMuller May 11, 2020
356ff42
Re-enable test that used to be failing
RomainMuller May 11, 2020
bc1dddd
restore test to minimize spurious changes
RomainMuller May 11, 2020
1d34a2d
Merge remote-tracking branch 'origin/master' into rmuller/redo-python…
RomainMuller May 11, 2020
ad6728e
fixup test expectations
RomainMuller May 11, 2020
24e8747
Merge remote-tracking branch 'origin/master' into rmuller/redo-python…
RomainMuller May 12, 2020
e047b26
Merge branch 'master' into rmuller/redo-python-name-resolver
mergify[bot] May 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/@jsii/python-runtime/tests/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
StructUnionConsumer,
SomeTypeJsii976,
StructParameterType,
AnonymousImplementationProvider
AnonymousImplementationProvider,
UpcasingReflectable,
)
from scope.jsii_calc_lib import IFriendly, EnumFromScopedModule, Number
from scope.jsii_calc_lib.submodule import IReflectable, ReflectableEntry


# Note: The names of these test functions have been chosen to map as closely to the
Expand Down Expand Up @@ -1168,3 +1170,15 @@ def test_collection_of_interfaces_map_of_structs():
def test_collection_of_interfaces_map_of_interfaces():
for elt in InterfaceCollections.map_of_interfaces().values():
assert getattr(elt, "ring") is not None


def test_dependency_submodule_types_are_usable():
subject = UpcasingReflectable({ 'foo': 'bar' })

assert UpcasingReflectable.REFLECTOR.as_map(subject) == { 'FOO': 'bar' }


def test_load_submodules():
from jsii_calc.submodule import nested_submodule
import jsii_calc.submodule

8 changes: 8 additions & 0 deletions packages/@jsii/spec/lib/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ export interface AssemblyConfiguration extends Targetable {
* An entity on which targets may be configured.
*/
export interface Targetable {
/**
* Submodules defined in this assembly, if any, associated with their
* designated targets configuration.
*
* @default none
*/
submodules?: { [fqn: string]: { targets?: AssemblyTargets } };

/**
* A map of target name to configuration, which is used when generating
* packages for various languages.
Expand Down
Loading