-
Notifications
You must be signed in to change notification settings - Fork 4k
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: Make activating Python virtualenv easier on Windows #5014
Conversation
The command for activating a Python virtualenv on Linux or Mac OS X is: `source .env/bin/activate` The command for doing it on Windows is: `.env\Scripts\activate.bat` This adds `source.bat` to our Python templates. It's a simple batch file that lets the Linux/Mac virtualenv activating command work on Windows. That way, when we tell users to activate their virtualenv in documentation, we need only give the Linux/Mac command, and it'll work even on Windows. (Windows `cmd.exe` doesn't have a `source` command, so this doesn't block any functionality that Windows users are accustomed to.)
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
I think this is a nice quality-of-life improvement. As long as there is no conflict with existing Windows interactions and we make it clear to the user what is actually happening, I think this will make a positive change to reduce user friction. |
@jakerullman I could add an |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@jerry-aws That's a good idea, I think displaying the command actually being run would remove any potential user confusion. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
The command for activating a Python virtualenv on Linux or Mac OS X is:
source .env/bin/activate
The command for doing it on Windows is:
.env\Scripts\activate.bat
This PR adds
source.bat
to our Python templates. It's a simple batch file that lets the Linux/Mac virtualenv activating command work on Windows. That way, when we tell users to activate their virtualenv in documentation, we need only give the Linux/Mac command, and it'll work even on Windows. (Windowscmd.exe
doesn't have asource
command, so this doesn't block any functionality that Windows users are accustomed to.)Came up with this idea when working on the Python snippets for the Dev Guide.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license