Skip to content

Commit

Permalink
fix(cli): fix Python sample-app template
Browse files Browse the repository at this point in the history
follow up on #3058 - since we renamed the core package namesapce to "software.amazon.awscdk.core"

Fixes #3069
  • Loading branch information
shivlaks committed Jun 26, 2019
1 parent 6d38487 commit 6376417
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions packages/aws-cdk/lib/init-templates/sample-app/python/app.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3

from aws_cdk import cdk
from aws_cdk import core

from hello.hello_stack import MyStack


app = cdk.App()
app = core.App()
MyStack(app, "hello-cdk-1", env={'region': 'us-east-2'})
MyStack(app, "hello-cdk-2", env={'region': 'us-west-2'})

app.run()
app.synth()
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from aws_cdk import (
aws_iam as iam,
aws_s3 as s3,
cdk,
core,
)


class HelloConstruct(cdk.Construct):
class HelloConstruct(core.Construct):

@property
def buckets(self):
return tuple(self._buckets)

def __init__(self, scope: cdk.Construct, id: str, num_buckets: int) -> None:
def __init__(self, scope: core.Construct, id: str, num_buckets: int) -> None:
super().__init__(scope, id)
self._buckets = []
for i in range(0, num_buckets):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
aws_sqs as sqs,
aws_sns as sns,
aws_sns_subscriptions as subs,
cdk
core
)

from hello_construct import HelloConstruct


class MyStack(cdk.Stack):
class MyStack(core.Stack):

def __init__(self, app: cdk.App, id: str, **kwargs) -> None:
def __init__(self, app: core.App, id: str, **kwargs) -> None:
super().__init__(app, id, **kwargs)

queue = sqs.Queue(
self, "MyFirstQueue",
visibility_timeout_sec=300,
visibility_timeout=core.Duration.seconds(300),
)

topic = sns.Topic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
packages=setuptools.find_packages(where="hello"),

install_requires=[
"aws-cdk.cdk",
"aws-cdk.core",
"aws-cdk.aws_iam",
"aws-cdk.aws_sqs",
"aws-cdk.aws_sns",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import unittest

from aws_cdk import cdk
from aws_cdk import core

from hello.hello_construct import HelloConstruct

class TestHelloConstruct(unittest.TestCase):

def setUp(self):
self.app = cdk.App()
self.stack = cdk.Stack(self.app, "TestStack")
self.app = core.App()
self.stack = core.Stack(self.app, "TestStack")

def test_num_buckets(self):
num_buckets = 10
Expand Down

0 comments on commit 6376417

Please sign in to comment.