ARROW-180 Support PyArrow 13 #1110
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Tests | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
concurrency: | |
group: tests-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
working-directory: ./bindings/python | |
shell: bash -eux {0} | |
jobs: | |
pre-commit: | |
name: pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
- uses: pre-commit/action@v2.0.0 | |
with: | |
extra_args: --all-files --hook-stage=manual | |
build: | |
# supercharge/mongodb-github-action requires containers so we don't test other platforms | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["macos-latest", "windows-latest", "ubuntu-latest"] | |
python-version: [3.8, 3.9, "3.10", "3.11"] | |
fail-fast: false | |
name: CPython ${{ matrix.python-version }}-${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: '**/setup.cfg' | |
- name: Set up env | |
run: | | |
echo "LIBBSON_INSTALL_DIR=$PWD/libbson" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=$PWD/libbson/lib" >> $GITHUB_ENV | |
- name: Start MongoDB on MacOS | |
if: ${{ startsWith(runner.os, 'macOS') }} | |
run: | | |
mkdir data | |
mongod --fork --dbpath=$(pwd)/data --logpath=$PWD/mongo.log | |
# Install pkg-config | |
brew install pkg-config | |
- name: Start MongoDB on Windows | |
if: ${{ startsWith(runner.os, 'Windows') }} | |
shell: powershell | |
run: | | |
mkdir data | |
mongod --remove | |
mongod --install --dbpath=$(pwd)/data --logpath=$PWD/mongo.log | |
net start MongoDB | |
- name: Install libbson | |
run: | | |
pip install packaging # needed for mongo-c-driver-1.24.4/build/calc_release_version.py | |
./build-libbson.sh | |
- name: Install Python dependencies | |
run: | | |
python -m pip install -U pip | |
- name: Install pymongoarrow | |
run: | | |
# Install the library with no deps | |
python -m pip install -v -e "." | |
- name: Ensure imports with no test deps | |
run: | | |
python -c "from pymongoarrow.monkey import patch_all; patch_all()" | |
- name: Install the test dependencies | |
run: | | |
python -m pip install -v -e ".[test]" | |
- name: Run the tests | |
run: | | |
PYTHONWARNINGS=error python -m pytest -s -vv | |
- name: Check the manifest | |
run: | | |
pip install check-manifest | |
check-manifest -v | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache conda | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('bindings/python/docs/environment.yml') }} | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: mongo_arrow_documentation | |
environment-file: bindings/python/docs/environment.yml | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Install lib | |
shell: bash -l {0} | |
run: | | |
pip install . | |
- name: Build docs with warnings | |
shell: bash -l {0} | |
run: | | |
pushd docs | |
make html SPHINXOPTS="-W" | |
- name: Run linkcheck | |
shell: bash -l {0} | |
run: | | |
pushd docs | |
make linkcheck |