Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 525466d

Browse files
zcklyclaude
andcommitted
fix: add proper type annotations for Jinja2 template
Fixed pyright type errors by: 1. Adding proper type annotation for template variable as jinja2.Template 2. Importing jinja2 module to make the type available 🤖 Generated with Claude CLI. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ce09bbf commit 525466d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/create_mcp_server/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def copy_template(
130130

131131
target_dir = get_package_directory(path)
132132

133-
from jinja2 import Environment, FileSystemLoader
133+
import jinja2
134+
from jinja2 import Environment, FileSystemLoader
134135

135136
env = Environment(loader=FileSystemLoader(str(template_dir)))
136137

@@ -153,7 +154,7 @@ def copy_template(
153154

154155
try:
155156
for template_file, output_file, output_dir in files:
156-
template = env.get_template(template_file)
157+
template: jinja2.Template = env.get_template(template_file)
157158
rendered = template.render(**template_vars)
158159

159160
out_path = output_dir / output_file

0 commit comments

Comments
 (0)