diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000000..c19b4d629d81b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,41 @@ +kind: pipeline +type: docker +name: py37-arm64 + +platform: + arch: arm64 + +steps: +- name: Fetch Tags + image: alpine/git + commands: + - git fetch --tags + +- name: Setup Environment + image: python:3.7 + commands: + - python -m venv pandas-dev + - . pandas-dev/bin/activate + - python -m pip install --upgrade pip setuptools + - python -m pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis + +- name: Build Pandas + image: python:3.7 + commands: + - . pandas-dev/bin/activate + - python setup.py build_ext -j 4 + - python -m pip install -e . --no-build-isolation --no-use-pep517 + +- name: Run Test + image: python:3.7 + commands: + - . pandas-dev/bin/activate + - pytest -m "(not slow and not network and not clipboard)" -n 2 --dist=loadfile -s --strict-markers --durations=30 --junitxml=test-data.xml pandas + +trigger: + branch: + - master + - feature/* + event: + - push + - pull_request diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8ede978074a9c..0000000000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -language: python -python: 3.7 - -addons: - apt: - update: true - packages: - - xvfb - -services: - - xvfb - -# To turn off cached cython files and compiler cache -# set NOCACHE-true -# To delete caches go to https://travis-ci.org/OWNER/REPOSITORY/caches or run -# travis cache --delete inside the project directory from the travis command line client -# The cache directories will be deleted if anything in ci/ changes in a commit -cache: - apt: true - ccache: true - directories: - - $HOME/.cache # cython cache - -env: - global: - # create a github personal access token - # cd pandas-dev/pandas - # travis encrypt 'PANDAS_GH_TOKEN=personal_access_token' -r pandas-dev/pandas - - secure: "EkWLZhbrp/mXJOx38CHjs7BnjXafsqHtwxPQrqWy457VDFWhIY1DMnIR/lOWG+a20Qv52sCsFtiZEmMfUjf0pLGXOqurdxbYBGJ7/ikFLk9yV2rDwiArUlVM9bWFnFxHvdz9zewBH55WurrY4ShZWyV+x2dWjjceWG5VpWeI6sA=" - -git: - depth: false - -matrix: - fast_finish: true - - include: - - arch: arm64 - env: - - JOB="3.7, arm64" PYTEST_WORKERS=1 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)" - - allow_failures: - # Moved to allowed_failures 2020-09-29 due to timeouts https://github.com/pandas-dev/pandas/issues/36719 - - arch: arm64 - env: - - JOB="3.7, arm64" PYTEST_WORKERS=1 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)" - - -before_install: - - echo "before_install" - # Use blocking IO on travis. Ref: https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 - - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - - source ci/travis_process_gbq_encryption.sh - - export PATH="$HOME/miniconda3/bin:$PATH" - - df -h - - pwd - - uname -a - - git --version - - ./ci/check_git_tags.sh - -install: - - echo "install start" - - ci/prep_cython_cache.sh - - ci/setup_env.sh - - ci/submit_cython_cache.sh - - echo "install done" - -script: - - echo "script start" - - echo "$JOB" - - source activate pandas-dev - - ci/run_tests.sh - -after_script: - - echo "after_script start" - - source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd - - ci/print_skipped.py - - echo "after_script done" diff --git a/ci/deps/travis-37-arm64.yaml b/ci/deps/drone-37-arm64.yaml similarity index 100% rename from ci/deps/travis-37-arm64.yaml rename to ci/deps/drone-37-arm64.yaml diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py index eb6cf4f9d7d85..1e7a69aa2d8a0 100644 --- a/pandas/compat/__init__.py +++ b/pandas/compat/__init__.py @@ -26,6 +26,7 @@ PY39 = sys.version_info >= (3, 9) PYPY = platform.python_implementation() == "PyPy" IS64 = sys.maxsize > 2 ** 32 +ARM64 = platform.machine() in ["arm64", "aarch64"] def set_function_name(f: F, name: str, cls) -> F: diff --git a/pandas/conftest.py b/pandas/conftest.py index 688ad6dcc5e48..6f124039aeb2d 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -82,9 +82,6 @@ def pytest_configure(config): ) config.addinivalue_line("markers", "high_memory: mark a test as a high-memory only") config.addinivalue_line("markers", "clipboard: mark a pd.read_clipboard test") - config.addinivalue_line( - "markers", "arm_slow: mark a test as slow for arm64 architecture" - ) def pytest_addoption(parser): diff --git a/pandas/tests/arithmetic/test_datetime64.py b/pandas/tests/arithmetic/test_datetime64.py index f75b3800f623f..faa2c567869de 100644 --- a/pandas/tests/arithmetic/test_datetime64.py +++ b/pandas/tests/arithmetic/test_datetime64.py @@ -19,7 +19,10 @@ from pandas._libs.tslibs.conversion import localize_pydatetime from pandas._libs.tslibs.offsets import shift_months -from pandas.compat import np_datetime64_compat +from pandas.compat import ( + ARM64, + np_datetime64_compat, +) from pandas.errors import PerformanceWarning import pandas as pd @@ -806,7 +809,7 @@ class TestDatetime64Arithmetic: # ------------------------------------------------------------- # Addition/Subtraction of timedelta-like - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_dt64arr_add_timedeltalike_scalar( self, tz_naive_fixture, two_hours, box_with_array ): diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index 285d6286931af..04ae3f68c9f9f 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -17,7 +17,10 @@ import pytest import pytz -from pandas.compat import np_version_under1p19 +from pandas.compat import ( + ARM64, + np_version_under1p19, +) import pandas.util._test_decorators as td from pandas.core.dtypes.common import is_integer_dtype @@ -2163,7 +2166,7 @@ def test_to_frame_with_falsey_names(self): result = DataFrame(Series(name=0, dtype=object)).dtypes tm.assert_series_equal(result, expected) - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @pytest.mark.parametrize("dtype", [None, "uint8", "category"]) def test_constructor_range_dtype(self, dtype): expected = DataFrame({"A": [0, 1, 2, 3, 4]}, dtype=dtype or "int64") diff --git a/pandas/tests/groupby/test_groupby_dropna.py b/pandas/tests/groupby/test_groupby_dropna.py index ab568e24ff029..4ba293076c685 100644 --- a/pandas/tests/groupby/test_groupby_dropna.py +++ b/pandas/tests/groupby/test_groupby_dropna.py @@ -1,6 +1,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + import pandas as pd import pandas._testing as tm @@ -262,7 +264,7 @@ def test_groupby_dropna_multi_index_dataframe_agg(dropna, tuples, outputs): tm.assert_frame_equal(grouped, expected) -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @pytest.mark.parametrize( "datetime1, datetime2", [ diff --git a/pandas/tests/groupby/transform/test_transform.py b/pandas/tests/groupby/transform/test_transform.py index 9350a3fcd3036..cf8a2d12532cb 100644 --- a/pandas/tests/groupby/transform/test_transform.py +++ b/pandas/tests/groupby/transform/test_transform.py @@ -4,6 +4,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + from pandas.core.dtypes.common import ( ensure_platform_int, is_timedelta64_dtype, @@ -631,7 +633,7 @@ def test_groupby_cum_skipna(op, skipna, input, exp): tm.assert_series_equal(expected, result) -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @pytest.mark.parametrize( "op, args, targop", [ diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index e5a24e9b938e2..7b19191385aae 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -699,7 +699,6 @@ def test_is_unique(self): index_na_dup = index_na.insert(0, np.nan) assert index_na_dup.is_unique is False - @pytest.mark.arm_slow def test_engine_reference_cycle(self): # GH27585 index = self.create_index() diff --git a/pandas/tests/indexes/interval/test_astype.py b/pandas/tests/indexes/interval/test_astype.py index f421a4695138c..6926ee49ec911 100644 --- a/pandas/tests/indexes/interval/test_astype.py +++ b/pandas/tests/indexes/interval/test_astype.py @@ -3,6 +3,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + from pandas.core.dtypes.dtypes import ( CategoricalDtype, IntervalDtype, @@ -168,6 +170,7 @@ def test_subtype_integer_with_non_integer_borders(self, subtype): ) tm.assert_index_equal(result, expected) + @pytest.mark.xfail(ARM64, reason="GH 38923") def test_subtype_integer_errors(self): # float64 -> uint64 fails with negative values index = interval_range(-10.0, 10.0) diff --git a/pandas/tests/indexes/multi/test_duplicates.py b/pandas/tests/indexes/multi/test_duplicates.py index bc0b6e0b028a8..3251011a323ed 100644 --- a/pandas/tests/indexes/multi/test_duplicates.py +++ b/pandas/tests/indexes/multi/test_duplicates.py @@ -4,6 +4,7 @@ import pytest from pandas._libs import hashtable +from pandas.compat import ARM64 from pandas import ( DatetimeIndex, @@ -244,7 +245,7 @@ def test_duplicated(idx_dup, keep, expected): tm.assert_numpy_array_equal(result, expected) -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_duplicated_large(keep): # GH 9125 n, k = 200, 5000 diff --git a/pandas/tests/indexes/multi/test_integrity.py b/pandas/tests/indexes/multi/test_integrity.py index ff0c2a0d67885..b047a89566a7d 100644 --- a/pandas/tests/indexes/multi/test_integrity.py +++ b/pandas/tests/indexes/multi/test_integrity.py @@ -3,6 +3,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike import pandas as pd @@ -122,7 +124,7 @@ def test_consistency(): assert index.is_unique is False -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_hash_collisions(): # non-smoke test that we don't get hash collisions diff --git a/pandas/tests/indexes/multi/test_setops.py b/pandas/tests/indexes/multi/test_setops.py index 4a170d9cd161f..74b95d7754d9d 100644 --- a/pandas/tests/indexes/multi/test_setops.py +++ b/pandas/tests/indexes/multi/test_setops.py @@ -1,6 +1,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + import pandas as pd from pandas import ( Index, @@ -41,7 +43,7 @@ def test_intersection_base(idx, sort, klass): first.intersection([1, 2, 3], sort=sort) -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @pytest.mark.parametrize("klass", [MultiIndex, np.array, Series, list]) def test_union_base(idx, sort, klass): first = idx[::-1] diff --git a/pandas/tests/indexes/period/test_indexing.py b/pandas/tests/indexes/period/test_indexing.py index 9b7685b23289a..95c73859c8945 100644 --- a/pandas/tests/indexes/period/test_indexing.py +++ b/pandas/tests/indexes/period/test_indexing.py @@ -8,6 +8,7 @@ import pytest from pandas._libs.tslibs import period as libperiod +from pandas.compat import ARM64 from pandas.errors import InvalidIndexError import pandas as pd @@ -182,7 +183,7 @@ def test_getitem_list_periods(self): exp = ts.iloc[[1]] tm.assert_series_equal(ts[[Period("2012-01-02", freq="D")]], exp) - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_getitem_seconds(self): # GH#6716 didx = date_range(start="2013/01/01 09:00:00", freq="S", periods=4000) diff --git a/pandas/tests/indexing/interval/test_interval.py b/pandas/tests/indexing/interval/test_interval.py index eb13ec1f366af..0421477daa34d 100644 --- a/pandas/tests/indexing/interval/test_interval.py +++ b/pandas/tests/indexing/interval/test_interval.py @@ -1,6 +1,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + import pandas as pd from pandas import ( DataFrame, @@ -71,7 +73,7 @@ def test_getitem_non_matching(self, series_with_interval_index, indexer_sl): with pytest.raises(KeyError, match=r"^\[-1\]$"): indexer_sl(ser)[[-1, 3]] - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_loc_getitem_large_series(self): ser = Series( np.arange(1000000), index=IntervalIndex.from_breaks(np.arange(1000001)) diff --git a/pandas/tests/indexing/multiindex/test_chaining_and_caching.py b/pandas/tests/indexing/multiindex/test_chaining_and_caching.py index f71b39d53d825..baf354d6fe938 100644 --- a/pandas/tests/indexing/multiindex/test_chaining_and_caching.py +++ b/pandas/tests/indexing/multiindex/test_chaining_and_caching.py @@ -53,7 +53,6 @@ def test_cache_updating(): assert result == 2 -@pytest.mark.arm_slow def test_indexer_caching(): # GH5727 # make sure that indexers are in the _internal_names_set diff --git a/pandas/tests/indexing/test_chaining_and_caching.py b/pandas/tests/indexing/test_chaining_and_caching.py index 49181f0fdee7e..ecb0b0b5d4d0e 100644 --- a/pandas/tests/indexing/test_chaining_and_caching.py +++ b/pandas/tests/indexing/test_chaining_and_caching.py @@ -3,6 +3,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + import pandas as pd from pandas import ( DataFrame, @@ -28,6 +30,7 @@ def random_text(nobs=100): return DataFrame(df, columns=["letters"]) +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") class TestCaching: def test_slice_consolidate_invalidate_item_cache(self): @@ -154,7 +157,6 @@ def test_setitem_chained_setfault(self): result = df.head() tm.assert_frame_equal(result, expected) - @pytest.mark.arm_slow def test_detect_chained_assignment(self): pd.set_option("chained_assignment", "raise") @@ -168,7 +170,6 @@ def test_detect_chained_assignment(self): df["A"][1] = -6 tm.assert_frame_equal(df, expected) - @pytest.mark.arm_slow def test_detect_chained_assignment_raises(self): # test with the chaining @@ -188,7 +189,6 @@ def test_detect_chained_assignment_raises(self): assert df["A"]._is_copy is None - @pytest.mark.arm_slow def test_detect_chained_assignment_fails(self): # Using a copy (the chain), fails @@ -202,7 +202,6 @@ def test_detect_chained_assignment_fails(self): with pytest.raises(com.SettingWithCopyError, match=msg): df.loc[0]["A"] = -5 - @pytest.mark.arm_slow def test_detect_chained_assignment_doc_example(self): # Doc example @@ -218,7 +217,6 @@ def test_detect_chained_assignment_doc_example(self): indexer = df.a.str.startswith("o") df[indexer]["c"] = 42 - @pytest.mark.arm_slow def test_detect_chained_assignment_object_dtype(self): expected = DataFrame({"A": [111, "bbb", "ccc"], "B": [1, 2, 3]}) @@ -233,7 +231,6 @@ def test_detect_chained_assignment_object_dtype(self): df.loc[0, "A"] = 111 tm.assert_frame_equal(df, expected) - @pytest.mark.arm_slow def test_detect_chained_assignment_is_copy_pickle(self): # gh-5475: Make sure that is_copy is picked up reconstruction @@ -246,7 +243,6 @@ def test_detect_chained_assignment_is_copy_pickle(self): df2["B"] = df2["A"] df2["B"] = df2["A"] - @pytest.mark.arm_slow def test_detect_chained_assignment_setting_entire_column(self): # gh-5597: a spurious raise as we are setting the entire column here @@ -267,7 +263,6 @@ def test_detect_chained_assignment_setting_entire_column(self): assert df._is_copy is None df["letters"] = df["letters"].apply(str.lower) - @pytest.mark.arm_slow def test_detect_chained_assignment_implicit_take(self): # Implicitly take @@ -278,7 +273,6 @@ def test_detect_chained_assignment_implicit_take(self): assert df._is_copy is not None df["letters"] = df["letters"].apply(str.lower) - @pytest.mark.arm_slow def test_detect_chained_assignment_implicit_take2(self): # Implicitly take 2 @@ -295,14 +289,12 @@ def test_detect_chained_assignment_implicit_take2(self): df["letters"] = df["letters"].apply(str.lower) assert df._is_copy is None - @pytest.mark.arm_slow def test_detect_chained_assignment_str(self): df = random_text(100000) indexer = df.letters.apply(lambda x: len(x) > 10) df.loc[indexer, "letters"] = df.loc[indexer, "letters"].apply(str.lower) - @pytest.mark.arm_slow def test_detect_chained_assignment_is_copy(self): # an identical take, so no copy @@ -310,7 +302,6 @@ def test_detect_chained_assignment_is_copy(self): assert df._is_copy is None df["a"] += 1 - @pytest.mark.arm_slow def test_detect_chained_assignment_sorting(self): df = DataFrame(np.random.randn(10, 4)) @@ -319,7 +310,6 @@ def test_detect_chained_assignment_sorting(self): tm.assert_series_equal(ser, df.iloc[:, 0].sort_values()) tm.assert_series_equal(ser, df[0].sort_values()) - @pytest.mark.arm_slow def test_detect_chained_assignment_false_positives(self): # see gh-6025: false positives @@ -335,7 +325,6 @@ def test_detect_chained_assignment_false_positives(self): df["column1"] = df["column1"] + "c" str(df) - @pytest.mark.arm_slow def test_detect_chained_assignment_undefined_column(self): # from SO: @@ -346,7 +335,6 @@ def test_detect_chained_assignment_undefined_column(self): with pytest.raises(com.SettingWithCopyError, match=msg): df.iloc[0:5]["group"] = "a" - @pytest.mark.arm_slow def test_detect_chained_assignment_changing_dtype(self): # Mixed type setting but same dtype & changing dtype diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index 23b3ce7508626..37d9fd8125617 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -13,6 +13,7 @@ import numpy as np import pytest +from pandas.compat import ARM64 import pandas.util._test_decorators as td import pandas as pd @@ -853,7 +854,7 @@ def test_loc_non_unique(self): expected = DataFrame({"A": [2, 4, 5], "B": [4, 6, 7]}, index=[1, 1, 2]) tm.assert_frame_equal(result, expected) - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_loc_non_unique_memory_error(self): # GH 4280 diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index 2fa3acf939c5b..4344ebfb1fca4 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -5,6 +5,8 @@ import numpy as np import pytest +from pandas.compat import ARM64 + from pandas import ( DataFrame, MultiIndex, @@ -67,7 +69,7 @@ def test_int64_overflow(self): assert left[k] == v assert len(left) == len(right) - @pytest.mark.arm_slow + @pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") def test_int64_overflow_moar(self): # GH9096 diff --git a/pandas/tests/tools/test_to_numeric.py b/pandas/tests/tools/test_to_numeric.py index 65aa189a3e965..7af551a0764d9 100644 --- a/pandas/tests/tools/test_to_numeric.py +++ b/pandas/tests/tools/test_to_numeric.py @@ -4,6 +4,8 @@ from numpy import iinfo import pytest +from pandas.compat import ARM64 + import pandas as pd from pandas import ( DataFrame, @@ -752,7 +754,7 @@ def test_to_numeric_from_nullable_string(values, expected): "UInt64", "signed", "UInt64", - marks=pytest.mark.xfail(reason="GH38798"), + marks=pytest.mark.xfail(not ARM64, reason="GH38798"), ), ([1, 1], "Int64", "unsigned", "UInt8"), ([1.0, 1.0], "Float32", "unsigned", "UInt8"), diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 8e0ace7775868..a959ced5cd798 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -20,6 +20,8 @@ import pytest import pytz +from pandas.compat import ARM64 + import pandas as pd from pandas import Timestamp @@ -91,7 +93,7 @@ # Offset-specific behaviour tests -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @given(gen_random_datetime, gen_yqm_offset) def test_on_offset_implementations(dt, offset): assume(not offset.normalize) diff --git a/pandas/tests/tseries/offsets/test_ticks.py b/pandas/tests/tseries/offsets/test_ticks.py index 52a2f3aeee850..9e826ed12ea59 100644 --- a/pandas/tests/tseries/offsets/test_ticks.py +++ b/pandas/tests/tseries/offsets/test_ticks.py @@ -17,6 +17,7 @@ import pytest from pandas._libs.tslibs.offsets import delta_to_tick +from pandas.compat import ARM64 from pandas import ( Timedelta, @@ -82,7 +83,7 @@ def test_tick_add_sub(cls, n, m): assert left - right == expected -@pytest.mark.arm_slow +@pytest.mark.skipif(ARM64, reason="timeout on ARM64 GH 36719") @pytest.mark.parametrize("cls", tick_classes) @settings(deadline=None) @example(n=2, m=3) diff --git a/pandas/tests/window/test_rolling.py b/pandas/tests/window/test_rolling.py index 70c076e086fb7..841f3bbc043be 100644 --- a/pandas/tests/window/test_rolling.py +++ b/pandas/tests/window/test_rolling.py @@ -6,6 +6,7 @@ import numpy as np import pytest +from pandas.compat import ARM64 from pandas.errors import UnsupportedFunctionCall from pandas import ( @@ -896,6 +897,7 @@ def test_rolling_sem(frame_or_series): tm.assert_series_equal(result, expected) +@pytest.mark.xfail(ARM64, reason="GH 38921") @pytest.mark.parametrize( ("func", "third_value", "values"), [