Skip to content

Commit fc7b996

Browse files
authored
Fix Python 2 installation and CI failures (#227)
* Fix line length of a comment causing flake8 checks to fail * Update the macOS VM to one supported by AzurePipelines (the existing one had been removed) * Set max version of soupsieve on Python 2.7 otherwise an incompatible version is installed.
1 parent bab18c0 commit fc7b996

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ jobs:
3737
sendCoverage: "true"
3838
mac_python_2_7:
3939
python.version: "2.7"
40-
imageName: macos-10.13
40+
imageName: macOS-10.15
4141
sendCoverage: "false"
4242
mac_python_3_5:
4343
python.version: "3.5"
44-
imageName: macos-10.13
44+
imageName: macOS-10.15
4545
sendCoverage: "false"
4646
mac_python_3_6:
4747
python.version: "3.6"
48-
imageName: macos-10.13
48+
imageName: macOS-10.15
4949
sendCoverage: "false"
5050
mac_python_3_7:
5151
python.version: "3.7"
52-
imageName: macos-10.13
52+
imageName: macOS-10.15
5353
sendCoverage: "false"
5454
windows_python_2_7:
5555
python.version: "2.7"

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515

1616
import os
17+
import sys
1718
from distutils.core import setup
1819
from setuptools import find_packages
1920

@@ -38,6 +39,13 @@ def read(fname):
3839
with open(os.path.join(repository_dir, 'requirements.txt')) as fh:
3940
requirements = fh.readlines()
4041

42+
# soupsieve is not a direct requirement of this package, but left to it's own
43+
# devices a version >= 2.0 is installed for Python 2 which is not compatible.
44+
# Therefore perform the installation of a compatible package before any other
45+
# packages are installed.
46+
if sys.version_info.major == 2:
47+
requirements.insert(0, "soupsieve<2.0")
48+
4149
with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh:
4250
test_requirements = fh.readlines()
4351

src/mbed_os_tools/detect/darwin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def _plist_from_popen(popen):
4343
return []
4444
try:
4545
try:
46-
# Try simple and fast first if this fails fall back to the slower but better process
46+
# Try simple and fast first if this fails fall back to the slower but
47+
# more robust process.
4748
return loads(out)
4849
except ExpatError:
4950
# Beautiful soup ensures the XML is properly formed after it is parsed

0 commit comments

Comments
 (0)