Skip to content

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

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
merged 15 commits into from
Jun 1, 2021
18 changes: 0 additions & 18 deletions .circleci/config.yml

This file was deleted.

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 @@ -92,6 +92,18 @@ def is_platform_mac() -> bool:
return sys.platform == "darwin"


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo for follow-up


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
3 changes: 3 additions & 0 deletions pandas/tests/indexes/interval/test_astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import numpy as np
import pytest

from pandas.compat import is_platform_arm

from pandas.core.dtypes.dtypes import (
CategoricalDtype,
IntervalDtype,
Expand Down Expand Up @@ -168,6 +170,7 @@ def test_subtype_integer_with_non_integer_borders(self, subtype):
)
tm.assert_index_equal(result, expected)

@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is already xfailed on 1.2.x, xref #38719

def test_subtype_integer_errors(self):
# float64 -> uint64 fails with negative values
index = interval_range(-10.0, 10.0)
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/tools/test_to_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from numpy import iinfo
import pytest

from pandas.compat import is_platform_arm

import pandas as pd
from pandas import (
DataFrame,
Expand Down Expand Up @@ -750,7 +752,7 @@ def test_to_numeric_from_nullable_string(values, nullable_string_dtype, expected
"UInt64",
"signed",
"UInt64",
marks=pytest.mark.xfail(reason="GH38798"),
marks=pytest.mark.xfail(not is_platform_arm(), reason="GH38798"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test added in #38746, not on 1.2.x

),
([1, 1], "Int64", "unsigned", "UInt8"),
([1.0, 1.0], "Float32", "unsigned", "UInt8"),
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 @@ -6,6 +6,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 @@ -1072,6 +1073,7 @@ def test_rolling_sem(frame_or_series):
tm.assert_series_equal(result, expected)


@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only fails on ARM64 Linux. It passes on M1 Mac. #38921

@pytest.mark.parametrize(
("func", "third_value", "values"),
[
Expand Down