Skip to content

Commit

Permalink
Resolve Installation Errors (NeonGeckoCom#129)
Browse files Browse the repository at this point in the history
* Depreciate test_requirements.txt
Update core_tests.yml requirements installation

* Update test dependencies

* Spec stricter dependencies

* Unlock module dependency versions

* Add constraints and reference in setup scripts

* fix conflicting constraints

* Add more constrants

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints

* Add more constraints
Fix typo in constraints.txt

* Add more constraints

* Resolve constraint conflicts

* Update constraint versions

* Update constraint versions

* Update constraint versions

* Update constraint versions based on dev environment

* Set constraints.txt to match dev pip env

* Fix constraints.txt URL specs from pip freeze

* Remove neon core modules from constraints.txt

* Update conflicting mock versions

* Remove STT/TTS plugin constraints (repo refs)

* Remove old google_cloud_speech version constraint

* Update requirements installation to use legacy resolver

* Revert dependency changes to troubleshoot test failures

* Revert legacy resolver call

* Replace legacy-resolver call
Lock mycroft-messagebus-client version
Replace updated module dependency definitions

* Troubleshooting dependency conflicts

* Remove constraints.txt

* Loosen OPM requirement
Prevent killing test_run_neon in run_neon
Use ready events for testing modules

* Revert OPM requirement for GH testing errors

* Troubleshoot skills module test failure

* Update TTS plugin reference to PyPI
Add version specs to Neon core modules
  • Loading branch information
NeonDaniel committed Sep 15, 2021
1 parent f3379f2 commit e17ed30
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt install -y gcc libfann-dev swig libssl-dev portaudio19-dev git
pip install -r requirements/test_requirements.txt
pip install -r requirements/requirements.txt
pip install -r requirements/test.txt
env:
GITHUB_TOKEN: ${{secrets.neon_token}}
Expand Down
3 changes: 2 additions & 1 deletion neon_core/run_neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def _stop_all_core_processes():
"neon_core.skills", "neon_core.gui"
"neon_core_server", "neon_enclosure_client",
"neon_core_client", "mycroft-gui-app",
"NGI.utilities.gui", "run_neon.py"))
"NGI.utilities.gui", "run_neon.py")
if "test" not in cmdline[-1])
or cmdline[-1].endswith("bin/neon-start")):
LOG.info(f"Terminating {cmdline} {pid}")
try:
Expand Down
2 changes: 1 addition & 1 deletion requirements/pi.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
neon-client @ git+https://github.com/NeonGeckoCom/neon-core-client
neon-transcripts-controller @ git+https://github.com/NeonGeckoCom/transcripts_controller
jarbas-wake-word-plugin-pocketsphinx
ovos-ww-plugin-pocketsphinx
neon-tts-plugin-mimic @ git+https://github.com/NeonGeckoCom/neon-tts-plugin-mimic
deepspeech @ https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-cp37-cp37m-linux_aarch64.whl
neon-stt-plugin-deepspeech_stream_local @ git+https://github.com/NeonGeckoCom/neon-stt-plugin-deepspeech_stream_local
Expand Down
3 changes: 2 additions & 1 deletion requirements/remote_speech_processing.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
neon-stt-plugin-google_cloud_streaming @ git+https://github.com/NeonGeckoCom/neon-stt-plugin-google_cloud_streaming
neon-tts-plugin-polly @ git+https://github.com/NeonGeckoCom/neon-tts-plugin-polly
neon-tts-plugin-polly~=0.1
neon-lang-plugin-amazon_translate>=0.1.0
21 changes: 10 additions & 11 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# mycroft
HolmesV[all]==2021.5.6a20
mock_msm
mycroft-messagebus-client~=0.9,!=0.9.2
tornado

# neon stuff
neon-speech>=0.1.8a1
neon-audio>=0.2.1a3
neon-enclosure>=0.0.4a0
# neon core modules
neon_speech>=0.2.0
neon_audio>=0.3.0
neon_enclosure>=0.1.0

# utils
neon-utils>=0.6.0
Expand All @@ -19,12 +17,13 @@ ovos-skills-manager>=0.0.2

# plugins
ovos-plugin-manager==0.0.1a3
libretranslate_neon_plugin
neon-lang-plugin-libretranslate>=0.1.0

