Skip to content

Backport PR #41739: TST: Make ARM build work (not in the CI) #41781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
35 changes: 12 additions & 23 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,30 @@ if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
echo
fi

MINICONDA_DIR="$HOME/miniconda3"


if [ -d "$MINICONDA_DIR" ]; then
echo
echo "rm -rf "$MINICONDA_DIR""
rm -rf "$MINICONDA_DIR"
fi

echo "Install Miniconda"
UNAME_OS=$(uname)
if [[ "$UNAME_OS" == 'Linux' ]]; then
DEFAULT_CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest"
if [[ "$(uname -m)" == 'aarch64' ]]; then
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.10.1-4/Miniforge3-4.10.1-4-Linux-aarch64.sh"
elif [[ "$(uname)" == 'Linux' ]]; then
if [[ "$BITS32" == "yes" ]]; then
CONDA_OS="Linux-x86"
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86.sh"
else
CONDA_OS="Linux-x86_64"
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86_64.sh"
fi
elif [[ "$UNAME_OS" == 'Darwin' ]]; then
CONDA_OS="MacOSX-x86_64"
elif [[ "$(uname)" == 'Darwin' ]]; then
CONDA_URL="$DEFAULT_CONDA_URL-MacOSX-x86_64.sh"
else
echo "OS $UNAME_OS not supported"
echo "OS $(uname) not supported"
exit 1
fi

if [ "${TRAVIS_CPU_ARCH}" == "arm64" ]; then
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.8.5-1/Miniforge3-4.8.5-1-Linux-aarch64.sh"
else
CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh"
fi
echo "Downloading $CONDA_URL"
wget -q $CONDA_URL -O miniconda.sh
chmod +x miniconda.sh

# Installation path is required for ARM64 platform as miniforge script installs in path $HOME/miniforge3.
MINICONDA_DIR="$HOME/miniconda3"
rm -rf $MINICONDA_DIR
./miniconda.sh -b -p $MINICONDA_DIR

export PATH=$MINICONDA_DIR/bin:$PATH

echo
Expand Down
12 changes: 12 additions & 0 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ def is_platform_mac() -> bool:
return sys.platform == "darwin"


def is_platform_arm() -> bool:
"""
Checking if he running platform use ARM architecture.

Returns
-------
bool
True if the running platform uses ARM architecture.
"""
return platform.machine() in ("arm64", "aarch64")


def import_lzma():
"""
Importing the `lzma` module.
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/window/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pytest

from pandas.compat import is_platform_arm
from pandas.errors import UnsupportedFunctionCall

from pandas import (
Expand Down Expand Up @@ -891,6 +892,7 @@ def test_rolling_sem(frame_or_series):
tm.assert_series_equal(result, expected)


@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
@pytest.mark.parametrize(
("func", "third_value", "values"),
[
Expand Down