aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mycroft-core/0005-make-some-deps-optional.patch
blob: c75a0fbd7d89f3dc345c5909aabaa7618bd2f343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2575

diff --git a/.travis.yml b/.travis.yml
index c01c851d87..a0b9ab2c1c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,8 +26,6 @@ install:
  - mkdir ${TMPDIR}
  - echo ${TMPDIR}
  - VIRTUALENV_ROOT=${VIRTUAL_ENV} ./dev_setup.sh
- - pip install -r requirements.txt
- - pip install -r test-requirements.txt
 # command to run tests
 script:
  - pycodestyle mycroft test
diff --git a/LICENSE.md b/LICENSE.md
index b2719d2a5e..b882a785c0 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -208,4 +208,4 @@ Component licenses for mycroft-core:
 The mycroft-core software references various Python Packages (via PIP),
 each of which has a separate license.  All are compatible with the
 Apache 2.0 license. See the referenced packages listed in the
-"requirements.txt" file for specific terms and conditions.
+"requirements/requirements.txt" file for specific terms and conditions.
diff --git a/MANIFEST.in b/MANIFEST.in
index 1888d6da7b..1708d5345f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,5 @@
 recursive-include mycroft/client/speech/recognizer/model *
-include requirements.txt
+include requirements/requirements.txt
 include mycroft/configuration/*.conf
 recursive-include mycroft/res *
 recursive-include mycroft/res/snd *
diff --git a/dev_setup.sh b/dev_setup.sh
index 3c59bc427b..f7f2d90009 100755
--- a/dev_setup.sh
+++ b/dev_setup.sh
@@ -495,16 +495,26 @@ if ! grep -q "$TOP" $VENV_PATH_FILE ; then
 fi
 
 # install required python modules
-if ! pip install -r requirements.txt ; then
-    echo 'Warning: Failed to install all requirements. Continue? y/N'
+if ! pip install -r requirements/requirements.txt ; then
+    echo 'Warning: Failed to install required dependencies. Continue? y/N'
     read -n1 continue
     if [[ $continue != 'y' ]] ; then
         exit 1
     fi
 fi
 
-if ! pip install -r test-requirements.txt ; then
-    echo "Warning test requirements wasn't installed, Note: normal operation should still work fine..."
+# install optional python modules
+if ! pip install -r requirements/requirements-optional.txt ; then
+    echo 'Warning: Failed to install optional dependencies. Continue? y/N'
+    read -n1 continue
+    if [[ $continue != 'y' ]] ; then
+        exit 1
+    fi
+fi
+
+
+if ! pip install -r requirements/requirements-tests.txt ; then
+    echo "Warning: Test requirements failed to install. Note: normal operation should still work fine..."
 fi
 
 SYSMEM=$(free | awk '/^Mem:/ { print $2 }')
@@ -563,4 +573,4 @@ if [[ ! -w /var/log/mycroft/ ]] ; then
 fi
 
 #Store a fingerprint of setup
-md5sum requirements.txt test-requirements.txt dev_setup.sh > .installed
+md5sum requirements/requirements.txt requirements/requirements-optional.txt requirements/requirements-tests.txt dev_setup.sh > .installed
diff --git a/mycroft/client/enclosure/generic/__init__.py b/mycroft/client/enclosure/generic/__init__.py
index 6256498add..a86dda739c 100644
--- a/mycroft/client/enclosure/generic/__init__.py
+++ b/mycroft/client/enclosure/generic/__init__.py
@@ -15,7 +15,6 @@
 import subprocess
 import time
 import sys
-from alsaaudio import Mixer
 from threading import Thread, Timer
 
 import mycroft.dialog
diff --git a/requirements/requirements-optional.txt b/requirements/requirements-optional.txt
new file mode 100644
index 0000000000..4a62dad731
--- /dev/null
+++ b/requirements/requirements-optional.txt
@@ -0,0 +1,4 @@
+pychromecast==3.2.2
+python-vlc==1.1.2
+pyalsaaudio==0.8.2
+google-api-python-client==1.6.4
diff --git a/test-requirements.txt b/requirements/requirements-tests.txt
similarity index 90%
rename from test-requirements.txt
rename to requirements/requirements-tests.txt
index 874a0f130d..9e038123e5 100644
--- a/test-requirements.txt
+++ b/requirements/requirements-tests.txt
@@ -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
diff --git a/requirements.txt b/requirements/requirements.txt
similarity index 83%
rename from requirements.txt
rename to requirements/requirements.txt
index db2fa43738..f86a81b4bf 100644
--- a/requirements.txt
+++ b/requirements/requirements.txt
@@ -7,16 +7,12 @@ SpeechRecognition==3.8.1
 tornado==6.0.3
 websocket-client==0.54.0
 requests-futures==0.9.5
-pyalsaaudio==0.8.2
 pyserial==3.0
 psutil==5.6.6
 pocketsphinx==0.1.0
 inflection==0.3.1
 pillow==7.1.2
 python-dateutil==2.6.0
-pychromecast==3.2.2
-python-vlc==1.1.2
-google-api-python-client==1.6.4
 fasteners==0.14.1
 PyYAML==5.1.2
 
diff --git a/scripts/my-info.sh b/scripts/my-info.sh
index a3b944308e..e395411120 100644
--- a/scripts/my-info.sh
+++ b/scripts/my-info.sh
@@ -144,7 +144,7 @@ function checkmimic() {
 # pythoning!
 function checkPIP() {
     mlog "Python checks"
-    mlog " - Verifying ${MYCROFT_HOME}/requirements.txt:"
+    mlog " - Verifying ${MYCROFT_HOME}/requirements/requirements.txt:"
     if workon mycroft ; then
         pip list > /tmp/mycroft-piplist.$$
 
diff --git a/setup.py b/setup.py
index c98f7b4f8f..2e171d66b6 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,9 @@ setup(
     author_email='devs@mycroft.ai',
     url='https://github.com/MycroftAI/mycroft-core',
     description='Mycroft Core',
-    install_requires=required('requirements.txt'),
+    install_requires=required('requirements/requirements.txt'),
+    extras_requires=required('requirements/requirements-optional.txt'),
+    tests_requires=required('requirements/requirements-tests.txt'),
     packages=find_packages(include=['mycroft*']),
     include_package_data=True,
 
diff --git a/test/Dockerfile.test b/test/Dockerfile.test
index 87e3c85287..32554af019 100644
--- a/test/Dockerfile.test
+++ b/test/Dockerfile.test
@@ -64,12 +64,14 @@ RUN python3 -m venv "/opt/mycroft/mycroft-core/.venv"
 # determine if any changes have been made since it last started
 WORKDIR /opt/mycroft/mycroft-core
 RUN .venv/bin/python -m pip install pip==20.0.2
-COPY requirements.txt .
+COPY requirements/requirements.txt .
 RUN .venv/bin/python -m pip install -r requirements.txt
-COPY test-requirements.txt .
-RUN .venv/bin/python -m pip install -r test-requirements.txt
+COPY requirements/requirements-optional.txt .
+RUN .venv/bin/python -m pip install -r requirements-optional.txt
+COPY requirements/requirements-tests.txt .
+RUN .venv/bin/python -m pip install -r requirements-tests.txt
 COPY dev_setup.sh .
-RUN md5sum requirements.txt test-requirements.txt dev_setup.sh > .installed
+RUN md5sum requirements.txt requirements-tests.txt requirements-optional.txt dev_setup.sh > .installed
 
 # Add the mycroft core virtual environment to the system path.
 ENV PATH /opt/mycroft/mycroft-core/.venv/bin:$PATH