diff --git a/.travis.yml b/.travis.yml index 2c8533d02ddc1..98826a2d9e115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,11 @@ matrix: fast_finish: true include: + # In allowed failures + - dist: bionic + python: 3.9-dev + env: + - JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)" - env: - JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)" @@ -53,6 +58,11 @@ matrix: services: - mysql - postgresql + allow_failures: + - dist: bionic + python: 3.9-dev + env: + - JOB="3.9-dev" PATTERN="(not slow and not network)" before_install: - echo "before_install" @@ -83,7 +93,7 @@ install: script: - echo "script start" - echo "$JOB" - - source activate pandas-dev + - if [ "$JOB" != "3.9-dev" ]; then source activate pandas-dev; fi - ci/run_tests.sh after_script: diff --git a/ci/build39.sh b/ci/build39.sh new file mode 100755 index 0000000000000..f85e1c7def206 --- /dev/null +++ b/ci/build39.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e +# Special build for python3.9 until numpy puts its own wheels up + +sudo apt-get install build-essential gcc xvfb +pip install --no-deps -U pip wheel setuptools +pip install python-dateutil pytz pytest pytest-xdist hypothesis +pip install cython --pre # https://github.com/cython/cython/issues/3395 + +git clone https://github.com/numpy/numpy +cd numpy +python setup.py build_ext --inplace +python setup.py install +cd .. +rm -rf numpy + +python setup.py build_ext -inplace +python -m pip install --no-build-isolation -e . + +python -c "import sys; print(sys.version_info)" +python -c "import pandas as pd" +python -c "import hypothesis" diff --git a/ci/setup_env.sh b/ci/setup_env.sh index 16bbd7693da37..76f47b7ed3634 100755 --- a/ci/setup_env.sh +++ b/ci/setup_env.sh @@ -1,5 +1,10 @@ #!/bin/bash -e +if [ "$JOB" == "3.9-dev" ]; then + /bin/bash ci/build39.sh + exit 0 +fi + # edit the locale file if needed if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then echo "Adding locale to the first line of pandas/__init__.py" diff --git a/pandas/compat/__init__.py b/pandas/compat/__init__.py index 6570e0782a69a..f7bb73b916ce0 100644 --- a/pandas/compat/__init__.py +++ b/pandas/compat/__init__.py @@ -16,6 +16,7 @@ PY37 = sys.version_info >= (3, 7) PY38 = sys.version_info >= (3, 8) +PY39 = sys.version_info >= (3, 9) PYPY = platform.python_implementation() == "PyPy" diff --git a/pandas/tests/scalar/timedelta/test_arithmetic.py b/pandas/tests/scalar/timedelta/test_arithmetic.py index 2d86ce275de7c..2114962cfc0bd 100644 --- a/pandas/tests/scalar/timedelta/test_arithmetic.py +++ b/pandas/tests/scalar/timedelta/test_arithmetic.py @@ -8,7 +8,7 @@ import pytest import pandas as pd -from pandas import NaT, Timedelta, Timestamp, _is_numpy_dev, offsets +from pandas import NaT, Timedelta, Timestamp, _is_numpy_dev, compat, offsets import pandas._testing as tm from pandas.core import ops @@ -422,7 +422,8 @@ def test_td_div_numeric_scalar(self): pytest.param( np.float64("NaN"), marks=pytest.mark.xfail( - _is_numpy_dev, + # Works on numpy dev only in python 3.9 + _is_numpy_dev and not compat.PY39, raises=RuntimeWarning, reason="https://github.com/pandas-dev/pandas/issues/31992", ),