Skip to content

Highlight script #707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions clarifai/runners/utils/code_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from typing import List

from clarifai_grpc.grpc.api import resources_pb2
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import PythonLexer

from clarifai.runners.utils import data_utils
from clarifai.urls.helper import ClarifaiUrlHelper
Expand Down Expand Up @@ -201,6 +204,8 @@ async def main():
script_lines.append(method_signatures_str)
script_lines.append("")
script = "\n".join(script_lines)

script = highlight(script, PythonLexer(), TerminalFormatter())
return script


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ aiohttp>=3.10.0
uv==0.7.12
ruff==0.11.4
psutil==7.0.0
pygments>=2.19.2
Loading