Skip to content

(aws-cdk): cdk init sample-app pytest fails on name with '-' #15938

Closed
@Pearcekieser

Description

@Pearcekieser

On windows I ran cdk init in a directory called "aws-data-pipeline". After codegen, I created the virtual env, enabled the venv, installed the dependencies, cdk commands were working (ex. cdk synth, info and diff), but pytest failed.

E     File "C:\Users\<...>\aws-data-pipeline\tests\unit\test_aws_data_pipe
E       from aws-data-pipeline.aws_data_pipeline_stack import AwsDataPipelineStack
E               ^
E   SyntaxError: invalid syntax

Reproduction Steps

mkdir aws-data-pipeline
cd aws-data-pipeline
cdk init sample-app --language python
python3 -m venv .venv

activate the venv I ran .venv\Scripts\activate.bat bc windows

pip install -r requirements.txt
pytest

What did you expect to happen?

expected pytest to pass

What actually happened?

E     File "C:\Users\<...>\aws-data-pipeline\tests\unit\test_aws_data_pipe
E       from aws-data-pipeline.aws_data_pipeline_stack import AwsDataPipelineStack
E               ^
E   SyntaxError: invalid syntax

Environment

  • CDK CLI Version : 1.117.0 (build 0047c98)
  • Framework Version:
  • Node.js Version: v14.17.4
  • OS : windows10
  • Language (Version): Python 3.7.3

Other

I will pr a fix shortly. I could use some help getting the tests working though


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions