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/.gitignore b/.gitignore index 894a44c..346fbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ venv.bak/ # mypy .mypy_cache/ + +.vscode/ 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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f740bf..e471566 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 @@ -21,10 +24,24 @@ steps: - script: | python -m pip install --upgrade pip + pip install -e ./libraries/botbuilder-community-dialogs-prompts pip install pytest pytest-azurepipelines - pip install -e .\libraries\botbuilder-community-dialogs-prompts\source + pip install coveralls + pip install pylint + pip install pytest + pip install pytest-cov displayName: 'Install dependencies' - script: | - python -m pytest libraries/ - displayName: 'pytest' + pytest --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov --cov-report=xml --cov-report=html + displayName: Pytest + +- task: PublishTestResults@2 + displayName: 'Publish Test Results **/test-results.xml' + inputs: + testResultsFiles: '**/test-results.xml' + 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 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..4c6524d --- /dev/null +++ b/libraries/botbuilder-community-dialogs-prompts/setup.py @@ -0,0 +1,48 @@ +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", +"aiounittest>=1.3.0" +] + +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