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

feat(awscdk-app-py): adding support for building CDK apps with python #1579

Merged
merged 11 commits into from
Feb 25, 2022

Conversation

marciocadev
Copy link
Contributor

@marciocadev marciocadev commented Jan 29, 2022

Just like it was done for Java I made a python cdk project template

I needed to decouple the existing pytest class to create a specific test template for CDK Python projects

Testing against local projects

Testing this solution is a little different as it is necessary import the projen python dependency

$ cd /path/to/local/projen
$ yarn build # <-- build the solution
$ yarn package:python # <-- create the projen python package
$ yarn link

Now, to create new projects:

$ mkdir /my/new/project
$ cd /my/new/project
$ npm init -y # <-- needed to yarn lynk
$ yarn link projen
$ alias pj="node_modules/projen/bin/projen"
$ pj new awscdk-app-py
$ source .env/bin/activate
$ pip install /path/to/local/projen/dist/python/projen-0.0.0-py3-none-any.whl # <-- point to your local projen code
$ pj new awscdk-app-py # <-- run again to resolve the projen dependency

Now you can make some changes on your .projenrc.py file and run python .projenrc.py

closes #1577

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2022

Codecov Report

Merging #1579 (d2b937c) into main (d90284c) will increase coverage by 1.42%.
The diff coverage is 89.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1579      +/-   ##
==========================================
+ Coverage   88.06%   89.48%   +1.42%     
==========================================
  Files         132      150      +18     
  Lines        5109     6051     +942     
  Branches     1207     1552     +345     
==========================================
+ Hits         4499     5415     +916     
- Misses        610      634      +24     
- Partials        0        2       +2     
Impacted Files Coverage Δ
src/awscdk/internal.ts 100.00% <ø> (ø)
src/cdk/consts.ts 100.00% <ø> (+36.36%) ⬆️
src/dev-env.ts 83.33% <0.00%> (ø)
src/java/index.ts 100.00% <ø> (ø)
src/python/index.ts 100.00% <ø> (ø)
src/release/index.ts 100.00% <ø> (ø)
src/testing.ts 80.00% <ø> (ø)
src/textfile.ts 100.00% <ø> (ø)
src/toml.ts 90.90% <ø> (ø)
src/typescript/index.ts 100.00% <ø> (ø)
... and 178 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab9b76b...d2b937c. Read the comment docs.

Copy link
Contributor

@Chriscbr Chriscbr left a comment

Choose a reason for hiding this comment

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

This looks fantastic @marciocadev ! Really excited to have this added to projen. :) I've just added a few small comments.

src/awscdk/awscdk-app-py.ts Show resolved Hide resolved
src/awscdk/awscdk-app-py.ts Outdated Show resolved Hide resolved
src/awscdk/awscdk-app-py.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
marciocadev and others added 3 commits February 23, 2022 21:34
Co-authored-by: Christopher Rybicki <crybicki98@gmail.com>
Co-authored-by: Christopher Rybicki <crybicki98@gmail.com>
src/awscdk/awscdk-app-py.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Chriscbr Chriscbr left a comment

Choose a reason for hiding this comment

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

Thanks @marciocadev ! 🙏

@mergify mergify bot merged commit 0289e61 into projen:main Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(awscdk): Add support for Python projects
3 participants