Skip to content

Commit

Permalink
chore: 🔐 add uv
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgasquez committed Feb 19, 2024
1 parent b9c849c commit 597a46e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
Expand All @@ -34,7 +34,6 @@
"charliermarsh.ruff",
"EditorConfig.EditorConfig",
"innoverio.vscode-dbt-power-user",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.datawrangler",
Expand All @@ -46,5 +45,5 @@
]
}
},
"postCreateCommand": "pip install -e '.[dev]'"
"postCreateCommand": "make setup"
}
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ tables:
@python -c 'from ggdp import db; db.export_database_to_parquet("data/local.duckdb", "data/tables");'

dev:
@dagster dev -m ggdp
@dagster dev

setup:
@command -v uv >/dev/null 2>&1 || pip install -U uv
uv venv
uv pip install -U -e .[dev]
. .venv/bin/activate

test:
@cd dbt && dbt test
Expand Down
5 changes: 2 additions & 3 deletions ggdp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os

from dagster import Definitions, EnvVar, load_assets_from_modules
from dagster import EnvVar, Definitions, load_assets_from_modules
from dagster_dbt import DbtCliResource, load_assets_from_dbt_project
from dagster_duckdb import DuckDBResource
from dagster_duckdb_pandas import DuckDBPandasIOManager

from . import assets, jobs
from . import resources as res
from . import jobs, assets, resources as res

DBT_PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) + "/../dbt/"

Expand Down
4 changes: 2 additions & 2 deletions ggdp/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import pandas as pd
import requests
from retry import retry
from dagster import asset
from fsspec.implementations.http import HTTPFileSystem
from retry import retry

from .resources import CovalentAPIResource, DuneResource
from .resources import DuneResource, CovalentAPIResource

ALLO_INDEXER_URL = "https://indexer-production.fly.dev/data"
CHAIN_METADATA_URL = "https://chainid.network/chains.json"
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ build-backend = "setuptools.build_meta"
packages = ["ggdp"]

[tool.setuptools.package-data]
"datadex" = ["../dbt/**"]
"ggdp" = ["../dbt/**"]

[tool.dagster]
module_name = "ggdp"

[tool.sqlfmt]
line_length = 120
check = true
fast = false
dialect = "duckdb"

[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
length-sort = true

0 comments on commit 597a46e

Please sign in to comment.