-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from jsteinich/win_python
Windows Python fixes
- Loading branch information
Showing
14 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"language": "python", | ||
"app": "pipenv run ./main.py", | ||
"app": "pipenv run python main.py", | ||
"terraformProviders": ["kubernetes@~> 1.11.3"], | ||
"codeMakerOutput": "imports" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ url = "https://pypi.org/simple" | |
verify_ssl = true | ||
|
||
[requires] | ||
python_version = "3.7" | ||
python_version = "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"language": "python", | ||
"app": "pipenv run ./main.py", | ||
"app": "pipenv run python main.py", | ||
"terraformProviders": ["aws@~> 2.0"], | ||
"codeMakerOutput": "imports" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
setlocal EnableExtensions | ||
setlocal EnableDelayedExpansion | ||
|
||
cd /D %~dp0 | ||
|
||
for /d %%d in ("test-*") do ( | ||
if exist "%%d\" ( | ||
if exist "%%d\test.js" ( | ||
echo -------------------------------------------------------------------- | ||
echo %%d | ||
echo -------------------------------------------------------------------- | ||
call node "%%d\test.js" | ||
IF !ERRORLEVEL! NEQ 0 exit /B 1 | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"language": "python", | ||
"app": "pipenv run ./main.py", | ||
"app": "pipenv run python main.py", | ||
"terraformProviders": ["aws@~> 2.0"], | ||
"terraformModules": ["terraform-aws-modules/vpc/[email protected]"], | ||
"codeMakerOutput": "imports" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const { execSync } = require('child_process'); | ||
const os = require('os'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const env = Object.assign({}, process.env); | ||
// Disable spinner even when we have a TTY | ||
env['CI'] = '1'; | ||
|
||
const scriptdir = __dirname; | ||
|
||
const projectPath = path.join(os.tmpdir(), 'test'); | ||
const folder = fs.mkdtempSync(projectPath); | ||
process.chdir(folder); | ||
|
||
// initialize an empty project | ||
execSync(`cdktf init --template python --project-name="python-test" --project-description="python test app" --local`, { stdio: 'inherit', env }); | ||
|
||
// put some code in it | ||
fs.copyFileSync(path.join(scriptdir, 'main.py'), 'main.py'); | ||
fs.copyFileSync(path.join(scriptdir, 'cdktf.json'), 'cdktf.json'); | ||
|
||
fs.rmdirSync('cdktf.out', { recursive: true }); | ||
|
||
// regenerate with module | ||
execSync(`cdktf get`, { stdio: 'inherit', env }); | ||
|
||
// build | ||
execSync('pipenv run python main.py', { stdio: 'inherit', env }) | ||
|
||
// get rid of downloaded Terraform providers, no point in diffing them | ||
fs.rmdirSync('cdktf.out/.terraform', { recursive: true }); | ||
|
||
// show output | ||
if (os.platform() === 'win32') { | ||
execSync(`fc cdktf.out\\* ${scriptdir}\\expected\\*`, { stdio: 'inherit', env }); | ||
} | ||
else { | ||
execSync(`diff cdktf.out ${scriptdir}/expected`, { stdio: 'inherit', env }); | ||
} | ||
|
||
console.log('PASS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off | ||
setlocal EnableExtensions | ||
setlocal EnableDelayedExpansion | ||
|
||
cd /D %~dp0\.. | ||
|
||
rmdir /Q /S dist | ||
mkdir dist | ||
|
||
for /f %%f in ('yarn lerna ls -p') do ( | ||
if exist "%%f\dist\" ( | ||
echo "collecting from %%f\dist | ||
xcopy /E %%f\dist\ dist\ | ||
) | ||
) |