From da4165eb0aa88420115b4443c976fcbf550ae662 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Sat, 2 Apr 2022 17:00:11 -0600 Subject: [PATCH] BLD: improve M1 build support * the changes here allow me to build MDAnalysis and its dependencies on an M1 Mac on the gcc compile farm using `python3 -m pip install --user .` * the full test suite passes, except for 1 extra `xfail` I've added in here--which is also documented by gh-1389 (it has apparently been failing on "exotic platforms" for almost 5 years) --- package/pyproject.toml | 3 +++ testsuite/MDAnalysisTests/analysis/test_encore.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/package/pyproject.toml b/package/pyproject.toml index 931cf83aa3a..50f55a3246c 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -11,4 +11,7 @@ requires = [ "numpy==1.21.4; python_version=='3.10' and platform_python_implementation != 'PyPy'", "setuptools", "wheel", + # arm64 on Darwin supports Python 3.8 and above and requires numpy>=1.20.0 + "numpy==1.20.0; python_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'", + "numpy==1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'", ] diff --git a/testsuite/MDAnalysisTests/analysis/test_encore.py b/testsuite/MDAnalysisTests/analysis/test_encore.py index 1d5910c04b7..4b9b08d6dbe 100644 --- a/testsuite/MDAnalysisTests/analysis/test_encore.py +++ b/testsuite/MDAnalysisTests/analysis/test_encore.py @@ -29,6 +29,7 @@ import sys import os import warnings +import platform import pytest from numpy.testing import assert_equal, assert_almost_equal @@ -444,6 +445,8 @@ def test_clustering_two_ensembles(self, ens1, ens2): assert len(cluster_collection) == expected_value, "Unexpected " \ "results: {0}".format(cluster_collection) + @pytest.mark.xfail(platform.machine() == "arm64" and platform.system() == "Darwin", + reason="Fails on M1 Mac") def test_clustering_three_ensembles_two_identical(self, ens1, ens2): cluster_collection = encore.cluster([ens1, ens2, ens1]) expected_value = 40