Skip to content

chore(init-templates): move init templates to new assertions module#17062

Merged
mergify[bot] merged 11 commits intoaws:masterfrom
corymhall:init-template-assertions
Nov 3, 2021
Merged

chore(init-templates): move init templates to new assertions module#17062
mergify[bot] merged 11 commits intoaws:masterfrom
corymhall:init-template-assertions

Conversation

@corymhall
Copy link
Contributor

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

@gitpod-io
Copy link

gitpod-io bot commented Oct 19, 2021

@@ -1 +1,2 @@
-e .
pytest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not add a version here? Feels safer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Python should we be using == or >= for deps?


install_requires=[
"aws-cdk.core==%cdk-version%",
"aws-cdk.assertions==%cdk-version%",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 20, 2021

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.
Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only gone through the v1 templates so far.

@mergify mergify bot dismissed nija-at’s stale review October 26, 2021 18:07

Pull request has been modified.

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 27, 2021
@corymhall corymhall requested a review from nija-at November 3, 2021 15:38
Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. See couple of minor comments below.

@nija-at nija-at added the pr/do-not-merge This PR should not be merged at this time. label Nov 3, 2021
Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with 'do-not-merge'. See comments above.

@corymhall corymhall removed the pr/do-not-merge This PR should not be merged at this time. label Nov 3, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 3, 2021

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: af14406
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit ca20805 into aws:master Nov 3, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 3, 2021

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).

njlynch added a commit that referenced this pull request Nov 4, 2021
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.
mergify bot pushed a commit that referenced this pull request Nov 4, 2021
#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*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…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*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
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*
github-merge-queue bot pushed a commit to aws/aws-cdk-cli that referenced this pull request Jan 21, 2026
)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants