Skip to content

Commit 1448ec5

Browse files
committed
Initial migration from poetry to uv
1 parent abe430f commit 1448ec5

File tree

18 files changed

+1559
-2741
lines changed

18 files changed

+1559
-2741
lines changed

.github/workflows/docs.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,20 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20-
- uses: actions/setup-python@v5
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2122
with:
22-
python-version: "3.10"
23-
- uses: snok/install-poetry@v1
23+
enable-cache: true
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
2426
with:
25-
virtualenvs-path: .venv
26-
- name: Load cached venv
27-
id: cached-poetry-dependencies
28-
uses: actions/cache@v4
29-
with:
30-
path: .venv
31-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
32-
- name: Install dependencies
33-
run: poetry install --no-interaction --no-root
27+
python-version-file: ".python-version"
3428
- name: Build dbt docs
3529
run: |
3630
# Generate snowflake dbt docs
37-
poetry run dbt deps --project-dir=transform
38-
poetry run dbt docs generate --project-dir=transform
31+
uv run dbt deps --project-dir=transform
32+
uv run dbt docs generate --project-dir=transform
3933
cp -r transform/target docs/dbt_docs_snowflake
4034
- name: Deploy docs to GitHub Pages
4135
if: github.ref == 'refs/heads/main'
42-
run: poetry run mkdocs gh-deploy --force
36+
run: uv run mkdocs gh-deploy --force

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,14 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
2021
with:
21-
python-version: "3.10"
22-
- uses: snok/install-poetry@v1
22+
enable-cache: true
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
2325
with:
24-
virtualenvs-path: .venv
25-
- name: Load cached venv
26-
id: cached-poetry-dependencies
27-
uses: actions/cache@v4
28-
with:
29-
path: .venv
30-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
31-
- name: Install dependencies
32-
run: poetry install --no-interaction --no-root
26+
python-version-file: ".python-version"
3327
- name: Install dbt deps
34-
run: poetry run dbt deps --project-dir transform
28+
run: uv run dbt deps --project-dir transform
3529
- uses: pre-commit/action@v3.0.0

.pre-commit-config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ repos:
1111
- id: check-merge-conflict
1212
- id: detect-aws-credentials
1313
args: [--allow-missing-credentials]
14-
- repo: https://github.com/charliermarsh/ruff-pre-commit
15-
rev: v0.1.6
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
# Ruff version.
16+
rev: v0.12.1
1617
hooks:
17-
- id: ruff
18-
args: [--show-source, --fix]
18+
- id: ruff-check
19+
args: [--show-files, --fix]
1920
- id: ruff-format
2021
- repo: https://github.com/codespell-project/codespell
2122
rev: v2.2.4
@@ -30,7 +31,7 @@ repos:
3031
args: [--warn-unused-configs]
3132
additional_dependencies:
3233
# Type stubs
33-
- pandas-stubs==v1.5.3.230321
34+
- pandas-stubs==v2.2.3.250527
3435
- types-requests
3536
- numpy
3637
- repo: https://github.com/pre-commit/mirrors-prettier
@@ -46,7 +47,7 @@ repos:
4647
# Note: for SQLFluff we don't use the default pre-commit hook because
4748
# the pre-commit managed python environment can be difficult to install,
4849
# especially due to issues with pyarrow being brought in by Snowflake.
49-
# This keep things more predictable by using the poetry.lock environment.
50+
# This keep things more predictable by using the uv.lock environment.
5051
- repo: local
5152
hooks:
5253
- id: sqlfluff
@@ -55,5 +56,5 @@ repos:
5556
description: "Lints sql files with `SQLFluff`"
5657
types: [sql]
5758
require_serial: true
58-
entry: poetry run sqlfluff fix --show-lint-violations --nocolor --disable-progress-bar
59+
entry: uv run sqlfluff fix --show-lint-violations --nocolor --disable-progress-bar
5960
pass_filenames: true

airflow/aws_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Adapted from sample code here:
55
https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-cli-command-reference.html#airflow-cli-command-examples
66
"""
7+
78
import base64
89
import json
910
import sys

airflow/dags/common/defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Shared default arguments for DAGs."""
2+
23
from __future__ import annotations
34

45
from datetime import timedelta

airflow/dags/common/slack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def post_to_slack_on_failure(context):
77
)
88
msg = f"""
99
:x: Task Failed.
10-
*Task*: {context.get('task_instance').task_id}
11-
*Dag*: {context.get('task_instance').dag_id}
12-
*Execution Time*: {context.get('execution_date')}
13-
<{context.get('task_instance').log_url}|*Logs*>
10+
*Task*: {context.get("task_instance").task_id}
11+
*Dag*: {context.get("task_instance").dag_id}
12+
*Execution Time*: {context.get("execution_date")}
13+
<{context.get("task_instance").log_url}|*Logs*>
1414
"""
1515
hook.send_text(msg)

airflow/dags/geo_reference/load_building_footprints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Load building footprints to Snowflake."""
2+
23
from __future__ import annotations
34

45
import os

airflow/dags/state_entities/base_entities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Load state entities list from department of finance."""
2+
23
from __future__ import annotations
34

45
import io

airflow/dags/state_entities/budgets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Load state entity budgets from ebudget site."""
2+
23
from __future__ import annotations
34

45
import re

jobs/geo/write_building_footprints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def write_building_footprints(conn, kind: str):
4949
gdf.to_file(f"{file_prefix}.shz")
5050

5151
print(
52-
f"Loading {file_prefix}. This is number {index+1} out of {len(counties)} counties."
52+
f"Loading {file_prefix}. This is number {index + 1} out of {len(counties)} counties."
5353
)
5454

5555
s3 = s3fs.S3FileSystem(anon=False)

0 commit comments

Comments
 (0)