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

fix: manifest and automations #15

Merged
merged 5 commits into from
Nov 15, 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
10 changes: 2 additions & 8 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [3.8, 3.9, "3.10", "3.11" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -36,10 +36,4 @@ jobs:
python setup.py bdist_wheel
- name: Install skill
run: |
pip install .
- uses: pypa/[email protected]
with:
# Ignore setuptools vulnerability we can't do much about
ignore-vulns: |
GHSA-r9hx-vwmv-q579
PYSEC-2022-43012
pip install .
70 changes: 0 additions & 70 deletions .github/workflows/install_tests.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Run UnitTests
on:
pull_request:
branches:
- dev
paths-ignore:
- 'version.py'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'README.md'
- 'scripts/**'
push:
branches:
- master
paths-ignore:
- 'version.py'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'README.md'
- 'scripts/**'
workflow_dispatch:

jobs:
unit_tests:
strategy:
matrix:
python-version: [3.9, "3.10" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
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
- name: Install ovos dependencies
run: |
pip install ovos-plugin-manager
- name: Run unittests
run: |
pytest --cov=ovos-skill-fallback-unknown --cov-report xml test
- name: Upload coverage
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
uses: codecov/codecov-action@v2
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include locale *
include *.txt
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python3
from setuptools import setup
import os
from os import walk, path

from setuptools import setup

URL = "https://github.com/OpenVoiceOS/skill-ovos-fallback-unknown"
SKILL_CLAZZ = "UnknownSkill" # needs to match __init__.py class name
PYPI_NAME = "ovos-skill-fallback-unknown" # pip install PYPI_NAME
Expand All @@ -14,7 +16,7 @@


def find_resource_files():
resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex", "skill")
resource_base_dirs = ("locale")
base_dir = path.dirname(__file__)
package_data = ["*.json"]
for res in resource_base_dirs:
Expand Down Expand Up @@ -55,6 +57,19 @@ def get_version():
return version


def get_requirements(requirements_filename: str):
requirements_file = path.join(path.abspath(path.dirname(__file__)),
requirements_filename)
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 os.environ:
print('USING LOOSE REQUIREMENTS!')
requirements = [r.replace('==', '>=').replace('~=', '>=') for r in requirements]
return requirements


setup(
name=PYPI_NAME,
version=get_version(),
Expand All @@ -68,6 +83,7 @@ def get_version():
package_data={SKILL_PKG: find_resource_files()},
packages=[SKILL_PKG],
include_package_data=True,
install_requires=get_requirements("requirements.txt"),
keywords='ovos skill plugin',
entry_points={'ovos.plugin.skill': PLUGIN_ENTRY_POINT}
)
30 changes: 0 additions & 30 deletions test/osm_tests.py

This file was deleted.

File renamed without changes.
21 changes: 4 additions & 17 deletions test/test_skill_loading.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import unittest
from os.path import join, dirname
import os
from ovos_utils.bracket_expansion import expand_parentheses, expand_options
from os.path import dirname

from adapt.engine import IntentDeterminationEngine
from adapt.intent import IntentBuilder
from skill_ovos_fallback_unknown import UnknownSkill, create_skill
from ovos_plugin_manager.skills import find_skill_plugins
from ovos_utils.messagebus import FakeBus
from mycroft.skills.skill_loader import PluginSkillLoader, SkillLoader
from ovos_workshop.skill_launcher import PluginSkillLoader, SkillLoader
from skill_ovos_fallback_unknown import UnknownSkill


class TestSkillLoading(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "skill-ovos-fallback-unknown.openvoiceos"
self.path = dirname(dirname(dirname(__file__)))
self.path = dirname(dirname(__file__))

def test_from_class(self):
bus = FakeBus()
Expand All @@ -24,13 +20,6 @@ def test_from_class(self):
self.assertEqual(skill.bus, bus)
self.assertEqual(skill.skill_id, self.skill_id)

def test_from_func(self):
bus = FakeBus()
skill = create_skill()
skill._startup(bus, self.skill_id)
self.assertEqual(skill.bus, bus)
self.assertEqual(skill.skill_id, self.skill_id)

def test_from_plugin(self):
bus = FakeBus()
for skill_id, plug in find_skill_plugins().items():
Expand Down Expand Up @@ -63,5 +52,3 @@ def test_from_plugin_loader(self):
self.assertEqual(loader.skill_id, self.skill_id)
self.assertEqual(loader.instance.bus, bus)
self.assertEqual(loader.instance.skill_id, self.skill_id)


Loading