# text parser modules
RAKEkeywords>=0.2.0

# TODO: Remove these patched dependency versions
# transcripts_controller
mongoengine==0.23.0
pymongo==3.11.3
# Patch Dependency Conflicts
mycroft-messagebus-client==0.9.1
tornado==6.0.3
numpy==1.19.5
pyee==8.1.0
3 changes: 2 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
mock==4.0.3
pytest-cov
mock==4.0.2
24 changes: 0 additions & 24 deletions requirements/test_requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ doInstall(){
fi

echo "${GITHUB_TOKEN}">~/token.txt
pip install --upgrade pip~=21.1
pip install --upgrade pip~=21.1.0
pip install wheel
pip install "${pipStr}"
pip install "${pipStr}" --use-deprecated=legacy-resolver
neon-config-import

start_script="#!/bin/bash
Expand Down
4 changes: 2 additions & 2 deletions test/setup_dev_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ if [ "${installGui}" == "true" ]; then
fi

echo "${GITHUB_TOKEN}">~/token.txt
pip install --upgrade pip~=21.1
pip install --upgrade pip==21.2.4
pip install wheel

cd "${sourceDir}" || exit 10
pip install ".${optStr}"
pip install ".${optStr}" --use-deprecated=legacy-resolver

neon-config-import

Expand Down
4 changes: 2 additions & 2 deletions test/setup_remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ fi


echo "${GITHUB_TOKEN}">~/token.txt
pip install --upgrade pip~=21.1
pip install --upgrade pip==21.2.4
pip install wheel

cd "${sourceDir}" || exit 10
pip install ".${optStr}"
pip install ".${optStr}" --use-deprecated=legacy-resolver

neon-config-import

Expand Down
22 changes: 14 additions & 8 deletions test/test_run_neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def setUpClass(cls) -> None:
cls.process.start()
cls.bus = MessageBusClient()
cls.bus.run_in_thread()
sleep(60) # TODO: Better method to wait for process startup DM
cls.bus.connected_event.wait()
cls.bus.wait_for_message("mycroft.ready", 90)

@classmethod
def tearDownClass(cls) -> None:
Expand All @@ -64,11 +65,6 @@ def tearDownClass(cls) -> None:
except Exception as e:
LOG.error(e)

def setUp(self) -> None:
self.bus.connected_event.wait(30)
while not self.bus.started_running:
sleep(1)

def test_messagebus_connection(self):
from mycroft_bus_client import MessageBusClient
bus = MessageBusClient()
Expand All @@ -79,18 +75,24 @@ def test_messagebus_connection(self):
bus.close()

def test_speech_module(self):
response = self.bus.wait_for_response(Message('mycroft.speech.is_ready'))
self.assertTrue(response.data['status'])

context = {"client": "tester",
"ident": str(round(time())),
"user": "TestRunner"}
stt_resp = self.bus.wait_for_response(Message("neon.get_stt",
{"audio_file": os.path.join(AUDIO_FILE_PATH, "stop.wav")},
context), context["ident"])
{"audio_file": os.path.join(AUDIO_FILE_PATH, "stop.wav")},
context), context["ident"])
self.assertEqual(stt_resp.context, context)
self.assertIsInstance(stt_resp.data.get("parser_data"), dict)
self.assertIsInstance(stt_resp.data.get("transcripts"), list)
self.assertIn("stop", stt_resp.data.get("transcripts"))

def test_audio_module(self):
response = self.bus.wait_for_response(Message('mycroft.audio.is_ready'))
self.assertTrue(response.data['status'])

text = "This is a test"
context = {"client": "tester",
"ident": str(time()),
Expand Down Expand Up @@ -129,6 +131,10 @@ def test_client_module(self):
self.assertIsInstance(data["success"], bool)

def test_skills_module(self):
# TODO: Skills takes a long time on first run; speed it up and replace this test DM
# response = self.bus.wait_for_response(Message('mycroft.skills.is_ready'))
# self.assertTrue(response.data['status'])

response = self.bus.wait_for_response(Message("skillmanager.list"), "mycroft.skills.list")
self.assertIsInstance(response, Message)
loaded_skills = response.data
Expand Down

0 comments on commit e17ed30

Please sign in to comment.