Skip to content

Commit 970a79d

Browse files
suryaiyer95claude
andcommitted
fix: bundle altimate_python_packages into dbt-tools dist for Python bridge
`bun build` bundles all JS into a single `dist/index.js`, causing `import.meta.url` to resolve to the bundle location instead of the original `@altimateai/dbt-integration/dist/` directory. This meant `PYTHONPATH` pointed to a nonexistent `altimate_python_packages/` dir, breaking `dbt_core_integration` imports. - Add `script/copy-python.ts` post-build step that copies `altimate_python_packages/` from the npm package into `dist/` - Remove developer-only build instructions from `/dbt-cli` skill Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e5e320 commit 970a79d

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.opencode/skills/dbt-cli/SKILL.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ altimate-dbt init --python-path /path # Override Python interpreter
3737

3838
This writes `~/.altimate-code/dbt.json`. Run `altimate-dbt doctor` to verify everything is healthy.
3939

40-
If `altimate-dbt` is not found, the binary lives at `packages/dbt-tools/bin/altimate-dbt` in the altimate-code repo. Build with `bun run --cwd packages/dbt-tools build` if `dist/` is missing.
41-
4240
## Commands
4341

4442
### Health & Info

packages/dbt-tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"altimate-dbt": "./bin/altimate-dbt"
88
},
99
"scripts": {
10-
"build": "bun build src/index.ts --outdir dist --target node --format esm",
10+
"build": "bun build src/index.ts --outdir dist --target node --format esm && bun run script/copy-python.ts",
1111
"typecheck": "tsc --noEmit",
1212
"test": "bun test --timeout 30000"
1313
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { cpSync } from "fs"
2+
import { dirname, join } from "path"
3+
4+
const resolved = require.resolve("@altimateai/dbt-integration")
5+
const source = join(dirname(resolved), "altimate_python_packages")
6+
const target = join(import.meta.dir, "..", "dist", "altimate_python_packages")
7+
8+
cpSync(source, target, { recursive: true })
9+
console.log(`Copied altimate_python_packages → dist/`)

0 commit comments

Comments
 (0)