diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml new file mode 100644 index 0000000..4eebdac --- /dev/null +++ b/.github/workflows/build-tests.yml @@ -0,0 +1,15 @@ +name: Build Tests + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + build: + uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev + secrets: inherit + with: + python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + install_extras: 'test' + test_path: 'test' diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml deleted file mode 100644 index d000cec..0000000 --- a/.github/workflows/build_tests.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Run Build Tests -on: - push: - branches: - - master - pull_request: - branches: - - dev - workflow_dispatch: - -jobs: - py_build_tests: - uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master - with: - test_manifest: true - manifest_ignored: "test/**,scripts/**,CHANGELOG.md,translations/**" - pip_audit: - strategy: - max-parallel: 2 - matrix: - python-version: [ "3.10" ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Install skill - run: | - pip install . - - uses: pypa/gh-action-pip-audit@v1.0.8 - with: - # Ignore setuptools vulnerability we can't do much about - # Ignore numpy vulnerability affecting latest version for Py3.7 - ignore-vulns: | - GHSA-r9hx-vwmv-q579 - GHSA-fpfv-jqm9-f5jm - PYSEC-2022-43012 diff --git a/.github/workflows/conventional-label.yaml b/.github/workflows/conventional-label.yml similarity index 77% rename from .github/workflows/conventional-label.yaml rename to .github/workflows/conventional-label.yml index 0a449cb..9894c1b 100644 --- a/.github/workflows/conventional-label.yaml +++ b/.github/workflows/conventional-label.yml @@ -7,4 +7,4 @@ jobs: label: runs-on: ubuntu-latest steps: - - uses: bcoe/conventional-release-labels@v1 \ No newline at end of file + - uses: bcoe/conventional-release-labels@v1 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..7db81ee --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,17 @@ +name: Code Coverage + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + coverage: + uses: OpenVoiceOS/gh-automations/.github/workflows/coverage.yml@dev + secrets: inherit + with: + python_version: '3.11' + coverage_source: 'ovos_skill_mark1_ctrl' + test_path: 'test/' + install_extras: '.[test]' + min_coverage: 0 diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml new file mode 100644 index 0000000..8757eee --- /dev/null +++ b/.github/workflows/license_check.yml @@ -0,0 +1,11 @@ +name: License Check + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + license_check: + uses: OpenVoiceOS/gh-automations/.github/workflows/license-check.yml@dev + secrets: inherit diff --git a/.github/workflows/license_tests.yml b/.github/workflows/license_tests.yml deleted file mode 100644 index b990282..0000000 --- a/.github/workflows/license_tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Run License Tests -on: - push: - branches: - - master - pull_request: - branches: - - dev - workflow_dispatch: - -jobs: - license_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt install python3-dev swig libssl-dev - - name: Install core repo - run: | - pip install . - - name: Get explicit and transitive dependencies - run: | - pip freeze > requirements.txt - - name: Check python - id: license_check_report - uses: pilosus/action-pip-license-checker@v0.5.0 - with: - requirements: 'requirements.txt' - fail: 'Copyleft,Other,Error' - fails-only: true - exclude: '^(tqdm|ovos-skill-mark1-ctrl).*' - exclude-license: '^(Mozilla).*$' - - name: Print report - if: ${{ always() }} - run: echo "${{ steps.license_check_report.outputs.report }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..9a6b7a5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,14 @@ +name: Lint + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + lint: + uses: OpenVoiceOS/gh-automations/.github/workflows/lint.yml@dev + secrets: inherit + with: + ruff: true + pre_commit: false # set true if .pre-commit-config.yaml exists diff --git a/.github/workflows/ovoscope.yml b/.github/workflows/ovoscope.yml new file mode 100644 index 0000000..ed33f2f --- /dev/null +++ b/.github/workflows/ovoscope.yml @@ -0,0 +1,16 @@ +name: Skill End-to-End Tests (ovoscope) + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + ovoscope: + uses: OpenVoiceOS/gh-automations/.github/workflows/ovoscope.yml@dev + secrets: inherit + with: + python_version: '3.11' + install_extras: 'test' + test_path: 'test/end2end/' + require_adapt: true diff --git a/.github/workflows/pip_audit.yml b/.github/workflows/pip_audit.yml new file mode 100644 index 0000000..bb3ca4d --- /dev/null +++ b/.github/workflows/pip_audit.yml @@ -0,0 +1,11 @@ +name: PIP Audit + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + pip_audit: + uses: OpenVoiceOS/gh-automations/.github/workflows/pip-audit.yml@dev + secrets: inherit diff --git a/.github/workflows/publish_stable.yml b/.github/workflows/publish_stable.yml index 12395a5..bd3f099 100644 --- a/.github/workflows/publish_stable.yml +++ b/.github/workflows/publish_stable.yml @@ -1,58 +1,23 @@ -name: Stable Release +name: Publish Stable Release + on: - push: - branches: [master] workflow_dispatch: + push: + branches: [master, main] + +permissions: + contents: write # required for version bump commit and release tag jobs: publish_stable: - uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master - secrets: inherit + if: github.actor != 'github-actions[bot]' + uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }} with: - branch: 'master' version_file: 'version.py' - setup_py: 'setup.py' + publish_pypi: true publish_release: true - - publish_pypi: - needs: publish_stable - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: version - run: echo "::set-output name=version::$(python setup.py --version)" - id: version - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} - - - sync_dev: - needs: publish_stable - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - ref: master - - name: Push master -> dev - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: dev \ No newline at end of file + sync_dev: true + notify_matrix: true diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml new file mode 100644 index 0000000..1367df4 --- /dev/null +++ b/.github/workflows/release-preview.yml @@ -0,0 +1,14 @@ +name: Release Preview + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + release_preview: + uses: OpenVoiceOS/gh-automations/.github/workflows/release-preview.yml@dev + secrets: inherit + with: + package_name: 'ovos_skill_mark1_ctrl' + version_file: 'version.py' diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index a7fc218..8223526 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -1,108 +1,28 @@ name: Release Alpha and Propose Stable on: + workflow_dispatch: pull_request: types: [closed] branches: [dev] +permissions: + contents: write + pull-requests: write + jobs: publish_alpha: - if: github.event.pull_request.merged == true - uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master - secrets: inherit + if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + uses: OpenVoiceOS/gh-automations/.github/workflows/publish-alpha.yml@dev + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }} with: branch: 'dev' version_file: 'version.py' - setup_py: 'setup.py' update_changelog: true publish_prerelease: true - changelog_max_issues: 100 - - notify: - if: github.event.pull_request.merged == true - needs: publish_alpha - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Send message to Matrix bots channel - id: matrix-chat-message - uses: fadenb/matrix-chat-message@v0.0.6 - with: - homeserver: 'matrix.org' - token: ${{ secrets.MATRIX_TOKEN }} - channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org' - message: | - new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }} - - publish_pypi: - needs: publish_alpha - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: "3.14" - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: version - run: echo "::set-output name=version::$(python setup.py --version)" - id: version - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} - - - propose_release: - needs: publish_alpha - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - name: Checkout dev branch - uses: actions/checkout@v6 - with: - ref: dev - - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: '3.14' - - - name: Get version from setup.py - id: get_version - run: | - VERSION=$(python setup.py --version) - echo "VERSION=$VERSION" >> $GITHUB_ENV - - - name: Create and push new branch - run: | - git checkout -b release-${{ env.VERSION }} - git push origin release-${{ env.VERSION }} - - - name: Open Pull Request from dev to master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Variables - BRANCH_NAME="release-${{ env.VERSION }}" - BASE_BRANCH="master" - HEAD_BRANCH="release-${{ env.VERSION }}" - PR_TITLE="Release ${{ env.VERSION }}" - PR_BODY="Human review requested!" - - # Create a PR using GitHub API - curl -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \ - https://api.github.com/repos/${{ github.repository }}/pulls - + propose_release: true + changelog_max_issues: 50 + publish_pypi: true + notify_matrix: true diff --git a/.github/workflows/repo-health.yml b/.github/workflows/repo-health.yml new file mode 100644 index 0000000..04f4f64 --- /dev/null +++ b/.github/workflows/repo-health.yml @@ -0,0 +1,13 @@ +name: Repo Health + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + repo_health: + uses: OpenVoiceOS/gh-automations/.github/workflows/repo-health.yml@dev + secrets: inherit + with: + version_file: 'version.py' diff --git a/.github/workflows/skill-check.yml b/.github/workflows/skill-check.yml new file mode 100644 index 0000000..ebcfd68 --- /dev/null +++ b/.github/workflows/skill-check.yml @@ -0,0 +1,15 @@ +name: Skill Check + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + skill_check: + uses: OpenVoiceOS/gh-automations/.github/workflows/skill-check.yml@dev + secrets: inherit + with: + fail_on_missing_en_us: true + fail_on_invalid_skill_json: false + skip_if_not_skill: true diff --git a/.github/workflows/sync_tx.yml b/.github/workflows/sync_tx.yml deleted file mode 100644 index 124ecd3..0000000 --- a/.github/workflows/sync_tx.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Run script on merge to dev by gitlocalize-app - -on: - workflow_dispatch: - push: - branches: - - dev - -jobs: - run-script: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v6 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: 3.14 - - - name: Run script if manual dispatch - if: github.event_name == 'workflow_dispatch' - run: | - python scripts/sync_translations.py - - - name: Run script if merged by gitlocalize-app[bot] - if: github.event_name == 'push' && github.event.head_commit.author.username == 'gitlocalize-app[bot]' - run: | - python scripts/sync_translations.py - - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Update translations - branch: dev diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index 9ba44b1..0000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Run UnitTests -on: - pull_request: - branches: - - dev - paths-ignore: - - 'version.py' - - 'requirements.txt' - - 'examples/**' - - '.github/**' - - '.gitignore' - - 'LICENSE' - - 'CHANGELOG.md' - - 'MANIFEST.in' - - 'readme.md' - - 'scripts/**' - push: - branches: - - master - paths-ignore: - - 'version.py' - - 'requirements.txt' - - 'examples/**' - - '.github/**' - - '.gitignore' - - 'LICENSE' - - 'CHANGELOG.md' - - 'MANIFEST.in' - - 'readme.md' - - 'scripts/**' - workflow_dispatch: - -jobs: - unit_tests: - strategy: - max-parallel: 2 - matrix: - python-version: [ 3.9, "3.10" ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Set up python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt install python3-dev - python -m pip install build wheel - - name: Install core repo - run: | - pip install . - - name: Install test dependencies - run: | - pip install pytest pytest-timeout pytest-cov - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt install libfann-dev - - name: Install ovos dependencies - run: | - pip install ovos-plugin-manager ovos-core[skills_lgpl]>=0.0.5a28 - - name: Run unittests - run: | - pytest --cov=ovos-skill-template-repo --cov-report xml test/unittests - # NOTE: additional pytest invocations should also add the --cov-append flag - # or they will overwrite previous invocations' coverage reports - # (for an example, see OVOS Skill Manager's workflow) - - name: Upload coverage - env: - CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} - uses: codecov/codecov-action@v2 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e217288 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "ovos-skill-mark1-ctrl" +dynamic = ["version"] +description = "OVOS Mark 1 enclosure control skill" +readme = "README.md" +license = { text = "Apache-2.0" } +authors = [ + { name = "JarbasAi", email = "jarbasai@mailfence.com" } +] +keywords = ["ovos", "skill", "plugin"] +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3", +] +requires-python = ">=3.9" +dependencies = [ + "ovos-plugin-manager>=2.1.0,<3.0.0", + "ovos-color-parser>=0.0.8a1", + "ovos-i2c-detection>=0.0.6a1", + "ovos-workshop<9.0.0", +] + +[project.optional-dependencies] +test = [ + "ovoscope>=0.13.1,<1.0.0", + "pytest>=7.0.0,<9", + "pytest-timeout>=2.0.0", + "ovos-adapt-parser", +] + +[project.urls] +Homepage = "https://github.com/OpenVoiceOS/ovos-skill-mark1-ctrl" + +[project.entry-points."opm.skill"] +"ovos-skill-mark1-ctrl.openvoiceos" = "ovos_skill_mark1_ctrl:EnclosureControlSkill" + +[tool.setuptools.dynamic] +version = { attr = "version.__version__" } + +[tool.setuptools] +packages = ["ovos_skill_mark1_ctrl"] + +[tool.setuptools.package-dir] +"ovos_skill_mark1_ctrl" = "." + +[tool.setuptools.package-data] +"ovos_skill_mark1_ctrl" = [ + "*.json", + "locale/**/*", + "ui/**/*", + "vocab/**/*", + "dialog/**/*", + "regex/**/*", + "res/**/*", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index bf48597..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ovos-color-parser>=0.0.8a1 -ovos-i2c-detection>=0.0.6a1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 037017c..0000000 --- a/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 -from setuptools import setup -from os.path import abspath, dirname, join, isfile, isdir -from os import walk, environ - -# Define package information -SKILL_CLAZZ = "EnclosureControlSkill" # Make sure it matches __init__.py class name -VERSION = "0.0.1" -URL = "https://github.com/OVOSHatchery/ovos-skill-mark1-ctrl" -AUTHOR = "OpenVoiceOS" -EMAIL = "jarbasai@mailfence.com" -LICENSE = "Apache2.0" -DESCRIPTION = SKILL_CLAZZ # TODO - -PYPI_NAME = URL.split("/")[-1] # pip install PYPI_NAME - -# Construct entry point for plugin -SKILL_ID = f"{PYPI_NAME.lower()}.{AUTHOR.lower()}" -SKILL_PKG = PYPI_NAME.lower().replace('-', '_') -PLUGIN_ENTRY_POINT = f"{SKILL_ID}={SKILL_PKG}:{SKILL_CLAZZ}" - - -# Function to parse requirements from file -def get_requirements(requirements_filename: str = "requirements.txt"): - requirements_file = join(abspath(dirname(__file__)), requirements_filename) - if isfile(requirements_file): - with open(requirements_file, 'r', encoding='utf-8') as r: - requirements = r.readlines() - requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")] - if 'MYCROFT_LOOSE_REQUIREMENTS' in environ: - print('USING LOOSE REQUIREMENTS!') - requirements = [r.replace('==', '>=').replace('~=', '>=') for r in requirements] - return requirements - return [] - - -# Function to find resource files -def find_resource_files(): - resource_base_dirs = ("locale", "ui", "locale", "dialog", "regex", "res") - base_dir = abspath(dirname(__file__)) - package_data = ["*.json"] - for res in resource_base_dirs: - if isdir(join(base_dir, res)): - for (directory, _, files) in walk(join(base_dir, res)): - if files: - package_data.append(join(directory.replace(base_dir, "").lstrip('/'), '*')) - return package_data - - -# Setup configuration -setup( - name=PYPI_NAME, - version=VERSION, - description=DESCRIPTION, - url=URL, - author=AUTHOR, - author_email=EMAIL, - license=LICENSE, - package_dir={SKILL_PKG: ""}, - package_data={SKILL_PKG: find_resource_files()}, - packages=[SKILL_PKG], - include_package_data=True, - install_requires=get_requirements(), - keywords='ovos skill plugin', - entry_points={'ovos.plugin.skill': PLUGIN_ENTRY_POINT} -) diff --git a/test/end2end/test_intents_en_us.py b/test/end2end/test_intents_en_us.py new file mode 100644 index 0000000..2978d12 --- /dev/null +++ b/test/end2end/test_intents_en_us.py @@ -0,0 +1,99 @@ +"""E2E intent-routing tests for ovos-skill-mark1-ctrl. + +The Mark 1 enclosure skill is hardware-bound: its handlers drive the faceplate +via the enclosure bus API. These tests assert ADAPT intent routing and handler +completion on the message bus only -- no live hardware is required. Speak and +sound-effect messages are ignored so the tests pass headless. + +Run: pytest test/end2end/ -v +""" +from unittest import TestCase + +from ovos_bus_client.message import Message +from ovos_bus_client.session import Session +from ovoscope import End2EndTest, get_minicroft + +SKILL_ID = "ovos-skill-mark1-ctrl.openvoiceos" +LANG = "en-US" + + +class _IntentRoutingMixin: + """Shared MiniCroft setup.""" + + @classmethod + def setUpClass(cls): + cls.minicroft = get_minicroft([SKILL_ID]) + + @classmethod + def tearDownClass(cls): + if getattr(cls, 'minicroft', None): + cls.minicroft.stop() + + def _assert_adapt(self, utterance: str, intent_label: str = ''): + intent_msg_type = f"{SKILL_ID}:{intent_label}" if intent_label else None + session = Session(f"e2e-en_us-adapt-{hash(utterance)}") + session.lang = LANG + session.pipeline = [ + "ovos-adapt-pipeline-plugin-high", + "ovos-adapt-pipeline-plugin-medium", + "ovos-adapt-pipeline-plugin-low", + ] + message = Message( + "recognizer_loop:utterance", + {"utterances": [utterance], "lang": LANG}, + {"session": session.serialize()}, + ) + activation_points = [intent_msg_type] if intent_msg_type else [] + expected = [ + message, + Message(f"{SKILL_ID}.activate", {}, {"skill_id": SKILL_ID}), + Message("mycroft.skill.handler.start", {}, {"skill_id": SKILL_ID}), + Message("mycroft.skill.handler.complete", {}, {"skill_id": SKILL_ID}), + Message("ovos.utterance.handled", {}, {"skill_id": SKILL_ID}), + ] + if intent_msg_type: + expected.insert(2, Message(intent_msg_type, {}, {"skill_id": SKILL_ID})) + test = End2EndTest( + minicroft=self.minicroft, + skill_ids=[SKILL_ID], + eof_msgs=["ovos.utterance.handled"], + flip_points=["recognizer_loop:utterance"], + source_message=message, + activation_points=activation_points, + test_msg_context=False, + test_message_number=False, + ignore_messages=["speak", "mycroft.audio.play_sound"], + expected_messages=expected, + ) + test.execute(timeout=30) + + +class TestAdapt1_EnclosureLookRight(_IntentRoutingMixin, TestCase): + """Adapt intent: EnclosureLookRight (require look + right)""" + + def test_look_right(self): + self._assert_adapt(r"look right", r"EnclosureLookRight") + + def test_look_right_enclosure(self): + self._assert_adapt(r"look right enclosure", r"EnclosureLookRight") + + +class TestAdapt2_EnclosureLookLeft(_IntentRoutingMixin, TestCase): + """Adapt intent: EnclosureLookLeft (require look + left)""" + + def test_look_left(self): + self._assert_adapt(r"look left", r"EnclosureLookLeft") + + +class TestAdapt3_EnclosureEyesSpin(_IntentRoutingMixin, TestCase): + """Adapt intent: EnclosureEyesSpin (require spin + one_of eyes/animation)""" + + def test_spin_eyes(self): + self._assert_adapt(r"spin eyes", r"EnclosureEyesSpin") + + +class TestAdapt4_EnclosureEyesNarrow(_IntentRoutingMixin, TestCase): + """Adapt intent: EnclosureEyesNarrow (require narrow + eyes)""" + + def test_narrow_eyes(self): + self._assert_adapt(r"narrow eyes", r"EnclosureEyesNarrow") diff --git a/version.py b/version.py index 3d283ec..9c180ae 100644 --- a/version.py +++ b/version.py @@ -4,3 +4,5 @@ VERSION_BUILD = 2 VERSION_ALPHA = 1 # END_VERSION_BLOCK + +__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + (f"a{VERSION_ALPHA}" if VERSION_ALPHA else "")