Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Move requirements.txt to a new requirements folder and add optional deps #2575

Merged
merged 1 commit into from
May 14, 2020
Merged

Move requirements.txt to a new requirements folder and add optional deps #2575

merged 1 commit into from
May 14, 2020

Conversation

PureTryOut
Copy link
Contributor

@PureTryOut PureTryOut commented May 6, 2020

Description

Some dependencies aren't actually required but can be optionally
installed for extra functionality, e.g. the Chromecast audio backend, so
let's move those to an extra requirements file.

There are probably more deps that are optional but I don't know them, so please list them if so.

How to test

Install Mycroft with and without optional deps and see if the functionality still works as expected.

Contributor license agreement signed?

CLA [x] (Whether you have signed a CLA - Contributor Licensing Agreement

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label May 6, 2020
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@forslund
Copy link
Collaborator

forslund commented May 6, 2020

Thanks!
The dev_setup.sh script needs to be updated around here
Looks like the travis config needs to be updated as well. I think L29-30 of .travis.yml can just be removed since the dev_setup.sh would install those.

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

2 similar comments
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@forslund
Copy link
Collaborator

I did some testing with using the setup.py and it seems like the extras_require needs to be a dict specifying the different groups of extras that could be installed. for now I think we can just use an "all" group. See here for my test.

tests_require causes an error due to one of the requirements is referencing a git-release (1.2.7dev) and will require some extra effort to include. Maybe we'll just leave it out from the setup.py for now, since it wasn't there in the first place.

@PureTryOut
Copy link
Contributor Author

Well if I'm going to do it, I'm going to do it right. Instead of an "all" group, I divided them into the "stt", "audio-backend" and "mark1" group.

I removed the tests_require for now, that can be fixed later then.

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@PureTryOut
Copy link
Contributor Author

I don't know how to read that Voight Kampff thing at all. If I check the results, I see no failures?

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@forslund
Copy link
Collaborator

The results seem to link to be the last successful results for the PR, see the details for the CI:s at the bottom of this page for more details.

Seem to be an error in L507 on dev_setup.sh

@forslund
Copy link
Collaborator

The VK stage fails during setup of the Docker for the test:

Step 23/41 : COPY requirements/requirements-tests.txt .
COPY failed: stat /var/lib/docker/tmp/docker-builder474075641/requirements/requirements-tests.txt: no such file or directory

@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

Some dependencies aren't actually required but can be optionally
installed for extra functionality.

The Chromecast is an optional audio backend
VLC is an optional audio backend
pyalsaaudio is only used by the mark1 enclosure
google-api-python-client is an optional STT backend, by default Mycroft
uses the Mycroft servers
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@forslund
Copy link
Collaborator

@krisgesling could you also take a look at this approach and see if it makes sense to you from a user and maintenance perspective.

I think this can be pretty good for a dev-setup perspective where y/n questions could be added to enable certain features by installing the specific requirements files.

I've updated the Mark-1 packaging rules to include the required extras and it seems to be working as previously.

@forslund forslund self-requested a review May 12, 2020 09:10
@JarbasAl
Copy link
Contributor

if we are doing this, could we add all optional dependencies?

specifically for TTS/STT/AudioBackend engines

@PureTryOut
Copy link
Contributor Author

@JarbasAI in a new PR please but yes, that's doable then! I didn't even realize there were any more optional dependencies 🤔

@@ -7,3 +7,5 @@ sphinx==2.2.1
sphinx-rtd-theme==0.4.3
git+https://github.com/behave/behave@v1.2.7.dev1
allure-behave==2.8.10

python-vlc==1.1.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this meant to be added to the tests requirements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. One of the tests actually uses it, I had it fail when it wasn't installed. Since it's an optional dependency at runtime, it has to be specified here.

@krisgesling
Copy link
Contributor

Yeah I like it!

Easier to track the growing list of dependencies and know what they're for.

As Jarbas mentioned it will also be great for things like Polly STT which requires an extra package. There's no need to install it on every device just in case some users want to try that STT service out. But for less technical users it's also harder to get started if they've never heard of PIP or package management in general.

@PureTryOut
Copy link
Contributor Author

I hope that eventually less technical users will just get mycroft from their distribution repositories 😉
But it shouldn't be a problem, they'd just run dev_setup.sh which does install the extras.

@krisgesling
Copy link
Contributor

haha yeah, I meant this is a good step toward automating that process for them.

@forslund forslund merged commit 90d2570 into MycroftAI:dev May 14, 2020
@PureTryOut PureTryOut deleted the optional-deps branch May 14, 2020 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants