Skip to content

Commit 8ffe3a7

Browse files
committed
temp: use pyproject.toml with vendored SDK wheel
Vendor the SDK wheel and add binary-aware template rendering until the SDK is published to PyPI. To be removed once the SDK is publicly available.
1 parent 85a6d7d commit 8ffe3a7

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "{{ Name }}"
7+
version = "0.1.0"
8+
description = "AgentCore Code-Based Evaluator"
9+
requires-python = ">=3.10"
10+
dependencies = [
11+
"bedrock-agentcore",
12+
]
13+
14+
[tool.hatch.build.targets.wheel]
15+
packages = ["."]
Binary file not shown.

src/cli/templates/render.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ export async function copyDir(src: string, dest: string): Promise<void> {
4444
}
4545
}
4646

47+
const BINARY_EXTENSIONS = new Set(['.whl', '.zip', '.tar', '.gz', '.tgz', '.png', '.jpg', '.ico']);
48+
4749
/**
4850
* Recursively copies a directory, rendering Handlebars templates.
51+
* Binary files (e.g., .whl) are copied directly without template rendering.
4952
*/
5053
export async function copyAndRenderDir<T extends object>(src: string, dest: string, data: T): Promise<void> {
5154
await fs.mkdir(dest, { recursive: true });
@@ -58,6 +61,9 @@ export async function copyAndRenderDir<T extends object>(src: string, dest: stri
5861

5962
if (entry.isDirectory()) {
6063
await copyAndRenderDir(srcPath, destPath, data);
64+
} else if (BINARY_EXTENSIONS.has(path.extname(entry.name).toLowerCase())) {
65+
await fs.mkdir(path.dirname(destPath), { recursive: true });
66+
await fs.copyFile(srcPath, destPath);
6167
} else {
6268
const content = await fs.readFile(srcPath, 'utf-8');
6369
const template = Handlebars.compile(content);

0 commit comments

Comments
 (0)