Skip to content

Commit f78f765

Browse files
committed
update scripts
1 parent 980b75e commit f78f765

File tree

6 files changed

+14
-30
lines changed

6 files changed

+14
-30
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dependencies = [
4747
[project.optional-dependencies]
4848
dev = [
4949
"pytest>=7.0.0",
50+
"pytest-asyncio>=0.21.0",
5051
"pytest-cov>=4.0.0",
5152
"mypy>=1.0.0",
5253
"ruff>=0.1.0",

src/scripts/add_claude_code_rule.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,24 @@
44

55
def main() -> None:
66
script_dir = os.path.dirname(os.path.abspath(__file__))
7-
doc_path = os.path.join(script_dir, "..", "LLM_DOC.md")
8-
type_path = os.path.join(script_dir, "..", "dist", "__init__.pyi")
7+
doc_path = os.path.join(script_dir, "..", "..", "LLM_DOC.md")
98

109
user_project_root = os.getcwd()
1110
output_file = os.path.join(user_project_root, "CLAUDE.md")
1211

1312
relative_doc_path = os.path.relpath(doc_path, user_project_root)
14-
relative_type_path = os.path.relpath(type_path, user_project_root)
1513

1614
try:
1715
rule = f"""
1816
# Nutrient DWS Python Client Usage
19-
- Use the `@nutrient-sdk/dws-client-python` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
17+
- Use the `nutrient-dws` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
2018
- Package Documentation and Examples can be found at: {relative_doc_path}
21-
- Python Type Definitions can be found at: {relative_type_path}
2219
"""
2320
with open(output_file, "a", encoding="utf-8") as f:
2421
f.write(rule)
2522

2623
print(
27-
f"📄 Updated Claude Code Rules to point to Nutrient DWS documentation at {relative_doc_path} and {relative_type_path}."
24+
f"📄 Updated Claude Code Rules to point to Nutrient DWS documentation at {relative_doc_path}."
2825
)
2926
except Exception as err:
3027
print(f"Failed to update CLAUDE.md file: {err}", file=sys.stderr)

src/scripts/add_cursor_rule.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,21 @@
44

55
def main() -> None:
66
script_dir = os.path.dirname(os.path.abspath(__file__))
7-
doc_path = os.path.join(script_dir, "..", "LLM_DOC.md")
7+
doc_path = os.path.join(script_dir, "..", "..", "LLM_DOC.md")
88
with open(doc_path, encoding="utf-8") as file:
99
documentation = file.read()
10-
type_path = os.path.join(script_dir, "..", "dist", "__init__.pyi")
1110

1211
user_project_root = os.getcwd()
1312
output_directory = os.path.join(user_project_root, ".cursor/rules")
1413
output_file = os.path.join(output_directory, "nutrient-dws-doc.mdc")
1514

16-
relative_type_path = os.path.relpath(type_path, user_project_root)
17-
1815
try:
1916
rule = f"""
2017
---
21-
description: This rule explains how to use the Nutrient DWS Python Client (`@nutrient-sdk/dws-client-python`) for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
18+
description: This rule explains how to use the Nutrient DWS Python Client (`nutrient-dws`) for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
2219
globs:
2320
alwaysApply: false
2421
---
25-
> The Python Type Definitions can be found at: ${relative_type_path}
2622
2723
{documentation}
2824
"""

src/scripts/add_github_copilot_rule.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,27 @@
44

55
def main() -> None:
66
script_dir = os.path.dirname(os.path.abspath(__file__))
7-
doc_path = os.path.join(script_dir, "..", "LLM_DOC.md")
8-
type_path = os.path.join(script_dir, "..", "dist", "__init__.pyi")
7+
doc_path = os.path.join(script_dir, "..", "..", "LLM_DOC.md")
98

109
user_project_root = os.getcwd()
1110
output_directory = os.path.join(user_project_root, ".github")
1211
output_file = os.path.join(output_directory, "copilot-instructions.md")
1312

1413
relative_doc_path = os.path.relpath(doc_path, user_project_root)
15-
relative_type_path = os.path.relpath(type_path, user_project_root)
1614

1715
try:
1816
rule = f"""
1917
# Nutrient DWS Python Client Usage
20-
- Use the `@nutrient-sdk/dws-client-python` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
18+
- Use the `nutrient-dws` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
2119
- Package Documentation and Examples can be found at: {relative_doc_path}
22-
- Python Type Definitions can be found at: {relative_type_path}
2320
"""
2421
if not os.path.exists(output_directory):
2522
os.makedirs(output_directory)
2623
with open(output_file, "a", encoding="utf-8") as f:
2724
f.write(rule)
2825

2926
print(
30-
f"📄 Updated GitHub Copilot Rules to point to Nutrient DWS documentation at {relative_doc_path} and {relative_type_path}."
27+
f"📄 Updated GitHub Copilot Rules to point to Nutrient DWS documentation at {relative_doc_path}."
3128
)
3229
except Exception as err:
3330
print(

src/scripts/add_junie_rule.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,27 @@
44

55
def main() -> None:
66
script_dir = os.path.dirname(os.path.abspath(__file__))
7-
doc_path = os.path.join(script_dir, "..", "LLM_DOC.md")
8-
type_path = os.path.join(script_dir, "..", "dist", "__init__.pyi")
7+
doc_path = os.path.join(script_dir, "..", "..", "LLM_DOC.md")
98

109
user_project_root = os.getcwd()
1110
output_directory = os.path.join(user_project_root, ".junie")
1211
output_file = os.path.join(output_directory, "guidelines.md")
1312

1413
relative_doc_path = os.path.relpath(doc_path, user_project_root)
15-
relative_type_path = os.path.relpath(type_path, user_project_root)
1614

1715
try:
1816
rule = f"""
1917
# Nutrient DWS Python Client Usage
20-
- Use the `@nutrient-sdk/dws-client-python` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
18+
- Use the `nutrient-dws` package for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
2119
- Package Documentation and Examples can be found at: {relative_doc_path}
22-
- Python Type Definitions can be found at: {relative_type_path}
2320
"""
2421
if not os.path.exists(output_directory):
2522
os.makedirs(output_directory)
2623
with open(output_file, "a", encoding="utf-8") as f:
2724
f.write(rule)
2825

2926
print(
30-
f"📄 Updated Junie Code Rules to point to Nutrient DWS documentation at {relative_doc_path} and {relative_type_path}."
27+
f"📄 Updated Junie Code Rules to point to Nutrient DWS documentation at {relative_doc_path}."
3128
)
3229
except Exception as err:
3330
print(f"Failed to update .junie/guidelines.md file: {err}", file=sys.stderr)

src/scripts/add_windsurf_rule.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@
44

55
def main() -> None:
66
script_dir = os.path.dirname(os.path.abspath(__file__))
7-
doc_path = os.path.join(script_dir, "..", "LLM_DOC.md")
7+
doc_path = os.path.join(script_dir, "..", "..", "LLM_DOC.md")
88
with open(doc_path, encoding="utf-8") as file:
99
documentation = file.read()
10-
type_path = os.path.join(script_dir, "..", "dist", "__init__.pyi")
1110

1211
user_project_root = os.getcwd()
1312
output_directory = os.path.join(user_project_root, ".windsurf/rules")
1413
output_file = os.path.join(output_directory, "nutrient-dws-doc.mdc")
1514

16-
relative_type_path = os.path.relpath(type_path, user_project_root)
17-
1815
try:
1916
rule = f"""
2017
---
21-
description: This rule explains how to use the Nutrient DWS Python Client (`@nutrient-sdk/dws-client-python`) for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
18+
description: This rule explains how to use the Nutrient DWS Python Client (`nutrient-dws`) for operations with document processing operations including conversion, merging, compression, watermarking, signage, and text extraction.
2219
trigger: model_decision
2320
---
24-
> The Python Type Definitions can be found at: ${relative_type_path}
2521
2622
{documentation}
2723
"""

0 commit comments

Comments
 (0)