66 PIP := pip3
77endif
88
9+ UNAME_S := $(shell uname -s)
10+ ifeq ($(UNAME_S ) ,Darwin)
11+ SED_INPLACE = sed -i ''
12+ else
13+ SED_INPLACE = sed -i
14+ endif
15+
916install-dev :
1017 $(PIP ) install -e " .[dev,web,slack,dlt,lsp]" ./examples/custom_materializations
1118
@@ -15,6 +22,33 @@ install-doc:
1522install-pre-commit :
1623 pre-commit install
1724
25+ install-dbt% :
26+ @version=" $* " ; \
27+ period_count=$$(echo "$$version" | tr -cd '.' | wc -c ) ; \
28+ if [ " $$ period_count" -eq 0 ]; then \
29+ version=" $$ {version:0:1}.$$ {version:1}" ; \
30+ elif [ " $$ period_count" -eq 1 ]; then \
31+ version=" $$ version.0" ; \
32+ fi ; \
33+ echo " Installing dbt version: $$ version" ; \
34+ cp pyproject.toml pyproject.toml.backup; \
35+ $(SED_INPLACE ) ' s/"pydantic>=2.0.0"/"pydantic"/g' pyproject.toml; \
36+ if [ " $$ version" = " 1.10.0" ]; then \
37+ echo " Applying special handling for dbt 1.10.0" ; \
38+ $(SED_INPLACE ) -E ' s/"(dbt-core)[^"]*"/"\1~=' " $$ version" ' "/g' pyproject.toml; \
39+ $(SED_INPLACE ) -E ' s/"(dbt-(bigquery|duckdb|snowflake|athena-community|clickhouse|databricks|redshift|trino))[^"]*"/"\1"/g' pyproject.toml; \
40+ else \
41+ echo " Applying version $$ version to all dbt packages" ; \
42+ $(SED_INPLACE ) -E ' s/"(dbt-[^"><=~!]+)[^"]*"/"\1~=' " $$ version" ' "/g' pyproject.toml; \
43+ fi ; \
44+ $(MAKE ) install-dev; \
45+ if [ " $$ version" = " 1.6.0" ]; then \
46+ echo " Applying pydantic override for dbt 1.6.0" ; \
47+ $(PIP ) install ' pydantic>=2.0.0' --reinstall; \
48+ fi ; \
49+ mv pyproject.toml.backup pyproject.toml; \
50+ echo " Restored original pyproject.toml"
51+
1852style :
1953 pre-commit run --all-files
2054
0 commit comments