This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Improve ergonomics of python API to match original sqlglot, fix backt… #39
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for C++26 compiler (GCC 16+ trunk) | |
| id: check_compiler | |
| run: | | |
| echo "WARNING: C++26 reflection requires GCC 16+ trunk with -freflection" | |
| echo "WARNING: ubuntu-latest and macos-latest do not support this yet" | |
| echo "WARNING: Skipping build tests until GCC 16 is in stable releases" | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Set up Python ${{ matrix.python-version }} | |
| if: steps.check_compiler.outputs.skip != 'true' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| if: steps.check_compiler.outputs.skip != 'true' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build pytest | |
| - name: Build package | |
| if: steps.check_compiler.outputs.skip != 'true' | |
| run: python -m build | |
| - name: Install package | |
| if: steps.check_compiler.outputs.skip != 'true' | |
| run: pip install dist/*.whl | |
| - name: Test import | |
| if: steps.check_compiler.outputs.skip != 'true' | |
| run: | | |
| python -c "import libsqlglot; print('libsqlglot imported successfully')" | |
| python -c "import libsqlglot; sql = libsqlglot.transpile('SELECT * FROM users', libsqlglot.Dialect.MySQL, libsqlglot.Dialect.PostgreSQL); print('Transpile test:', sql)" | |
| build-docs: | |
| name: Check README | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check README exists | |
| run: test -f README.md | |
| - name: Check LICENSE exists | |
| run: test -f LICENSE |