Skip to content

Commit 29e8da1

Browse files
Backport PR pandas-dev#41739: TST: Make ARM build work (not in the CI) (pandas-dev#41781)
Co-authored-by: Marc Garcia <[email protected]>
1 parent 96cedab commit 29e8da1

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed
File renamed without changes.

ci/setup_env.sh

+12-23
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,30 @@ if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
1212
echo
1313
fi
1414

15-
MINICONDA_DIR="$HOME/miniconda3"
16-
17-
18-
if [ -d "$MINICONDA_DIR" ]; then
19-
echo
20-
echo "rm -rf "$MINICONDA_DIR""
21-
rm -rf "$MINICONDA_DIR"
22-
fi
2315

2416
echo "Install Miniconda"
25-
UNAME_OS=$(uname)
26-
if [[ "$UNAME_OS" == 'Linux' ]]; then
17+
DEFAULT_CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest"
18+
if [[ "$(uname -m)" == 'aarch64' ]]; then
19+
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.10.1-4/Miniforge3-4.10.1-4-Linux-aarch64.sh"
20+
elif [[ "$(uname)" == 'Linux' ]]; then
2721
if [[ "$BITS32" == "yes" ]]; then
28-
CONDA_OS="Linux-x86"
22+
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86.sh"
2923
else
30-
CONDA_OS="Linux-x86_64"
24+
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86_64.sh"
3125
fi
32-
elif [[ "$UNAME_OS" == 'Darwin' ]]; then
33-
CONDA_OS="MacOSX-x86_64"
26+
elif [[ "$(uname)" == 'Darwin' ]]; then
27+
CONDA_URL="$DEFAULT_CONDA_URL-MacOSX-x86_64.sh"
3428
else
35-
echo "OS $UNAME_OS not supported"
29+
echo "OS $(uname) not supported"
3630
exit 1
3731
fi
38-
39-
if [ "${TRAVIS_CPU_ARCH}" == "arm64" ]; then
40-
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.8.5-1/Miniforge3-4.8.5-1-Linux-aarch64.sh"
41-
else
42-
CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh"
43-
fi
32+
echo "Downloading $CONDA_URL"
4433
wget -q $CONDA_URL -O miniconda.sh
4534
chmod +x miniconda.sh
4635

47-
# Installation path is required for ARM64 platform as miniforge script installs in path $HOME/miniforge3.
36+
MINICONDA_DIR="$HOME/miniconda3"
37+
rm -rf $MINICONDA_DIR
4838
./miniconda.sh -b -p $MINICONDA_DIR
49-
5039
export PATH=$MINICONDA_DIR/bin:$PATH
5140

5241
echo

pandas/compat/__init__.py

+12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ def is_platform_mac() -> bool:
7777
return sys.platform == "darwin"
7878

7979

80+
def is_platform_arm() -> bool:
81+
"""
82+
Checking if he running platform use ARM architecture.
83+
84+
Returns
85+
-------
86+
bool
87+
True if the running platform uses ARM architecture.
88+
"""
89+
return platform.machine() in ("arm64", "aarch64")
90+
91+
8092
def import_lzma():
8193
"""
8294
Importing the `lzma` module.

pandas/tests/window/test_rolling.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat import is_platform_arm
67
from pandas.errors import UnsupportedFunctionCall
78

89
from pandas import (
@@ -891,6 +892,7 @@ def test_rolling_sem(frame_or_series):
891892
tm.assert_series_equal(result, expected)
892893

893894

895+
@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
894896
@pytest.mark.parametrize(
895897
("func", "third_value", "values"),
896898
[

0 commit comments

Comments
 (0)