Skip to content

Commit 89e44e6

Browse files
authored
CI: Setup 3.9 Travis Build (#33505)
* Python 3.9 build * Python 3.9 build * Python 3.9 build * Python 3.9 build * Update build39.sh minor comments * Update .travis.yml Skip clipboard tests * Python 3.9 tests * Dummy commit * Use numpy master manylinux wheel * use scipy nightly wheels * Build numpy from source
1 parent 6f5614b commit 89e44e6

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

.travis.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ matrix:
2727
fast_finish: true
2828

2929
include:
30+
# In allowed failures
31+
- dist: bionic
32+
python: 3.9-dev
33+
env:
34+
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
3035
- env:
3136
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"
3237

@@ -53,6 +58,11 @@ matrix:
5358
services:
5459
- mysql
5560
- postgresql
61+
allow_failures:
62+
- dist: bionic
63+
python: 3.9-dev
64+
env:
65+
- JOB="3.9-dev" PATTERN="(not slow and not network)"
5666

5767
before_install:
5868
- echo "before_install"
@@ -83,7 +93,7 @@ install:
8393
script:
8494
- echo "script start"
8595
- echo "$JOB"
86-
- source activate pandas-dev
96+
- if [ "$JOB" != "3.9-dev" ]; then source activate pandas-dev; fi
8797
- ci/run_tests.sh
8898

8999
after_script:

ci/build39.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -e
2+
# Special build for python3.9 until numpy puts its own wheels up
3+
4+
sudo apt-get install build-essential gcc xvfb
5+
pip install --no-deps -U pip wheel setuptools
6+
pip install python-dateutil pytz pytest pytest-xdist hypothesis
7+
pip install cython --pre # https://github.com/cython/cython/issues/3395
8+
9+
git clone https://github.com/numpy/numpy
10+
cd numpy
11+
python setup.py build_ext --inplace
12+
python setup.py install
13+
cd ..
14+
rm -rf numpy
15+
16+
python setup.py build_ext -inplace
17+
python -m pip install --no-build-isolation -e .
18+
19+
python -c "import sys; print(sys.version_info)"
20+
python -c "import pandas as pd"
21+
python -c "import hypothesis"

ci/setup_env.sh

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash -e
22

3+
if [ "$JOB" == "3.9-dev" ]; then
4+
/bin/bash ci/build39.sh
5+
exit 0
6+
fi
7+
38
# edit the locale file if needed
49
if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
510
echo "Adding locale to the first line of pandas/__init__.py"

pandas/compat/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
PY37 = sys.version_info >= (3, 7)
1818
PY38 = sys.version_info >= (3, 8)
19+
PY39 = sys.version_info >= (3, 9)
1920
PYPY = platform.python_implementation() == "PyPy"
2021

2122

pandas/tests/scalar/timedelta/test_arithmetic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99

1010
import pandas as pd
11-
from pandas import NaT, Timedelta, Timestamp, _is_numpy_dev, offsets
11+
from pandas import NaT, Timedelta, Timestamp, _is_numpy_dev, compat, offsets
1212
import pandas._testing as tm
1313
from pandas.core import ops
1414

@@ -422,7 +422,8 @@ def test_td_div_numeric_scalar(self):
422422
pytest.param(
423423
np.float64("NaN"),
424424
marks=pytest.mark.xfail(
425-
_is_numpy_dev,
425+
# Works on numpy dev only in python 3.9
426+
_is_numpy_dev and not compat.PY39,
426427
raises=RuntimeWarning,
427428
reason="https://github.com/pandas-dev/pandas/issues/31992",
428429
),

0 commit comments

Comments
 (0)