Skip to content

Commit

Permalink
Async consumers support (#188)
Browse files Browse the repository at this point in the history
* Added async consumers support
* Dropped support for Python 3.7
* Updated requirements
* bumped gh actions to the latest supported versions
* removed support for python 3.7
* added pre-fetching punkt_tab dependency in nltk
* Small fix to conflicting artifact upload
  • Loading branch information
NeonKirill authored Dec 4, 2024
1 parent 681da74 commit e1c3d21
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
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
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

0 comments on commit e1c3d21

Please sign in to comment.