| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: CodeQL | ||
| on: | ||
| schedule: | ||
| # every day at midnight | ||
| - cron: "0 0 * * *" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: | ||
| - python | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: github/codeql-action/init@v1 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| - uses: github/codeql-action/autobuild@v1 | ||
| - uses: github/codeql-action/analyze@v1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # vim: filetype=yaml | ||
| name: Dispatch conda lock | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: | ||
| - created | ||
|
|
||
| jobs: | ||
| condalock_dispatch: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate a GitHub token | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - uses: peter-evans/slash-command-dispatch@v2 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| reaction-token: ${{ secrets.GITHUB_TOKEN }} | ||
| permission: none | ||
| issue-type: pull-request | ||
| commands: condalock |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Conda lock PR | ||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| paths: | ||
| - 'conda-lock/*.lock' | ||
| - pyproject.toml | ||
| - poetry.lock | ||
|
|
||
| jobs: | ||
| conda_lock_comment: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.repository == 'ibis-project/ibis' }} | ||
| steps: | ||
| - name: Generate a GitHub token | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: add condalock comment | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| issue-number: ${{ github.event.number }} | ||
| body: "/condalock" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # vim: filetype=yaml | ||
| name: Relock conda environment files | ||
|
|
||
| on: | ||
| repository_dispatch: | ||
| types: | ||
| - condalock-command | ||
|
|
||
| jobs: | ||
| condalock: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: | ||
| - "3.7" | ||
| - "3.8" | ||
| - "3.9" | ||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} | ||
| ref: ${{ github.event.client_payload.pull_request.head.ref }} | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@v2 | ||
| with: | ||
| mamba-version: "*" | ||
| miniforge-version: latest | ||
| miniforge-variant: Mambaforge | ||
| activate-environment: conda-lock | ||
| python-version: ${{ matrix.python-version }} | ||
| condarc-file: ci/condarc | ||
|
|
||
| - name: install conda-lock | ||
| run: mamba install conda-lock | ||
|
|
||
| - name: generate lock file | ||
| run: | | ||
| set -euo pipefail | ||
| python_version_file="$(mktemp --suffix=.yml)" | ||
| { | ||
| echo 'name: conda-lock' | ||
| echo 'dependencies:' | ||
| echo ' - python=${{ matrix.python-version }}' | ||
| } > "${python_version_file}" | ||
| conda lock \ | ||
| --file pyproject.toml \ | ||
| --file "${python_version_file}" \ | ||
| --platform linux-64 \ | ||
| --platform osx-64 \ | ||
| --platform win-64 \ | ||
| --filename-template 'conda-lock/{platform}-${{ matrix.python-version }}.lock' \ | ||
| --extras clickhouse \ | ||
| --extras dask \ | ||
| --extras geospatial \ | ||
| --extras hdf5 \ | ||
| --extras impala \ | ||
| --extras mysql \ | ||
| --extras parquet \ | ||
| --extras postgres \ | ||
| --extras pyspark \ | ||
| --extras sqlite \ | ||
| --mamba | ||
| - name: create conda environment | ||
| run: mamba create --name ibis${{ matrix.python-version }} --file conda-lock/linux-64-${{ matrix.python-version }}.lock | ||
|
|
||
| - name: upload conda lock files | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: conda-lock-files-${{ github.run_attempt }} | ||
| path: conda-lock/*-${{ matrix.python-version }}.lock | ||
|
|
||
| condalock_push: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - condalock | ||
| steps: | ||
| - name: Generate a GitHub token | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} | ||
| ref: ${{ github.event.client_payload.pull_request.head.ref }} | ||
|
|
||
| - name: download conda lock files | ||
| uses: actions/download-artifact@v2 | ||
| with: | ||
| name: conda-lock-files-${{ github.run_attempt }} | ||
| path: conda-lock | ||
|
|
||
| - name: Configure git info | ||
| run: | | ||
| set -euo pipefail | ||
| git config --global user.name 'ibis-squawk-bot[bot]' | ||
| git config --global user.email 'ibis-squawk-bot[bot]@users.noreply.github.com' | ||
| - name: commit lock files and push to PR | ||
| run: | | ||
| set -euo pipefail | ||
| git add conda-lock/*.lock | ||
| if git commit -m 'chore(conda-lock): relock'; then | ||
| # pull in case another commit happened in the meantime | ||
| # | ||
| # `ours` is actually the *other* changeset, not the current branch, per | ||
| # https://stackoverflow.com/a/3443225/564538 | ||
| git pull --rebase -s recursive -X ours | ||
| git push | ||
| fi | ||
| - name: react on success | ||
| uses: peter-evans/create-or-update-comment@v1 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
| comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
| reaction-type: hooray |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Rotate bot keys | ||
| on: | ||
| schedule: | ||
| # https://crontab.guru/#0_0_1_*/3_* | ||
| # "At 00:00 on day-of-month 1 in every 3rd month." | ||
| - cron: "0 0 1 */3 *" | ||
|
|
||
| jobs: | ||
| rotate_private_key: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate a GitHub token | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: create issue to rotate key | ||
| uses: peter-evans/create-issue-from-file@v3 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| title: "chore: rotate ibis bot keys" | ||
| content-filepath: .github/rotate-key-template.md | ||
| labels: ci | ||
| assignees: cpcloud,jreback |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| # vim: filetype=yaml | ||
| name: Ibis Docs and Linting | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| commitlint: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: install nix | ||
| uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: lint commits | ||
| run: nix shell -L --keep-going -f '<nixpkgs>' commitlint -c commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }} --verbose | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: install nix | ||
| uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: setup cachix | ||
| uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: pre-commit checks | ||
| run: nix-shell --pure --keep-going --run 'pre-commit run --all-files' | ||
|
|
||
| docs: | ||
| name: Docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: ibis | ||
|
|
||
| - name: install nix | ||
| uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: setup cachix | ||
| uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: build docs | ||
| working-directory: ibis | ||
| run: nix-shell --pure --run 'make -C docs html BUILDDIR=web/docs' | ||
|
|
||
| - name: build website | ||
| working-directory: ibis | ||
| run: nix-shell --pure --run 'mkdocs build -f docs/mkdocs.yml' | ||
|
|
||
| - name: Add config to docs | ||
| working-directory: ibis | ||
| run: | | ||
| set -euo pipefail | ||
| touch docs/site/.nojekyll | ||
| echo "ibis-project.org" > docs/site/CNAME | ||
| - name: Generate a GitHub token | ||
| if: ${{ github.event_name == 'push' }} | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.DOCS_BOT_APP_ID }} | ||
| private_key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }} | ||
| repository: ibis-project/ibis-project.org | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| if: ${{ github.event_name == 'push' }} | ||
| with: | ||
| repository: ibis-project/ibis-project.org | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| path: ibis-project.org | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| if: ${{ github.event_name != 'push' }} | ||
| with: | ||
| repository: ibis-project/ibis-project.org | ||
| path: ibis-project.org | ||
|
|
||
| - name: Copy docbuild to checkout | ||
| working-directory: ibis | ||
| run: | | ||
| set -euo pipefail | ||
| # the trailing slash matters here; it means "everything underneath | ||
| # docbuild, but not docbuild itself" | ||
| rsync --delete --exclude=.git -avz docs/site/ ../ibis-project.org | ||
| - name: Configure git info | ||
| working-directory: ibis-project.org | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name 'ibis-docs-bot[bot]' | ||
| git config user.email 'ibis-docs-bot[bot]@users.noreply.github.com' | ||
| - name: Commit docs | ||
| working-directory: ibis-project.org | ||
| run: | | ||
| set -euo pipefail | ||
| git add . | ||
| git commit -am 'docs: ibis-project/ibis@${{ github.sha }}' || true | ||
| - name: tag docs if this is a release | ||
| if: ${{ startsWith(github.ref, 'refs/tags') }} | ||
| working-directory: ibis-project.org | ||
| run: | | ||
| set -euo pipefail | ||
| git tag "${GITHUB_REF##*/}" | ||
| - name: Push docs | ||
| if: ${{ github.event_name == 'push' }} | ||
| working-directory: ibis-project.org | ||
| run: git push --tags -f origin master | ||
|
|
||
| simulate_release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: run semantic-release | ||
| run: ./ci/release/dry_run.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| # vim: filetype=yaml | ||
| name: Ibis | ||
|
|
||
| on: | ||
| push: | ||
| # Skip the test suite if all changes are in the docs directory | ||
| paths-ignore: | ||
| - 'docs/**' | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| # Skip the test suite if all changes are in the docs directory | ||
| paths-ignore: | ||
| - 'docs/**' | ||
| branches: | ||
| - master | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| nix: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| python-version: | ||
| - "3.7" | ||
| - "3.8" | ||
| - "3.9" | ||
| - "3.10" | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: install nix | ||
| uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: setup cachix | ||
| uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: nix build and run tests | ||
| run: nix build --keep-going --print-build-logs --file . --argstr python ${{ matrix.python-version }} | ||
|
|
||
| test_no_backends: | ||
| name: Test ${{ matrix.os }} python-${{ matrix.python-version }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - windows-latest | ||
| python-version: | ||
| - "3.7" | ||
| - "3.8" | ||
| - "3.9" | ||
| - "3.10" | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: install python | ||
| uses: actions/setup-python@v2 | ||
| id: install_python | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: syphar/restore-virtualenv@v1 | ||
| with: | ||
| requirement_files: poetry.lock | ||
| custom_cache_key_element: no-backends-${{ steps.install_python.outputs.python-version }} | ||
|
|
||
| - uses: syphar/restore-pip-download-cache@v1 | ||
| with: | ||
| requirement_files: poetry.lock | ||
| custom_cache_key_element: no-backends-${{ steps.install_python.outputs.python-version }} | ||
|
|
||
| - run: python -m pip install --upgrade pip poetry | ||
|
|
||
| - name: install ibis | ||
| run: poetry install | ||
|
|
||
| - name: run tests | ||
| shell: bash | ||
| run: ./ci/run_tests.sh ibis/tests | ||
|
|
||
| - name: publish test report | ||
| uses: actions/upload-artifact@v2 | ||
| if: success() || failure() | ||
| with: | ||
| name: no-backends-${{ matrix.os }}-${{ matrix.python-version }} | ||
| path: junit.xml | ||
|
|
||
| benchmarks: | ||
| name: Benchmark ${{ matrix.os }} python-${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: | ||
| - "3.10" | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: install python | ||
| uses: actions/setup-python@v2 | ||
| id: install_python | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: install system dependencies | ||
| run: sudo apt-get install -qq -y build-essential cmake krb5-config python-dev libkrb5-dev libboost-all-dev | ||
|
|
||
| - uses: syphar/restore-virtualenv@v1 | ||
| with: | ||
| requirement_files: poetry.lock | ||
| custom_cache_key_element: benchmarks-${{ steps.install_python.outputs.python-version }} | ||
|
|
||
| - uses: syphar/restore-pip-download-cache@v1 | ||
| with: | ||
| requirement_files: poetry.lock | ||
| custom_cache_key_element: benchmarks-${{ steps.install_python.outputs.python-version }} | ||
|
|
||
| - run: python -m pip install --upgrade pip poetry | ||
|
|
||
| - name: install ibis | ||
| run: poetry install --extras impala | ||
|
|
||
| - name: benchmark | ||
| run: | | ||
| set -euo pipefail | ||
| poetry run asv machine --yes | ||
| poetry run asv dev |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| # we do not want more than one release workflow executing at the same time, ever | ||
| concurrency: | ||
| group: release | ||
| # cancelling in the middle of a release would create incomplete releases | ||
| # so cancel-in-progress is false | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.APP_ID }} | ||
| private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
|
|
||
| - uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
| extra_nix_config: | | ||
| access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
| - uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: run semantic-release | ||
| run: ./ci/release/run.sh | ||
| env: | ||
| POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,28 @@ | ||
| name: Test Report | ||
| on: | ||
| workflow_run: | ||
| workflows: ['Ibis', 'Backends'] | ||
| types: | ||
| - completed | ||
| branches-ignore: | ||
| - master | ||
|
|
||
| concurrency: report | ||
|
|
||
| jobs: | ||
| report: | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download artifact | ||
| uses: dawidd6/action-download-artifact@v2 | ||
| with: | ||
| workflow: ${{ github.event.workflow_run.workflow_id }} | ||
| pr: ${{ github.event.pull_request.number }} | ||
| path: artifacts | ||
|
|
||
| - name: publish test report | ||
| uses: EnricoMi/publish-unit-test-result-action@v1 | ||
| with: | ||
| commit: ${{ github.event.pull_request.head_sha }} | ||
| files: artifacts/**/junit.xml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| name: Update Dependencies | ||
| on: | ||
| schedule: | ||
| # run every 24 hours at midnight | ||
| - cron: "0 */24 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| generate_updates: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: output dependency list | ||
| id: set-matrix | ||
| run: | | ||
| set -euo pipefail | ||
| deps="$(jq -rcM '{dep: keys}' < nix/sources.json)" | ||
| echo "::set-output name=matrix::$deps" | ||
| niv_update: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - generate_updates | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.generate_updates.outputs.matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: setup cachix | ||
| uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - uses: cpcloud/niv-dep-info-action@main | ||
| id: get_current_commit | ||
| with: | ||
| dependency: ${{ matrix.dep }} | ||
|
|
||
| - name: update ${{ matrix.dep }} | ||
| run: nix shell -f '<nixpkgs>' niv -c niv update ${{ matrix.dep }} | ||
|
|
||
| - uses: cpcloud/niv-dep-info-action@main | ||
| id: get_new_commit | ||
| with: | ||
| dependency: ${{ matrix.dep }} | ||
|
|
||
| - name: create an output indicating whether a PR is needed | ||
| id: needs_pr | ||
| run: | | ||
| set -euo pipefail | ||
| echo "::set-output name=did_change::${{ steps.get_current_commit.outputs.rev != steps.get_new_commit.outputs.rev }}" | ||
| - uses: tibdex/github-app-token@v1 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| id: generate_pr_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - uses: tibdex/github-app-token@v1 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| id: generate_pr_approval_token | ||
| with: | ||
| app_id: ${{ secrets.PR_APPROVAL_BOT_APP_ID }} | ||
| private_key: ${{ secrets.PR_APPROVAL_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - uses: cpcloud/compare-commits-action@v5.0.13 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| id: compare_commits | ||
| with: | ||
| token: ${{ steps.generate_pr_token.outputs.token }} | ||
| owner: ${{ steps.get_new_commit.outputs.owner }} | ||
| repo: ${{ steps.get_new_commit.outputs.repo }} | ||
| basehead: ${{ steps.get_current_commit.outputs.rev }}...${{ steps.get_new_commit.outputs.rev }} | ||
| include-merge-commits: false | ||
|
|
||
| - uses: peter-evans/create-pull-request@v3 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| id: create_pr | ||
| with: | ||
| token: ${{ steps.generate_pr_token.outputs.token }} | ||
| commit-message: "chore(deps/${{ matrix.dep }}): update" | ||
| branch: "create-pull-request/update-${{ matrix.dep }}" | ||
| delete-branch: true | ||
| author: "ibis-squawk-bot[bot] <ibis-squawk-bot[bot]@users.noreply.github.com>" | ||
| title: "chore(deps/${{ matrix.dep }}): update" | ||
| body: ${{ steps.compare_commits.outputs.differences }} | ||
| labels: dependencies,autorebase:opt-in | ||
|
|
||
| - uses: juliangruber/approve-pull-request-action@v1.1.0 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| with: | ||
| github-token: ${{ steps.generate_pr_approval_token.outputs.token }} | ||
| number: ${{ steps.create_pr.outputs.pull-request-number }} | ||
|
|
||
| - uses: peter-evans/enable-pull-request-automerge@v1 | ||
| if: ${{ fromJSON(steps.needs_pr.outputs.did_change) }} | ||
| with: | ||
| token: ${{ steps.generate_pr_token.outputs.token }} | ||
| pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }} | ||
| merge-method: rebase |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Update setup.py | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - ./dev/poetry2setup | ||
| - ./dev/poetry2setup.py | ||
| - pyproject.toml | ||
| - poetry.lock | ||
|
|
||
| jobs: | ||
| generate_setup_py: | ||
| # this can only run on pull requests made from branches in the main ibis | ||
| # repository ano not forks, since the add-and-commit action requires the | ||
| # ability to push commits to the PR branch | ||
| # | ||
| # this condition checks whether the PR is coming from a branch in the main | ||
| # repo | ||
| if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate a GitHub token | ||
| uses: tibdex/github-app-token@v1 | ||
| id: generate_token | ||
| with: | ||
| app_id: ${{ secrets.SQUAWK_BOT_APP_ID }} | ||
| private_key: ${{ secrets.SQUAWK_BOT_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
|
|
||
| - name: install nix | ||
| uses: cachix/install-nix-action@v16 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
|
||
| - name: setup cachix | ||
| uses: cachix/cachix-action@v10 | ||
| with: | ||
| name: ibis | ||
| extraPullNames: nix-community,poetry2nix | ||
|
|
||
| - name: generate setup.py | ||
| run: ./dev/poetry2setup -o setup.py | ||
|
|
||
| - name: setup git credentials | ||
| uses: OleksiyRudenko/gha-git-credentials@v2.1 | ||
| with: | ||
| token: ${{ steps.generate_token.outputs.token }} | ||
| global: true | ||
| name: ibis-squawk-bot[bot] | ||
| email: ibis-squawk-bot[bot]@users.noreply.github.com | ||
|
|
||
| - name: commit setup.py and push to pull request | ||
| uses: EndBug/add-and-commit@v7 | ||
| with: | ||
| add: setup.py | ||
| author_name: ibis-squawk-bot[bot] | ||
| author_email: ibis-squawk-bot[bot]@users.noreply.github.com | ||
| message: "chore(setup.py): regenerate" | ||
| push: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "branches": ["master"], | ||
| "tagFormat": "${version}", | ||
| "plugins": [ | ||
| "@semantic-release/commit-analyzer", | ||
| "@semantic-release/release-notes-generator", | ||
| [ | ||
| "@semantic-release/changelog", | ||
| { | ||
| "changelogTitle": "Release Notes\n---", | ||
| "changelogFile": "docs/web/release_notes.md" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/exec", | ||
| { | ||
| "verifyConditionsCmd": "ci/release/verify.sh", | ||
| "prepareCmd": "ci/release/prepare.sh ${nextRelease.version}", | ||
| "publishCmd": "ci/release/publish.sh" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "assets": ["dist/*.whl"] | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/git", | ||
| { | ||
| "assets": ["pyproject.toml", "docs/web/release_notes.md"], | ||
| "message": "chore(release): ${nextRelease.version}" | ||
| } | ||
| ] | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| !.github |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure -p git nodejs nix -i bash | ||
| # shellcheck shell=bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| curdir="$PWD" | ||
| worktree="$(mktemp -d)" | ||
| branch="$(basename "$worktree")" | ||
|
|
||
| git worktree add "$worktree" | ||
|
|
||
| function cleanup() { | ||
| cd "$curdir" || exit 1 | ||
| git worktree remove "$worktree" | ||
| git worktree prune | ||
| git branch -D "$branch" | ||
| } | ||
|
|
||
| trap cleanup EXIT ERR | ||
|
|
||
| cd "$worktree" || exit 1 | ||
|
|
||
| npx --yes \ | ||
| -p semantic-release \ | ||
| -p "@semantic-release/commit-analyzer" \ | ||
| -p "@semantic-release/release-notes-generator" \ | ||
| -p "@semantic-release/changelog" \ | ||
| -p "@semantic-release/exec" \ | ||
| -p "@semantic-release/git" \ | ||
| semantic-release \ | ||
| --ci \ | ||
| --dry-run \ | ||
| --plugins \ | ||
| --analyze-commits "@semantic-release/commit-analyzer" \ | ||
| --generate-notes "@semantic-release/release-notes-generator" \ | ||
| --verify-conditions "@semantic-release/changelog,@semantic-release/exec,@semantic-release/git" \ | ||
| --prepare "@semantic-release/changelog,@semantic-release/exec" \ | ||
| --branches "$branch" \ | ||
| --repository-url "file://$PWD" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell --pure -p poetry -i bash | ||
| # shellcheck shell=bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # set version | ||
| poetry version "$1" | ||
|
|
||
| # build artifacts | ||
| poetry build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell --pure --keep POETRY_PYPI_TOKEN_PYPI -p poetry -i bash | ||
| # shellcheck shell=bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| poetry publish |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell -p cacert poetry git nodejs nix -i bash | ||
| # shellcheck shell=bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| npx --yes \ | ||
| -p semantic-release \ | ||
| -p "@semantic-release/commit-analyzer" \ | ||
| -p "@semantic-release/release-notes-generator" \ | ||
| -p "@semantic-release/changelog" \ | ||
| -p "@semantic-release/github" \ | ||
| -p "@semantic-release/exec" \ | ||
| -p "@semantic-release/git" \ | ||
| semantic-release --ci |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell --pure --keep POETRY_PYPI_TOKEN_PYPI -p poetry -p git -i bash | ||
| # shellcheck shell=bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # verify TOML is sane | ||
| poetry check | ||
|
|
||
| # verify that the lock file is up to date | ||
| poetry lock --no-update | ||
| git diff --exit-code poetry.lock | ||
|
|
||
| # verify that we have a token available to push to pypi using set -u | ||
| : "${POETRY_PYPI_TOKEN_PYPI}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Run the Ibis test suite. | ||
| # | ||
| # One environment variable is considered: | ||
| # - PYTEST_BACKENDS: Space-separated list of backends to run | ||
|
|
||
| set -eo pipefail | ||
|
|
||
| TESTS_DIRS=() | ||
|
|
||
| if [ -n "$PYTEST_BACKENDS" ]; then | ||
| TESTS_DIRS+=("ibis/backends/tests") | ||
| fi | ||
|
|
||
| for backend in $PYTEST_BACKENDS; do | ||
| backend_test_dir="ibis/backends/$backend/tests" | ||
| if [ -d "$backend_test_dir" ]; then | ||
| TESTS_DIRS+=("$backend_test_dir") | ||
| fi | ||
| done | ||
|
|
||
| set -x | ||
|
|
||
| poetry run pytest "${TESTS_DIRS[@]}" \ | ||
| --durations=25 \ | ||
| -ra \ | ||
| --junitxml=junit.xml \ | ||
| --cov=ibis \ | ||
| --cov-report=xml:coverage.xml "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { python ? "3.9" | ||
| , doCheck ? true | ||
| }: | ||
| let | ||
| pkgs = import ./nix; | ||
| drv = | ||
| { poetry2nix, python }: | ||
|
|
||
| poetry2nix.mkPoetryApplication { | ||
| inherit python; | ||
|
|
||
| projectDir = ./.; | ||
| src = pkgs.gitignoreSource ./.; | ||
|
|
||
| overrides = pkgs.poetry2nix.overrides.withDefaults ( | ||
| import ./poetry-overrides.nix { | ||
| inherit pkgs; | ||
| inherit (pkgs) lib stdenv; | ||
| } | ||
| ); | ||
|
|
||
| preConfigure = '' | ||
| rm -f setup.py | ||
| ''; | ||
|
|
||
| buildInputs = with pkgs; [ graphviz-nox ]; | ||
| checkInputs = with pkgs; [ graphviz-nox ]; | ||
|
|
||
| checkPhase = '' | ||
| runHook preCheck | ||
| pytest ibis/tests --numprocesses auto | ||
| runHook postCheck | ||
| ''; | ||
|
|
||
| inherit doCheck; | ||
|
|
||
| pythonImportsCheck = [ "ibis" ]; | ||
| }; | ||
| in | ||
| pkgs.callPackage drv { | ||
| python = pkgs."python${builtins.replaceStrings [ "." ] [ "" ] python}"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell --pure -p python3Packages.black -p python3Packages.tomli -p python3Packages.poetry-core -p bash -i bash | ||
| # vim: filetype=sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| dir="$(readlink -f "$(dirname "$0")")" | ||
|
|
||
| # PYTHONHASHSEED is set is to ensure reproducible setup.py generation | ||
| # | ||
| # Because the `extras` data structure in poetry is a frozenset and therefore | ||
| # arbitrarily ordered, regenerating setup.py without a fixed hash seed can | ||
| # cause unnecessary reordering of extras. | ||
| PYTHONHASHSEED=42 python "$dir/poetry2setup.py" "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import argparse | ||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| import black | ||
| import tomli | ||
| from poetry.core.factory import Factory | ||
| from poetry.core.masonry.builders.sdist import SdistBuilder | ||
|
|
||
| # Poetry inserts a double pipe for "OR" version constraints. | ||
| # We use this regular expression to turn those into a single pipe. | ||
| DOUBLE_PIPE_REGEX = re.compile(r"\s+\|\|\s+") | ||
|
|
||
|
|
||
| def main(args: argparse.Namespace) -> None: | ||
| input_dir = args.input_directory | ||
| # create poetry things | ||
| poetry = Factory().create_poetry(input_dir) | ||
| sdist_builder = SdistBuilder(poetry) | ||
|
|
||
| # generate setup.py code | ||
| code = sdist_builder.build_setup().decode("UTF-8") | ||
|
|
||
| # pull out black config | ||
| config = tomli.loads(input_dir.joinpath("pyproject.toml").read_text()) | ||
| black_config = config["tool"]["black"] | ||
| black_config["string_normalization"] = black_config.pop( | ||
| "skip_string_normalization", False | ||
| ) | ||
| black_config.pop("exclude", None) | ||
| out = black.format_file_contents( | ||
| code, fast=False, mode=black.Mode(**black_config) | ||
| ) | ||
| print(DOUBLE_PIPE_REGEX.sub("|", out), file=args.output_file, end="") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| p = argparse.ArgumentParser( | ||
| description="Generate a setup.py file from pyproject.toml" | ||
| ) | ||
| p.add_argument( | ||
| "-i", | ||
| "--input-directory", | ||
| type=Path, | ||
| default=Path(__file__).parent.parent.resolve(), | ||
| help="The input directory to use for poetry setup", | ||
| ) | ||
| p.add_argument( | ||
| "-o", | ||
| "--output-file", | ||
| type=argparse.FileType(mode="w"), | ||
| default=sys.stdout, | ||
| help="The file to which to write the generated setup.py output", | ||
| ) | ||
| main(p.parse_args()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| site_name: Ibis Project | ||
| project_name: "ibis" | ||
| site_url: https://ibis-project.org | ||
| repo_url: https://github.com/ibis-project/ibis | ||
| docs_dir: web | ||
| theme: | ||
| name: material | ||
| features: | ||
| - search.suggest | ||
| - search.highlight | ||
| - search.share | ||
| - content.tabs.link | ||
| - navigation.instant | ||
| - header.autohide | ||
| icon: | ||
| repo: fontawesome/brands/github | ||
| logo: static/img/logo_ibis.svg | ||
| favicon: static/img/favicon.ico | ||
| palette: | ||
| - scheme: default | ||
| media: "(prefers-color-scheme: light)" | ||
| toggle: | ||
| icon: material/toggle-switch-off-outline | ||
| name: Switch to dark mode | ||
| - scheme: slate | ||
| media: "(prefers-color-scheme: dark)" | ||
| toggle: | ||
| icon: material/toggle-switch | ||
| name: Switch to light mode | ||
| plugins: | ||
| - search | ||
| - macros | ||
| markdown_extensions: | ||
| - admonition | ||
| - meta | ||
| - toc | ||
| - tables | ||
| - attr_list | ||
| - md_in_html | ||
| - pymdownx.superfences | ||
| - pymdownx.highlight | ||
| - pymdownx.inlinehilite | ||
| - pymdownx.details | ||
| - pymdownx.tabbed: | ||
| alternate_style: true | ||
| nav: | ||
| - Home: index.md | ||
| - About: | ||
| - Introduction: about/index.md | ||
| - Team: about/team.md | ||
| - Roadmap: about/roadmap.md | ||
| - License: about/license.md | ||
| - Getting Started: getting_started.md | ||
| - Documentation: /docs | ||
| - Community: | ||
| - Ask a question (StackOverflow): https://stackoverflow.com/questions/tagged/ibis | ||
| - Chat (Gitter): https://gitter.im/ibis-dev/Lobby | ||
| - Code of Conduct: community/coc.md | ||
| - Ecosystem: community/ecosystem.md | ||
| - Contribute: contribute.md | ||
| - Release Notes: release_notes.md | ||
| team: | ||
| - name: "Active maintainers" | ||
| kind: github | ||
| members: | ||
| - jreback | ||
| - datapythonista | ||
| - cpcloud | ||
| - kszucs | ||
| - name: "Former maintainers" | ||
| kind: github | ||
| members: | ||
| - wesm | ||
|
|
||
| extra: | ||
| social: | ||
| - icon: fontawesome/brands/twitter | ||
| link: https://twitter.com/IbisData | ||
| - icon: fontawesome/brands/github | ||
| link: https://github.com/ibis-project/ibis | ||
|
|
||
| copyright: "Copyright © 2014-2022, Ibis developers" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| .. _install.datafusion: | ||
|
|
||
| `Datafusion <https://arrow.apache.org/datafusion/>`_ | ||
| ==================================================== | ||
|
|
||
| .. note:: | ||
|
|
||
| The Datafusion backend is experimental | ||
|
|
||
| Install | ||
| ------- | ||
|
|
||
| Install ibis along with its dependencies for the datafusion backend: | ||
|
|
||
| :: | ||
|
|
||
| pip install 'ibis-framework[datafusion]' | ||
|
|
||
| or | ||
|
|
||
| :: | ||
|
|
||
| conda install -c conda-forge ibis-datafusion | ||
|
|
||
| Connect | ||
| ------- | ||
|
|
||
| Create a client by passing a dictionary that maps table names to paths to | ||
| :func:`ibis.datafusion.connect`: | ||
|
|
||
| .. code-block:: python | ||
| >>> import ibis | ||
| >>> data_sources = {"t": "path/to/file.parquet", "s": "path/to/file.csv"} | ||
| >>> client = ibis.datafusion.connect(data_sources) | ||
| >>> t = clien.table("t") | ||
| .. _api.datafusion: | ||
|
|
||
| API | ||
| --- | ||
| .. currentmodule:: ibis.backends.datafusion | ||
|
|
||
| The Datafusion client is accessible through the ``ibis.datafusion`` namespace. | ||
|
|
||
| Use ``ibis.datafusion.connect`` to create a Datafusion client. | ||
|
|
||
| .. autosummary:: | ||
| :toctree: ../generated/ | ||
|
|
||
| Backend.connect | ||
| Backend.database | ||
| Backend.list_tables | ||
| Backend.table | ||
| Backend.register_csv | ||
| Backend.register_parquet |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,21 @@ | ||
| # Code of Conduct | ||
|
|
||
| {{ config.project_name | title }} is governed by the | ||
| [NumFOCUS code of conduct](https://numfocus.org/code-of-conduct): | ||
|
|
||
| !!! quote | ||
|
|
||
| Be kind to others. Do not insult or put down others. Behave professionally. | ||
| Remember that harassment and sexist, racist, or exclusionary jokes are not | ||
| appropriate for {{ config.project_name | upper }}. | ||
|
|
||
| All communication should be appropriate for a professional audience including | ||
| people of many different backgrounds. Sexual language and imagery is not | ||
| appropriate. | ||
|
|
||
| {{ config.project_name | title }} is dedicated to providing a harassment-free | ||
| community for everyone, regardless of gender, sexual orientation, gender | ||
| identity, and expression, disability, physical appearance, body size, race, | ||
| or religion. We do not tolerate harassment of community members in any form. | ||
|
|
||
| Thank you for helping make this a welcoming, friendly community for all. |