Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5ea6e83
Upgrade actions/checkout: 4.2.2 → 6.x
asnare Mar 3, 2026
f5e7128
Upgrade actions/setup-python: 5.x → 6.x
asnare Mar 3, 2026
3c7f8a4
Upgrade Hatch: 1.9.4 -> 1.16.5
asnare Mar 3, 2026
2545924
Switch to Hatch-controlled python versions, and run Hatch itself unde…
asnare Mar 3, 2026
fc2ef1c
Add Python 3.13 and 3.14 to the test matrix.
asnare Mar 3, 2026
912644c
Update `make clean` to tidy up all venvs.
asnare Mar 3, 2026
679b6c5
Remove unrecognised pylint option.
asnare Mar 3, 2026
64e515d
Limit isort to src/ and tests/
asnare Mar 3, 2026
4e84ecf
Ensure the ruff and pytest caches are located in the correct venv.
asnare Mar 3, 2026
534e8fe
Explicitly indicate that 3.15 is not (yet) supported.
asnare Mar 3, 2026
8855567
Also run acceptance tests for draft PRs.
asnare Mar 3, 2026
a8705c3
Downstream repo has changed: remorph -> lakebridge
asnare Mar 3, 2026
a39e64c
Revert default environment to using `.venv`.
asnare Mar 3, 2026
128ce9d
Specify python versions for downstream projects that are compatible w…
asnare Mar 6, 2026
bdbd24f
Run downstream checks with system python 3.10
asnare Mar 6, 2026
5da428e
Drop the lakebridge check; it doesn't do anything.
asnare Mar 6, 2026
c0a1659
Move comment to correct location.
asnare Mar 6, 2026
48540b8
Sync style.
asnare Mar 10, 2026
b20c982
Ensure isort is the same for fmt and verify.
asnare Mar 10, 2026
9dfa411
Ensure the mypy cache is also scoped to within the venv.
asnare Mar 10, 2026
6c190db
No need to trigger on ready-for-review.
asnare Mar 10, 2026
67ca745
Pre-install the version of python that hatch will need to set up for …
asnare Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: acceptance

on:
pull_request:
types: [ opened, synchronize, ready_for_review ]
types: [ opened, synchronize ]

permissions:
id-token: write
Expand All @@ -12,27 +12,31 @@ permissions:
concurrency:
group: single-acceptance-job-per-repo

env:
HATCH_VERBOSE: "2"
HATCH_VERSION: "1.16.5"

jobs:
integration:
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
if: github.event_name == 'pull_request'
environment: runtime
runs-on: larger
steps:
- name: Checkout Code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6

- name: Unshallow
run: git fetch --prune --unshallow

- name: Install Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.10'
python-version: '3.14'

- name: Install hatch
run: pip install hatch==1.9.4
run: pip install "hatch==${HATCH_VERSION}"

- name: Run integration tests
uses: databrickslabs/sandbox/acceptance@acceptance/v0.4.2
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/downstreams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ permissions:
contents: read
pull-requests: write

env:
HATCH_VERBOSE: "2"
HATCH_VERSION: '1.16.5'

jobs:
compatibility:
strategy:
Expand All @@ -31,20 +35,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
# Downstream currently just tests with system python rather than controlling the versions properly.
python-version: '3.10'

- name: Install toolchain
run: |
pip install hatch==1.9.4
pip install "hatch==${HATCH_VERSION}"

- name: Acceptance
uses: databrickslabs/sandbox/downstreams@acceptance/v0.4.2
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,29 @@ permissions:
concurrency:
group: single-acceptance-job-per-repo

env:
HATCH_VERBOSE: "2"
HATCH_VERSION: "1.16.5"

jobs:
integration:
environment: runtime
runs-on: larger
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.10'
python-version: '3.14'

- name: Install hatch
run: pip install hatch==1.9.4
run: pip install "hatch==${HATCH_VERSION}"

- name: Run nightly tests
uses: databrickslabs/sandbox/acceptance@acceptance/v0.4.2
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,36 @@ on:
branches:
- main

env:
HATCH_VERBOSE: "2"
HATCH_VERSION: "1.16.5"

jobs:
ci:
strategy:
fail-fast: false
matrix:
pyVersion: [ '3.10', '3.11', '3.12' ]
python: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
runs-on: ubuntu-latest
env:
HATCH_ENV: "test.py${{ matrix.python }}"
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6

