-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: supersede makefile with taskfile, use uv to run gha test suite…
… matrix locally
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 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 |
---|---|---|
|
@@ -134,3 +134,6 @@ dmypy.json | |
|
||
# Makefile touch target | ||
.uv-installed-* | ||
|
||
# Taskfile hashes | ||
.task |
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,71 @@ | ||
# See https://taskfile.dev/installation/ for installation | ||
version: "3" | ||
|
||
env: | ||
UV_PYTHON: | ||
sh: cat .python-version | ||
|
||
tasks: | ||
default: | ||
desc: By default, run format, lint, test | ||
cmds: | ||
- task: format | ||
- task: lint | ||
- defer: { task: dev } | ||
- task: test | ||
|
||
lint: | ||
desc: Run ruff to check code for linting issues | ||
cmds: | ||
- uvx ruff check | ||
|
||
format: | ||
desc: Auto-fix imports, then format code with ruff | ||
cmds: | ||
- uvx ruff check --fix --select I | ||
- uvx ruff format --preview | ||
|
||
dev: | ||
desc: Sets up dev environment (.venv + pre-commit), syncs dev extra | ||
deps: [venv, pre-commit] | ||
cmds: | ||
- uv -q sync --extra=dev | ||
|
||
venv: | ||
desc: Creates the virtual environment via uv | ||
internal: true | ||
sources: | ||
- .python-version | ||
generates: | ||
- .venv/bin/python | ||
cmds: | ||
- uv venv .venv | ||
|
||
pre-commit: | ||
desc: Installs pre-commit hooks in .git/hooks/pre-commit | ||
internal: true | ||
cmds: | ||
- uv tool install pre-commit | ||
- uv tool run pre-commit install | ||
status: | ||
- test -f .git/hooks/pre-commit | ||
|
||
test: | ||
desc: Run tests against supported python and dbt versions | ||
env: | ||
UV_FROZEN: 1 | ||
UV_NO_SYNC: 1 | ||
UV_NO_PROGRESS: 1 | ||
cmds: | ||
- for: | ||
matrix: | ||
python_version: ["3.10", "3.11", "3.12"] | ||
dbt_version: ["1.8.0", "1.9.0"] | ||
cmd: | | ||
echo -e "\033[32mtask: [test] uv run pytest (python=={{.ITEM.python_version}} and dbt~={{.ITEM.dbt_version}})\033[0m" | ||
export UV_PYTHON={{.ITEM.python_version}} | ||
uv -q sync --extra dev | ||
uv -q pip install --reinstall dbt-core~={{.ITEM.dbt_version}} dbt-duckdb~={{.ITEM.dbt_version}} | ||
uv run dbt parse --project-dir demo_duckdb --profiles-dir demo_duckdb -t test | ||
uv run pytest | ||
silent: true |