-
Notifications
You must be signed in to change notification settings - Fork 358
194 lines (191 loc) · 7.74 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
pip_build:
name: PIP (Python, Spark, pandas, PyArrow)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.5
spark-version: 2.3.4
pandas-version: 0.23.4
pyarrow-version: 0.16.0
numpy-version: 1.18.5
- python-version: 3.6
spark-version: 2.3.4
pandas-version: 0.24.2
pyarrow-version: 0.10.0
numpy-version: 1.19.5
default-index-type: 'distributed-sequence'
- python-version: 3.9
spark-version: 3.1.2
pandas-version: 1.2.5
pyarrow-version: 3.0.0
numpy-version: 1.20.3
- python-version: 3.9
spark-version: 3.2.0
pandas-version: 1.2.5
pyarrow-version: 4.0.1
numpy-version: 1.21.2
default-index-type: 'distributed-sequence'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
PANDAS_VERSION: ${{ matrix.pandas-version }}
PYARROW_VERSION: ${{ matrix.pyarrow-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
DEFAULT_INDEX_TYPE: ${{ matrix.default-index-type }}
KOALAS_TESTING: 1
SPARK_LOCAL_IP: 127.0.0.1
# DISPLAY=0.0 does not work in Github Actions with Python 3.5. Here we work around with xvfb-run
PYTHON_EXECUTABLE: xvfb-run python
# Github token is required to auto-generate the release notes from Github release notes
GITHUB_OAUTH_KEY: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install xclip
# It fails due to missing 'bdist_wheel' for some reasons. Explicitly installs it.
# See also https://github.com/palantir/python-language-server/issues/524#issuecomment-477068693.
pip install wheel setuptools
python setup.py bdist_wheel
# Currently PIP with Python 3.5 removes Black in the requirements-dev.txt file
# as Black only works with Python 3.6+. This is hacky but we will drop
# Python 3.5 soon so it's fine.
if [[ "$PYTHON_VERSION" < "3.6" ]]; then sed -i '/black/d' requirements-dev.txt; fi
# sphinx-plotly-directive supports Python 3.6+
if [[ "$PYTHON_VERSION" < "3.6" ]]; then sed -i '/sphinx-plotly-directive/d' requirements-dev.txt; fi
# Disable mypy check for PySpark 3.1
if [[ "$SPARK_VERSION" > "3.1" ]]; then sed -i '/mypy/d' requirements-dev.txt; fi
pip install -r requirements-dev.txt
pip install pandas==$PANDAS_VERSION pyarrow==$PYARROW_VERSION pyspark==$SPARK_VERSION numpy==$NUMPY_VERSION
# matplotlib dropped Python 3.5 support from 3.1.x; however, 3.0.3 only supports sphinx 2.x.
# It forces the sphinx version to 2.x.
if [[ "$PYTHON_VERSION" < "3.6" ]]; then pip install "sphinx<3.0.0"; fi
pip list
- name: Run tests
run: |
# lint-python uses python3 as default. Seems python3 could pick a different Python.
# Looks a side effect from manual Python 3.5 installation.
PYTHON_EXECUTABLE=python ./dev/lint-python
./dev/pytest
- uses: codecov/codecov-action@v1
conda_build:
name: Conda (Python, Spark, pandas, PyArrow)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.6
spark-version: 2.4.7
pandas-version: 0.24.2
pyarrow-version: 0.14.1
numpy-version: 1.19.5
logger: databricks.koalas.usage_logging.usage_logger
- python-version: 3.7
spark-version: 2.4.7
pandas-version: 0.25.3
pyarrow-version: 0.15.1
numpy-version: 1.19.5
default-index-type: 'distributed-sequence'
- python-version: 3.7
spark-version: 3.0.2
pandas-version: 1.0.5
pyarrow-version: 1.0.1
numpy-version: 1.19.5
- python-version: 3.7
spark-version: 3.1.1
pandas-version: 1.1.5
pyarrow-version: 2.0.0
numpy-version: 1.19.5
default-index-type: 'distributed-sequence'
- python-version: 3.8
spark-version: 3.0.2
pandas-version: 1.1.5
pyarrow-version: 2.0.0
numpy-version: 1.19.5
- python-version: 3.8
spark-version: 3.1.1
pandas-version: 1.2.5
pyarrow-version: 3.0.0
numpy-version: 1.20.3
default-index-type: 'distributed-sequence'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
SPARK_VERSION: ${{ matrix.spark-version }}
PANDAS_VERSION: ${{ matrix.pandas-version }}
PYARROW_VERSION: ${{ matrix.pyarrow-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
DEFAULT_INDEX_TYPE: ${{ matrix.default-index-type }}
KOALAS_TESTING: 1
SPARK_LOCAL_IP: 127.0.0.1
# `QT_QPA_PLATFORM` for resolving 'QXcbConnection: Could not connect to display :0.0'
DISPLAY: 0.0
QT_QPA_PLATFORM: offscreen
KOALAS_USAGE_LOGGER: ${{ matrix.logger }}
# Github token is required to auto-generate the release notes from Github release notes
GITHUB_OAUTH_KEY: ${{ secrets.GITHUB_TOKEN }}
# Github Actions' default miniconda
CONDA_PREFIX: /usr/share/miniconda
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install dependencies
run: |
# See also https://github.com/conda/conda/issues/7980
source "$CONDA_PREFIX/etc/profile.d/conda.sh"
conda update -q conda
conda create -c conda-forge -q -n test-environment python=$PYTHON_VERSION
conda activate test-environment
conda install -c conda-forge --yes codecov
conda config --env --add pinned_packages python=$PYTHON_VERSION
conda config --env --add pinned_packages pandas==$PANDAS_VERSION
conda config --env --add pinned_packages pyarrow==$PYARROW_VERSION
conda config --env --add pinned_packages numpy==$NUMPY_VERSION
conda config --env --add pinned_packages pyspark==$SPARK_VERSION
if [[ "$SPARK_VERSION" < "3.0" ]]; then
pip install pyspark==$SPARK_VERSION
else
conda install -c conda-forge --yes pyspark==$SPARK_VERSION
fi
conda install -c conda-forge --yes pandas==$PANDAS_VERSION pyarrow==$PYARROW_VERSION numpy==$NUMPY_VERSION
sed -i -e "/pandas/d" -e "/pyarrow/d" -e "/numpy>=/d" requirements-dev.txt
# Disable mypy check for PySpark 3.1
if [[ "$SPARK_VERSION" > "3.1" ]]; then sed -i '/mypy/d' requirements-dev.txt; fi
# sphinx-plotly-directive is not available on Conda.
sed -i '/sphinx-plotly-directive/d' requirements-dev.txt
conda install -c conda-forge --yes --file requirements-dev.txt
pip install sphinx-plotly-directive # pip-only dependency
conda list
- name: Run tests
run: |
# See also https://github.com/conda/conda/issues/7980
source "$CONDA_PREFIX/etc/profile.d/conda.sh"
conda activate test-environment
./dev/lint-python
./dev/pytest
- uses: codecov/codecov-action@v1