- name: Install Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: ${{ matrix.pyVersion }}
# The version under test, as well as Python 3.14 for Hatch.
python-version: |
${{ matrix.python }}
${{ matrix.python != '3.14' && '3.14' || '' }}

- name: Run unit tests
run: |
pip install hatch==1.9.4
pip install "hatch==${HATCH_VERSION}"
make test

- name: Publish test coverage
Expand All @@ -44,18 +53,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6

- name: Install Python 3.12
uses: actions/setup-python@v5
- name: Install Python
uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.12'
python-version: '3.14'

- name: Format all files
run: |
pip install hatch==1.9.4
pip install "hatch==${HATCH_VERSION}"
make dev fmt

- name: Fail on differences
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- 'v*'

env:
HATCH_VERBOSE: "2"
HATCH_VERSION: "1.16.5"

jobs:
publish:
runs-on:
Expand All @@ -17,17 +21,17 @@ jobs:
# Used to attach signing artifacts to the published release.
contents: write
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/checkout@v6

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.10'
python-version: '3.14'

- name: Build wheels
run: |
pip install hatch==1.9.4
pip install "hatch==${HATCH_VERSION}"
hatch build

- name: Draft release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ venv/
ENV/
env.bak/
venv.bak/
.venv-*/

# Spyder project settings
.spyderproject
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: clean lint fmt test coverage

clean:
rm -fr .venv clean htmlcov .mypy_cache .pytest_cache .ruff_cache .coverage coverage.xml
rm -fr .venv* clean htmlcov .mypy_cache .pytest_cache .ruff_cache .coverage coverage.xml
rm -fr **/*.pyc

.venv/bin/python:
Expand Down
47 changes: 37 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "databricks-labs-lsql"
dynamic = ["version"]
description = "Lightweight stateless SQL execution for Databricks with minimal dependencies"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.10,<3.15"
license-files = { paths = ["LICENSE", "NOTICE"] }
keywords = []
authors = [
Expand All @@ -16,6 +16,8 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
Expand Down Expand Up @@ -58,37 +60,66 @@ dependencies = [
"types-requests",
]

# store virtual env as the child of this folder. Helps VSCode (and PyCharm) to run better
python="3.10"

# Fixed path expected by the `labs` tool to run acceptance tests.
path = ".venv"

[tool.hatch.envs.default.env-vars]
MYPY_CACHE_DIR = ".venv/mypy-cache"
PYTEST_ADDOPTS = "-o cache_dir=.venv/pytest-cache"
RUFF_CACHE_DIR = ".venv/ruff-cache"

[tool.hatch.envs.default.scripts]
test = "pytest -n 2 --cov src --cov-report=xml --timeout 30 tests/unit --durations 20"
coverage = "pytest -n 2 --cov src tests/unit --timeout 30 --cov-report=html --durations 20"
integration = "pytest -n 10 --cov src tests/integration --durations 20"
fmt = ["isort .",
fmt = ["isort src tests",
"ruff format",
"ruff check . --fix",
"mypy .",
"pylint --output-format=colorized -j 0 src"]
verify = ["isort . --check-only",
verify = ["isort src tests --check-only",
"ruff check .",
"mypy .",
"pylint --output-format=colorized -j 0 src"]

[tool.hatch.envs.test.env-vars]
MYPY_CACHE_DIR = ".venv-py{matrix:python}/mypy-cache"
PYTEST_ADDOPTS = "-o cache_dir=.venv-py{matrix:python}/pytest-cache"
RUFF_CACHE_DIR = ".venv-py{matrix:python}/ruff-cache"

[tool.hatch.envs.test.overrides]
matrix.python.path = [
# Sadly no way to interpolate this.
{ value = ".venv-py3.10", if = ["3.10" ]},
{ value = ".venv-py3.11", if = ["3.11" ]},
{ value = ".venv-py3.12", if = ["3.12" ]},
{ value = ".venv-py3.13", if = ["3.13" ]},
{ value = ".venv-py3.14", if = ["3.14" ]}
]

[[tool.hatch.envs.test.matrix]]
python = [
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
addopts = "--no-header"
cache_dir = ".venv/pytest-cache"

[tool.black]
target-version = ["py310"]
line-length = 120
skip-string-normalization = true

[tool.ruff]
cache-dir = ".venv/ruff-cache"
target-version = "py310"
line-length = 120

Expand Down Expand Up @@ -199,10 +230,6 @@ py-version = "3.10"
# source root.
# source-roots =

# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode = true

# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
# unsafe-load-any-extension =
Expand Down
Loading