From 9b481330b52198209089926de45b669b86a46c5e Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 18:57:11 +0000 Subject: [PATCH 1/8] Updates for CI / pipelines --- .gitignore | 2 + .../requirements.txt | 5 ++ .../setup.py | 47 +++++++++++++++++++ .../source/__init__.py | 4 +- .../source/about.py | 11 +++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 libraries/botbuilder-community-dialogs-prompts/requirements.txt create mode 100644 libraries/botbuilder-community-dialogs-prompts/setup.py create mode 100644 libraries/botbuilder-community-dialogs-prompts/source/about.py diff --git a/.gitignore b/.gitignore index 894a44c..346fbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ venv.bak/ # mypy .mypy_cache/ + +.vscode/ diff --git a/libraries/botbuilder-community-dialogs-prompts/requirements.txt b/libraries/botbuilder-community-dialogs-prompts/requirements.txt new file mode 100644 index 0000000..0245962 --- /dev/null +++ b/libraries/botbuilder-community-dialogs-prompts/requirements.txt @@ -0,0 +1,5 @@ +aiounittest>=1.3.0 +botbuilder-core>=4.5.0b5 +botbuilder-schema>=4.5.0b5 +botbuilder-dialogs>=4.5.0b5 +recognizers_text_suite>=1.0.2a2 \ No newline at end of file diff --git a/libraries/botbuilder-community-dialogs-prompts/setup.py b/libraries/botbuilder-community-dialogs-prompts/setup.py new file mode 100644 index 0000000..12b6d70 --- /dev/null +++ b/libraries/botbuilder-community-dialogs-prompts/setup.py @@ -0,0 +1,47 @@ +import os +from setuptools import setup + +REQUIRES = [ +"botbuilder-core>=4.5.0b5", +"botbuilder-schema>=4.5.0b5", +"botbuilder-dialogs>=4.5.0b5", +"recognizers_text_suite>=1.0.2a2" +] + +TESTS_REQUIRES = ["aiounittest>=1.3.0"] + +root = os.path.abspath(os.path.dirname(__file__)) + +with open(os.path.join(root, "source", "about.py")) as f: + package_info = {} + info = f.read() + exec(info, package_info) + +with open(os.path.join(root, "README.md"), encoding="utf-8") as f: + long_description = f.read() + +setup( + name=package_info["__title__"], + version=package_info["__version__"], + url=package_info["__uri__"], + author=package_info["__author__"], + description=package_info["__description__"], + keywords="botbuilder bots ai botframework dialogs prompts", + long_description=long_description, + long_description_content_type="text/markdown", + license=package_info["__license__"], + packages=[ + "source", + ], + install_requires=REQUIRES + TESTS_REQUIRES, + tests_require=TESTS_REQUIRES, + include_package_data=True, + classifiers=[ + "Programming Language :: Python :: 3.7", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Development Status :: 3 - Alpha", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + ], +) \ No newline at end of file diff --git a/libraries/botbuilder-community-dialogs-prompts/source/__init__.py b/libraries/botbuilder-community-dialogs-prompts/source/__init__.py index 628a434..50b42eb 100644 --- a/libraries/botbuilder-community-dialogs-prompts/source/__init__.py +++ b/libraries/botbuilder-community-dialogs-prompts/source/__init__.py @@ -1,3 +1,4 @@ +from .about import __version__ from number_with_type_prompt import NumberWithTypePrompt, NumberWithTypePromptType from number_with_unit_prompt import NumberWithUnitPrompt, NumberWithUnitPromptType,NumberWithUnitResult from phone_prompt import PhoneNumberPrompt @@ -15,5 +16,6 @@ "EmailPrompt", "InternetProtocolPrompt", "InternetProtocolPromptType", - "GuidPrompt" + "GuidPrompt", + "__version__" ] \ No newline at end of file diff --git a/libraries/botbuilder-community-dialogs-prompts/source/about.py b/libraries/botbuilder-community-dialogs-prompts/source/about.py new file mode 100644 index 0000000..2d315eb --- /dev/null +++ b/libraries/botbuilder-community-dialogs-prompts/source/about.py @@ -0,0 +1,11 @@ +import os + +__title__ = "botbuilder-community-dialogs-prompts" +__version__ = ( + os.environ["packageVersion"] if "packageVersion" in os.environ else "0.1.0" +) +__uri__ = "https://www.github.com/Microsoft/botbuilder-python" +__author__ = "Bot Builder Community" +__description__ = "Microsoft Bot Builder Community Dialogs Prompts" +__summary__ = "Dialogs Prompts from the Bot Builder Community for Microsoft Bot Builder SDK for Python" +__license__ = "MIT" \ No newline at end of file From 736ecc7ab2fb95f544dbd06b7099f4e8554bd577 Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 18:58:23 +0000 Subject: [PATCH 2/8] Update pipelines yml --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f740bf..9315ef4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,9 +22,8 @@ steps: - script: | python -m pip install --upgrade pip pip install pytest pytest-azurepipelines - pip install -e .\libraries\botbuilder-community-dialogs-prompts\source displayName: 'Install dependencies' - script: | python -m pytest libraries/ - displayName: 'pytest' + displayName: 'pytest' \ No newline at end of file From be462ffdad1b663497c20fd05d833bb21937a506 Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 19:39:43 +0000 Subject: [PATCH 3/8] More updates for pipelines --- .coveragerc | 4 ++++ azure-pipelines.yml | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..43925cd --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +source = ./libraries/ +omit = + */tests/* \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9315ef4..148d069 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,9 +21,22 @@ steps: - script: | python -m pip install --upgrade pip + pip install -e ./libraries/botbuilder-community-dialogs-prompts pip install pytest pytest-azurepipelines + pip install coveralls + pip install pylint + pip install pytest + pip install pytest-cov displayName: 'Install dependencies' +steps: - script: | - python -m pytest libraries/ - displayName: 'pytest' \ No newline at end of file + pytest --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov --cov-report=xml --cov-report=html + displayName: Pytest + + steps: +- task: PublishTestResults@2 + displayName: 'Publish Test Results **/test-results.xml' + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' \ No newline at end of file From 0d7f661096c187b262346548932ffadef97335af Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 19:43:41 +0000 Subject: [PATCH 4/8] Updated dependencies --- libraries/botbuilder-community-dialogs-prompts/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/botbuilder-community-dialogs-prompts/setup.py b/libraries/botbuilder-community-dialogs-prompts/setup.py index 12b6d70..4c6524d 100644 --- a/libraries/botbuilder-community-dialogs-prompts/setup.py +++ b/libraries/botbuilder-community-dialogs-prompts/setup.py @@ -5,7 +5,8 @@ "botbuilder-core>=4.5.0b5", "botbuilder-schema>=4.5.0b5", "botbuilder-dialogs>=4.5.0b5", -"recognizers_text_suite>=1.0.2a2" +"recognizers_text_suite>=1.0.2a2", +"aiounittest>=1.3.0" ] TESTS_REQUIRES = ["aiounittest>=1.3.0"] From c468a40b698d4760bd50c4302f6c002c84ac44ae Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 19:45:54 +0000 Subject: [PATCH 5/8] Update yml --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 148d069..736af13 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,12 +29,10 @@ steps: pip install pytest-cov displayName: 'Install dependencies' -steps: - script: | pytest --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov --cov-report=xml --cov-report=html displayName: Pytest - steps: - task: PublishTestResults@2 displayName: 'Publish Test Results **/test-results.xml' inputs: From 9bfd8ebad828bd87878177fc9ffe45731829e9ff Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 20:04:24 +0000 Subject: [PATCH 6/8] Update coveralls settings and CI triggers --- azure-pipelines.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 736af13..da4b75d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,13 +5,16 @@ trigger: - master +- develop +- release/* +- feature/* pool: vmImage: 'ubuntu-latest' strategy: matrix: Python37: - python.version: '3.7' + python.version: '3.7.5' steps: - task: UsePythonVersion@0 @@ -27,8 +30,12 @@ steps: pip install pylint pip install pytest pip install pytest-cov + pip install black displayName: 'Install dependencies' +- script: 'black --check libraries' + displayName: 'Check Black compliant' + - script: | pytest --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov --cov-report=xml --cov-report=html displayName: Pytest @@ -37,4 +44,8 @@ steps: displayName: 'Publish Test Results **/test-results.xml' inputs: testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version)' \ No newline at end of file + testRunTitle: 'Python $(python.version)' + +- script: 'COVERALLS_REPO_TOKEN=sB4xSe7ZSZE3VgaoGvi7MVApbZD2x0n2T coveralls' + displayName: 'Push test results to coveralls https://coveralls.io/github/BotBuilderCommunity/botbuilder-community-python' + continueOnError: true \ No newline at end of file From 914816ad92bcf7e5d9b052a6c6582b9048659bbd Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 20:07:49 +0000 Subject: [PATCH 7/8] Remove black dependency and check --- azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index da4b75d..e471566 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,12 +30,8 @@ steps: pip install pylint pip install pytest pip install pytest-cov - pip install black displayName: 'Install dependencies' -- script: 'black --check libraries' - displayName: 'Check Black compliant' - - script: | pytest --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov --cov-report=xml --cov-report=html displayName: Pytest From 93b8151eb54b8e791867ef779ab8cc5101b94bc7 Mon Sep 17 00:00:00 2001 From: Gary Pretty Date: Sat, 23 Nov 2019 20:11:34 +0000 Subject: [PATCH 8/8] Added coveralls and pipelines badges to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b5ac3f6..801cf9f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Bot Builder Community - Python Extensions +[![Build Status](https://dev.azure.com/BotBuilder-Community/python/_apis/build/status/BotBuilderCommunity.botbuilder-community-python?branchName=develop)](https://dev.azure.com/BotBuilder-Community/python/_build/latest?definitionId=4&branchName=develop) [![Coverage Status](https://coveralls.io/repos/github/BotBuilderCommunity/botbuilder-community-python/badge.svg?branch=develop)](https://coveralls.io/github/BotBuilderCommunity/botbuilder-community-python?branch=develop) + This repository is part of the Bot Builder Community Project and contains Bot Builder Extensions for the Python SDK, including middleware, dialogs, helpers and more. Other repos within the Bot Builder Community Project exist for extensions for [JavaScript](https://github.com/BotBuilderCommunity/botbuilder-community-js), [.NET](https://github.com/BotBuilderCommunity/botbuilder-community-dotnet), [Java](https://github.com/BotBuilderCommunity/botbuilder-community-java) and [tools](https://github.com/BotBuilderCommunity/botbuilder-community-tools) - you can find our other repos under [our GitHub organisation for the project](https://github.com/BotBuilderCommunity/). To see a list of current extensions available for the Bot Builder Python SDK, use the links below to jump to a section