diff --git a/pyproject.toml b/pyproject.toml index 089651e..622aabc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,14 @@ dependencies = [ "typer>=0.12", "lxml>=5.0", "pyfamsa>=0.5", - "veryfasttree>=4.0", + # No macOS arm64 wheel exists for this (as of 4.0.4.1) -- installing it + # there falls back to a from-source build that's known to fail (an + # upstream OpenMP-detection bug). CANDy already defaults to fasttree + # instead on exactly this platform (see config.default_tree_tool), so + # skip the dependency there entirely rather than failing every install. + # Still installed on Intel Mac (a real x86_64 wheel exists) and under + # Rosetta translation (ditto) -- neither of those needs a source build. + "veryfasttree>=4.0; sys_platform != 'darwin' or platform_machine != 'arm64'", "platformdirs>=4.0", ] diff --git a/src/candy/phylogenetics/veryfasttree_builder.py b/src/candy/phylogenetics/veryfasttree_builder.py index b87a9c8..15bedcc 100644 --- a/src/candy/phylogenetics/veryfasttree_builder.py +++ b/src/candy/phylogenetics/veryfasttree_builder.py @@ -3,7 +3,16 @@ import logging from pathlib import Path -import veryfasttree +try: + import veryfasttree +except ImportError as exc: # pragma: no cover -- exercised only where the wheel is genuinely absent + raise ImportError( + "The 'veryfasttree' package is not installed. On macOS arm64 (Apple Silicon), this is " + "deliberate -- veryfasttree has no native wheel there and CANDy defaults to --tree-tool " + "fasttree instead (see the README's Apple Silicon setup section). To force veryfasttree " + "anyway, `pip install veryfasttree` yourself -- it will attempt a from-source build, which " + "is known to fail on stock macOS due to an upstream OpenMP-detection bug." + ) from exc logger = logging.getLogger(__name__)