From eb33f57dec7c2d4a659225744a238f86deff60ac Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Sun, 24 May 2020 22:48:39 -0400 Subject: [PATCH 01/11] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..7d405f9ee --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,36 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' +strategy: + matrix: + Python27: + python.version: '2.7' + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' From deccc721ea087b6d9f967708cec65e4a13ef5420 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Sun, 24 May 2020 23:48:43 -0400 Subject: [PATCH 02/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7d405f9ee..6b827fa12 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,7 @@ steps: displayName: 'Install dependencies' - script: | - pip install pytest pytest-azurepipelines - pytest + pip install pytest + pip install pytest-azurepipelines + pytest --disable-warnings displayName: 'pytest' From 1cda9c499cf1e66d69de83f20f9a6f9f4895f9e8 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:30:58 -0400 Subject: [PATCH 03/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b827fa12..fee9b4ce6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,12 +10,12 @@ pool: vmImage: 'ubuntu-latest' strategy: matrix: - Python27: - python.version: '2.7' - Python35: - python.version: '3.5' - Python36: - python.version: '3.6' + # Python27: + # python.version: '2.7' + # Python35: + # python.version: '3.5' + # Python36: + # python.version: '3.6' Python37: python.version: '3.7' @@ -33,5 +33,6 @@ steps: - script: | pip install pytest pip install pytest-azurepipelines + cd python-sample-vscode-flask-tutorial pytest --disable-warnings displayName: 'pytest' From d03f43ff8500f9798bada3dd60ab5b2e14e411a2 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:35:51 -0400 Subject: [PATCH 04/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fee9b4ce6..c60cc0381 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,6 +33,6 @@ steps: - script: | pip install pytest pip install pytest-azurepipelines - cd python-sample-vscode-flask-tutorial + cd /home/vsts/work/1/s/python-sample-vscode-flask-tutorial pytest --disable-warnings displayName: 'pytest' From 5eda0870ebeacb9f32d2eaf4875efe4728ffe59c Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:37:04 -0400 Subject: [PATCH 05/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c60cc0381..4843948be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,6 +33,7 @@ steps: - script: | pip install pytest pip install pytest-azurepipelines - cd /home/vsts/work/1/s/python-sample-vscode-flask-tutorial + # cd /home/vsts/work/1/s/python-sample-vscode-flask-tutorial + ls pytest --disable-warnings displayName: 'pytest' From 6d0873f2c10ac7778cfcb63d9707e582f9ed9ec6 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:38:51 -0400 Subject: [PATCH 06/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4843948be..8f37a6b5b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,6 +34,7 @@ steps: pip install pytest pip install pytest-azurepipelines # cd /home/vsts/work/1/s/python-sample-vscode-flask-tutorial + pwd ls pytest --disable-warnings displayName: 'pytest' From b0ee8f5f78ba8a9ce34256f9c5ac430860ef2390 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:41:44 -0400 Subject: [PATCH 07/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8f37a6b5b..914c02903 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,8 +33,5 @@ steps: - script: | pip install pytest pip install pytest-azurepipelines - # cd /home/vsts/work/1/s/python-sample-vscode-flask-tutorial - pwd - ls - pytest --disable-warnings + pytest test_test1.py displayName: 'pytest' From c1e7accc5930e3fbc6197d73c1f32fb91447f71c Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:46:41 -0400 Subject: [PATCH 08/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 914c02903..95898353c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,5 +33,5 @@ steps: - script: | pip install pytest pip install pytest-azurepipelines - pytest test_test1.py + # pytest test_test1.py displayName: 'pytest' From a53afeb5442b9019eb347300bf06411b11581db5 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 00:52:47 -0400 Subject: [PATCH 09/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d07d6d8ed..837067601 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://pranaykatta.visualstudio.com/PartsUnlimited/_apis/build/status/pkreddy.python-sample-vscode-flask-tutorial?branchName=master)](https://pranaykatta.visualstudio.com/PartsUnlimited/_build/latest?definitionId=5&branchName=master) + # Python/Flask tutorial sample for Visual Studio Code * This sample contains the completed program from the tutorial, make sure to visit the link: [Using Flask in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-flask). Intermediate steps are not included. From d8f73e02a31584972dbdc7d42282c9acc26e5ed6 Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 14:29:25 -0400 Subject: [PATCH 10/11] syntax test python files --- proj/folder1/test1.py | 1 + proj/folder1/test2.py | 1 + proj/folder1/test3.py | 1 + proj/folder2/test1.py | 1 + proj/folder2/test2.py | 1 + proj/folder2/test3.py | 1 + proj/folder3/test1.py | 1 + proj/folder3/test2.py | 1 + proj/folder3/test3.py | 1 + syntax-test.py | 16 ++++++++++++++++ test-output.xml | 1 + test_test1.py | 1 - 12 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 proj/folder1/test1.py create mode 100644 proj/folder1/test2.py create mode 100644 proj/folder1/test3.py create mode 100644 proj/folder2/test1.py create mode 100644 proj/folder2/test2.py create mode 100644 proj/folder2/test3.py create mode 100644 proj/folder3/test1.py create mode 100644 proj/folder3/test2.py create mode 100644 proj/folder3/test3.py create mode 100644 syntax-test.py create mode 100644 test-output.xml delete mode 100644 test_test1.py diff --git a/proj/folder1/test1.py b/proj/folder1/test1.py new file mode 100644 index 000000000..2b7c7d179 --- /dev/null +++ b/proj/folder1/test1.py @@ -0,0 +1 @@ +print("fodler1.test1") diff --git a/proj/folder1/test2.py b/proj/folder1/test2.py new file mode 100644 index 000000000..876b96d55 --- /dev/null +++ b/proj/folder1/test2.py @@ -0,0 +1 @@ +print("fodler1.test2") \ No newline at end of file diff --git a/proj/folder1/test3.py b/proj/folder1/test3.py new file mode 100644 index 000000000..876b96d55 --- /dev/null +++ b/proj/folder1/test3.py @@ -0,0 +1 @@ +print("fodler1.test2") \ No newline at end of file diff --git a/proj/folder2/test1.py b/proj/folder2/test1.py new file mode 100644 index 000000000..3cd4c7f37 --- /dev/null +++ b/proj/folder2/test1.py @@ -0,0 +1 @@ +print("fodler2.test1") diff --git a/proj/folder2/test2.py b/proj/folder2/test2.py new file mode 100644 index 000000000..bcfe53fbc --- /dev/null +++ b/proj/folder2/test2.py @@ -0,0 +1 @@ +print("fodler2.test2") \ No newline at end of file diff --git a/proj/folder2/test3.py b/proj/folder2/test3.py new file mode 100644 index 000000000..510f60de4 --- /dev/null +++ b/proj/folder2/test3.py @@ -0,0 +1 @@ +print("fodler2.test3") \ No newline at end of file diff --git a/proj/folder3/test1.py b/proj/folder3/test1.py new file mode 100644 index 000000000..3cd4c7f37 --- /dev/null +++ b/proj/folder3/test1.py @@ -0,0 +1 @@ +print("fodler2.test1") diff --git a/proj/folder3/test2.py b/proj/folder3/test2.py new file mode 100644 index 000000000..bcfe53fbc --- /dev/null +++ b/proj/folder3/test2.py @@ -0,0 +1 @@ +print("fodler2.test2") \ No newline at end of file diff --git a/proj/folder3/test3.py b/proj/folder3/test3.py new file mode 100644 index 000000000..510f60de4 --- /dev/null +++ b/proj/folder3/test3.py @@ -0,0 +1 @@ +print("fodler2.test3") \ No newline at end of file diff --git a/syntax-test.py b/syntax-test.py new file mode 100644 index 000000000..667c9d954 --- /dev/null +++ b/syntax-test.py @@ -0,0 +1,16 @@ +print(" ******* python syntax test begins *********") + +import glob +import os +import py_compile + +my_path = os.getcwd() +main_folder = "proj" +files = glob.iglob(my_path + '/'+main_folder+'/**/*.py', recursive=True) + +for i in files: + print(i) + py_compile.compile(i) + + +print(" ******* python syntax test ends *********") \ No newline at end of file diff --git a/test-output.xml b/test-output.xml new file mode 100644 index 000000000..f6bd761c8 --- /dev/null +++ b/test-output.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test_test1.py b/test_test1.py deleted file mode 100644 index df1dc6821..000000000 --- a/test_test1.py +++ /dev/null @@ -1 +0,0 @@ -print('Hello World') From 50f858e61459080cbcd993ea656013f5b72e8cfe Mon Sep 17 00:00:00 2001 From: Pranay Katta Date: Mon, 25 May 2020 14:31:13 -0400 Subject: [PATCH 11/11] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 95898353c..bde0a734d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,7 +31,6 @@ steps: displayName: 'Install dependencies' - script: | - pip install pytest - pip install pytest-azurepipelines + python syntax-test.py # pytest test_test1.py displayName: 'pytest'