Skip to content

Commit

Permalink
Fix Python 2 installation and CI failures (#227)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
madchutney authored Apr 16, 2020
1 parent bab18c0 commit fc7b996
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ jobs:
sendCoverage: "true"
mac_python_2_7:
python.version: "2.7"
imageName: macos-10.13
imageName: macOS-10.15
sendCoverage: "false"
mac_python_3_5:
python.version: "3.5"
imageName: macos-10.13
imageName: macOS-10.15
sendCoverage: "false"
mac_python_3_6:
python.version: "3.6"
imageName: macos-10.13
imageName: macOS-10.15
sendCoverage: "false"
mac_python_3_7:
python.version: "3.7"
imageName: macos-10.13
imageName: macOS-10.15
sendCoverage: "false"
windows_python_2_7:
python.version: "2.7"
Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

import os
import sys
from distutils.core import setup
from setuptools import find_packages

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

# soupsieve is not a direct requirement of this package, but left to it's own
# devices a version >= 2.0 is installed for Python 2 which is not compatible.
# Therefore perform the installation of a compatible package before any other
# packages are installed.
if sys.version_info.major == 2:
requirements.insert(0, "soupsieve<2.0")

with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh:
test_requirements = fh.readlines()

Expand Down
3 changes: 2 additions & 1 deletion src/mbed_os_tools/detect/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def _plist_from_popen(popen):
return []
try:
try:
# Try simple and fast first if this fails fall back to the slower but better process
# Try simple and fast first if this fails fall back to the slower but
# more robust process.
return loads(out)
except ExpatError:
# Beautiful soup ensures the XML is properly formed after it is parsed
Expand Down

0 comments on commit fc7b996

Please sign in to comment.