chore(init-templates): move init templates to new assertions module#17062
chore(init-templates): move init templates to new assertions module#17062mergify[bot] merged 11 commits intoaws:masterfrom corymhall:init-template-assertions
Conversation
.../lib/init-templates/v1/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java
Outdated
Show resolved
Hide resolved
...s-cdk/lib/init-templates/v1/app/python/tests/unit/test_%name.PythonModule%_stack.template.py
Outdated
Show resolved
Hide resolved
| @@ -1 +1,2 @@ | |||
| -e . | |||
| pytest | |||
There was a problem hiding this comment.
Should we not add a version here? Feels safer.
There was a problem hiding this comment.
For Python should we be using == or >= for deps?
|
|
||
| install_requires=[ | ||
| "aws-cdk.core==%cdk-version%", | ||
| "aws-cdk.assertions==%cdk-version%", |
There was a problem hiding this comment.
I've been told using setup.py for applications is actually an anti-pattern, and we should only be using this for libraries.
Not a big Python user myself, and probably out of scope for the current PR... but if you agree, something to consider maybe?
There was a problem hiding this comment.
I updated the Python templates to remove setup.py in favor of requirements.txt & requirements-dev.txt. Not sure if we actually need to distinguish between the two in a CDK app though?
...ib/init-templates/v1/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py
Show resolved
Hide resolved
packages/aws-cdk/lib/init-templates/v2/app/go/%name%_test.template.go
Outdated
Show resolved
Hide resolved
|
Didn't get all the way through yet |
this updates both v1 and v2 init templates to use the new assertions module. I also added tests for the python app templates since those were missing.
requirements.txt and requirements-dev.txt
update app templates for go to create an empty stack. this updates the go app template to have the same behavior as the other languages.
nija-at
left a comment
There was a problem hiding this comment.
I've only gone through the v1 templates so far.
.../lib/init-templates/v1/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java
Outdated
Show resolved
Hide resolved
.../lib/init-templates/v1/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java
Outdated
Show resolved
Hide resolved
packages/aws-cdk/lib/init-templates/v1/lib/typescript/test/%name%.test.template.ts
Outdated
Show resolved
Hide resolved
...ib/init-templates/v1/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py
Outdated
Show resolved
Hide resolved
nija-at
left a comment
There was a problem hiding this comment.
Looks good. See couple of minor comments below.
.../lib/init-templates/v1/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java
Outdated
Show resolved
Hide resolved
nija-at
left a comment
There was a problem hiding this comment.
Approved with 'do-not-merge'. See comments above.
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
The init templates were modified as part of #17062. One change was for the 'app' and 'sample-app' templates to use 'requirements.txt' instead of 'setup.py'. In that conversion, a quirk of the `%constructsversion%` replacement was lost; that replacement inserts the version comparison `>=` itself, so having it in the requirements.txt results in a broken specifier. This was caught in the forward-merge to v2, where there are additional tests verfying the constructs versions.
#17333) The init templates were modified as part of #17062. One change was for the 'app' and 'sample-app' templates to use 'requirements.txt' instead of 'setup.py'. In that conversion, a quirk of the `%constructsversion%` replacement was lost; that replacement inserts the version comparison `>=` itself, so having it in the requirements.txt results in a broken specifier. This was caught in the forward-merge to v2, where there are additional tests verfying the constructs versions. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…ws#17062) this updates both v1 and v2 init templates to use the new assertions module. I also added tests for the python app templates since those were missing. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
aws#17333) The init templates were modified as part of aws#17062. One change was for the 'app' and 'sample-app' templates to use 'requirements.txt' instead of 'setup.py'. In that conversion, a quirk of the `%constructsversion%` replacement was lost; that replacement inserts the version comparison `>=` itself, so having it in the requirements.txt results in a broken specifier. This was caught in the forward-merge to v2, where there are additional tests verfying the constructs versions. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
) Fixes issue [#9135](aws/aws-cdk#9135) by updating the README to be consistent with [AWS docs](https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-python.html#work-with-cdk-python-dependencies) Note that setup.py was removed from the python init-template in PR [#17062](aws/aws-cdk#17062) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license Co-authored-by: Gowthami Gudipati <gudipatg@amazon.com>
this updates both v1 and v2 init templates to use the new assertions
module. I also added tests for the python app templates since those were
missing.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license