generated from tconbeer/harlequin-adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish init adapter implementation (#1)
* feat: finish init adapter implementation * fix: precommit * fix: stop docker in ci
- Loading branch information
1 parent
d683cd2
commit 8a43507
Showing
18 changed files
with
738 additions
and
218 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Integration | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.os }} - ${{ matrix.py }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu | ||
py: | ||
- "3.9" | ||
steps: | ||
- name: Check out Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Start FlightSQL and Postgres Server | ||
shell: bash -l {0} | ||
run: | | ||
docker-compose up -d | ||
- name: Set up Python ${{ matrix.py }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Load cached Poetry installation | ||
id: cached-poetry-install | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install Poetry | ||
if: steps.cached-poetry-install.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.2 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install python dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --with dev --sync --no-interaction --all-extras | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest | ||
- name: Store snapshot report on failure | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: Snapshot Report ${{ matrix.os }} ${{ matrix.py }} | ||
path: ./snapshot_report.html | ||
- name: Stop FlightSQL and Postgres Server | ||
shell: bash -l {0} | ||
run: | | ||
docker-compose down |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and Publish Package | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
publish-package: | ||
if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v') }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out harlequin-adbc main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.6.1 | ||
- name: Configure poetry | ||
run: poetry config --no-interaction pypi-token.pypi ${{ secrets.HARLEQUIN_ADBC_PYPI_TOKEN }} | ||
- name: Get harlequin-adbc Version | ||
id: harlequin_adbc_version | ||
run: echo "harlequin_adbc_version=$(poetry version --short)" >> $GITHUB_OUTPUT | ||
- name: Build package | ||
run: poetry build --no-interaction | ||
- name: Publish package to PyPI | ||
run: poetry publish --no-interaction | ||
- name: Create a Github Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: v${{ steps.harlequin_adbc_version.outputs.harlequin_adbc_version }} | ||
target_commitish: main | ||
token: ${{ secrets.HARLEQUIN_ADBC_RELEASE_TOKEN }} | ||
body_path: CHANGELOG.md | ||
files: | | ||
LICENSE | ||
dist/*harlequin*.whl | ||
dist/*harlequin*.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Create Release Branch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
newVersion: | ||
description: A version number for this release (e.g., "0.1.0") | ||
required: true | ||
|
||
jobs: | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Check out harlequin-adbc main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.6.1 | ||
- name: Create release branch | ||
run: | | ||
git checkout -b release/v${{ github.event.inputs.newVersion }} | ||
git push --set-upstream origin release/v${{ github.event.inputs.newVersion }} | ||
- name: Bump version | ||
run: poetry version ${{ github.event.inputs.newVersion }} --no-interaction | ||
- name: Ensure package can be built | ||
run: poetry build --no-interaction | ||
- name: Update CHANGELOG | ||
uses: thomaseizinger/keep-a-changelog-new-release@v1 | ||
with: | ||
version: ${{ github.event.inputs.newVersion }} | ||
- name: Commit Changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Bumps version to ${{ github.event.inputs.newVersion }} | ||
- name: Create pull request into main | ||
uses: thomaseizinger/create-pull-request@1.3.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.HARLEQUIN_ADBC_RELEASE_TOKEN }} | ||
with: | ||
head: release/v${{ github.event.inputs.newVersion }} | ||
base: main | ||
title: v${{ github.event.inputs.newVersion }} | ||
body: > | ||
This PR was automatically generated. It bumps the version number | ||
in pyproject.toml and updates CHANGELOG.md. You may have to close | ||
this PR and reopen it to get the required checks to 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Perform Static Analysis" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
- uses: pre-commit/action@v3.0.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: name-tests-test | ||
args: [--pytest-test-first] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.2.2 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- harlequin | ||
- types-pygments | ||
- importlib_metadata | ||
- pytest | ||
args: | ||
- "--disallow-untyped-calls" | ||
- "--disallow-untyped-defs" | ||
- "--disallow-incomplete-defs" | ||
- "--strict-optional" | ||
- "--warn-return-any" | ||
- "--warn-no-return" | ||
- "--warn-redundant-casts" | ||
- "--no-warn-unused-ignores" | ||
- "--allow-untyped-decorators" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11 | ||
3.9 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Harlequin-Trino CHANGELOG | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## [Unreleased] | ||
|
||
### Features | ||
|
||
- Implement first working version of adapter |
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
Oops, something went wrong.