Skip to content
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

Async consumers support #188

Merged
merged 6 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,44 @@ jobs:
unit_tests:
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9]
python-version: [ 3.8, 3.9]
# TODO: 3.10 and 3.11 need support in klat-connector
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[lang] -r requirements/test_requirements.txt
python -m nltk.downloader punkt_tab
env:
GITHUB_TOKEN: ${{secrets.neon_token}}
- name: Test with pytest
run: |
pip install pytest pytest-timeout pytest-cov
pytest tests/units --doctest-modules --junitxml=tests/unit-test-results.xml
- name: Upload pytest unit test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: unit-test-results
name: unit-test-results-${{ matrix.python-version }}
path: tests/unit-test-results.xml
integration_tests:
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ 3.8, 3.9 ]
# TODO: 3.10 and 3.11 need support in klat-connector
max-parallel: 1
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -59,7 +60,7 @@ jobs:
pip install pytest pytest-timeout pytest-cov
pytest tests/integration --doctest-modules --junitxml=tests/integration-test-results.xml
- name: Upload integration test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: integration-test-results
name: integration-test-results-${{ matrix.python-version }}
path: tests/integration-test-results.xml
4 changes: 3 additions & 1 deletion chatbot_core/v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
#
# Copyright 2008-2021 Neongecko.com Inc. | All Rights Reserved
# Copyright 2008-2024 Neongecko.com Inc. | All Rights Reserved
#
# Notice of License - Duplicating this Notice of License near the start of any file containing
# a derivative of this software is a condition of license for this software.
Expand Down Expand Up @@ -32,6 +32,8 @@
class ChatBot(KlatAPIMQ, ChatBotABC):
"""MQ-based chatbot implementation"""

async_consumers_enabled = True

def __init__(self, *args, **kwargs):
config, service_name, vhost, bot_type = self.parse_init(*args, **kwargs)
mq_config = config.get("MQ") or config
Expand Down
8 changes: 4 additions & 4 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
click~=8.0
klat-connector==0.6.2a15
neon-mq-connector==0.7.2a5
Comment on lines +2 to +3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider leaving these as:

klat-connector~=0.6,>=0.6.2a15
neon-mq-connector~=0.7,>=0.7.2a5

so that they don't need to be updated for each release of these dependencies

neon_utils[network]~=1.0
ovos-bus-client~=0.0.5
klat-connector>=0.6.2a15
psutil~=5.7
neon_utils[network]~=1.0
neon-mq-connector~=0.7,>=0.7.1
click~=8.0
Loading