SFDO-Tooling / CumulusCI

Python framework for building portable automation for Salesforce projects
http://cumulusci.readthedocs.io
BSD 3-Clause "New" or "Revised" License
359 stars 242 forks source link

Fix Python 3.8 unit tests on macOS #3777

Closed jstvz closed 5 months ago

jstvz commented 5 months ago

Importing lxml in Python 3.8 now throws an ImportError on macOS:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/__init__.py", line 743, in import_plugin
    __import__(importspec)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 171, in exec_module
    exec(co, module.__dict__)
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/tests/pytest_plugins/pytest_sf_orgconnect.py", line 9, in <module>
    from cumulusci.cli.org import org_remove, org_scratch, org_scratch_delete
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/cli/org.py", line 12, in <module>
    from cumulusci.core.config import OrgConfig, ScratchOrgConfig
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/core/config/__init__.py", line 8, in <module>
    from cumulusci.core.utils import import_global
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/core/utils.py", line 21, in <module>
    from cumulusci.utils.options import parse_list_of_pairs_dict_arg
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/utils/__init__.py", line 20, in <module>
    from .xml import (  # noqa
  File "/Users/runner/work/CumulusCI/CumulusCI/cumulusci/utils/xml/__init__.py", line 5, in <module>
    from lxml import etree as lxml_etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'

According to the discussion on actions/setup-python#696, macos-latest runners are now on AArch64, while macos-13 is still on x86. This PR switches the 3.8 runner to macos-13 as a workaround.