Skip to content

Commit b1a4995

Browse files
authored
fix: make all Python scripts able to see common scripts (#249)
1 parent 76ac2b6 commit b1a4995

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

scripts/auto-pr-helper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
Usage:
1313
cat issue.json | uv run python scripts/auto-pr-helper.py
1414
cat issue.json | uv run python scripts/auto-pr-helper.py --save
15-
16-
Location: scripts/auto-pr-helper.py (replaces existing file)
1715
"""
1816

1917
import argparse
2018
import json
19+
import os
2120
import sys
2221

22+
# Add the scripts directory to Python path so we can import guideline_utils
23+
script_dir = os.path.dirname(os.path.abspath(__file__))
24+
sys.path.insert(0, script_dir)
25+
2326
from guideline_utils import (
2427
extract_form_fields,
2528
guideline_template,

scripts/generate-rst-comment.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
Usage:
1010
cat issue.json | uv run python scripts/generate-rst-comment.py
1111
curl https://api.github.com/repos/.../issues/123 | uv run python scripts/generate-rst-comment.py
12-
13-
Location: scripts/generate-rst-comment.py (new file)
1412
"""
1513

1614
import json
15+
import os
1716
import sys
1817

18+
# Add the scripts directory to Python path so we can import guideline_utils
19+
script_dir = os.path.dirname(os.path.abspath(__file__))
20+
sys.path.insert(0, script_dir)
21+
1922
from guideline_utils import (
2023
chapter_to_filename,
2124
extract_form_fields,

scripts/guidelines_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
This module contains common functions used by:
88
- auto-pr-helper.py (for automated PR generation)
99
- generate-rst-comment.py (for generating preview comments)
10-
11-
Location: scripts/guideline_utils.py
1210
"""
1311

1412
import os

0 commit comments

Comments
 (0)