Skip to content

Commit 97faa71

Browse files
datapythonistaJulianWgs
authored andcommitted
TST: Make ARM build work (not in the CI) (pandas-dev#41739)
1 parent 87daaf3 commit 97faa71

File tree

7 files changed

+32
-42
lines changed

7 files changed

+32
-42
lines changed

.circleci/config.yml

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

9494

95+
def is_platform_arm() -> bool:
96+
"""
97+
Checking if he running platform use ARM architecture.
98+
99+
Returns
100+
-------
101+
bool
102+
True if the running platform uses ARM architecture.
103+
"""
104+
return platform.machine() in ("arm64", "aarch64")
105+
106+
95107
def import_lzma():
96108
"""
97109
Importing the `lzma` module.

pandas/tests/indexes/interval/test_astype.py

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

6+
from pandas.compat import is_platform_arm
7+
68
from pandas.core.dtypes.dtypes import (
79
CategoricalDtype,
810
IntervalDtype,
@@ -168,6 +170,7 @@ def test_subtype_integer_with_non_integer_borders(self, subtype):
168170
)
169171
tm.assert_index_equal(result, expected)
170172

173+
@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
171174
def test_subtype_integer_errors(self):
172175
# float64 -> uint64 fails with negative values
173176
index = interval_range(-10.0, 10.0)

pandas/tests/tools/test_to_numeric.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from numpy import iinfo
55
import pytest
66

7+
from pandas.compat import is_platform_arm
8+
79
import pandas as pd
810
from pandas import (
911
DataFrame,
@@ -750,7 +752,7 @@ def test_to_numeric_from_nullable_string(values, nullable_string_dtype, expected
750752
"UInt64",
751753
"signed",
752754
"UInt64",
753-
marks=pytest.mark.xfail(reason="GH38798"),
755+
marks=pytest.mark.xfail(not is_platform_arm(), reason="GH38798"),
754756
),
755757
([1, 1], "Int64", "unsigned", "UInt8"),
756758
([1.0, 1.0], "Float32", "unsigned", "UInt8"),

pandas/tests/window/test_rolling.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77
import pytest
88

9+
from pandas.compat import is_platform_arm
910
from pandas.errors import UnsupportedFunctionCall
1011

1112
from pandas import (
@@ -1072,6 +1073,7 @@ def test_rolling_sem(frame_or_series):
10721073
tm.assert_series_equal(result, expected)
10731074

10741075

1076+
@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
10751077
@pytest.mark.parametrize(
10761078
("func", "third_value", "values"),
10771079
[

0 commit comments

Comments
 (0)