Spaces:
Running
Running
Make Griffe a dependency of lynxkite-app.
Browse files
lynxkite-app/pyproject.toml
CHANGED
@@ -10,6 +10,7 @@ dependencies = [
|
|
10 |
"orjson>=3.10.13",
|
11 |
"pycrdt-websocket>=0.15.3",
|
12 |
"sse-starlette>=2.2.1",
|
|
|
13 |
]
|
14 |
|
15 |
[project.optional-dependencies]
|
|
|
10 |
"orjson>=3.10.13",
|
11 |
"pycrdt-websocket>=0.15.3",
|
12 |
"sse-starlette>=2.2.1",
|
13 |
+
"griffe>=1.7.3",
|
14 |
]
|
15 |
|
16 |
[project.optional-dependencies]
|
lynxkite-core/pyproject.toml
CHANGED
@@ -5,6 +5,7 @@ description = "A lightweight dependency for authoring LynxKite operations and ex
|
|
5 |
readme = "README.md"
|
6 |
requires-python = ">=3.11"
|
7 |
dependencies = [
|
|
|
8 |
]
|
9 |
|
10 |
[project.optional-dependencies]
|
|
|
5 |
readme = "README.md"
|
6 |
requires-python = ">=3.11"
|
7 |
dependencies = [
|
8 |
+
"griffe>=1.7.3",
|
9 |
]
|
10 |
|
11 |
[project.optional-dependencies]
|
lynxkite-core/src/lynxkite/core/ops.py
CHANGED
@@ -6,7 +6,6 @@ import asyncio
|
|
6 |
import enum
|
7 |
import functools
|
8 |
import json
|
9 |
-
import griffe
|
10 |
import importlib
|
11 |
import inspect
|
12 |
import pathlib
|
@@ -434,6 +433,11 @@ def run_user_script(script_path: pathlib.Path):
|
|
434 |
|
435 |
|
436 |
def get_doc(func):
|
|
|
|
|
|
|
|
|
|
|
437 |
if func.__doc__ is None:
|
438 |
return None
|
439 |
doc = griffe.Docstring(func.__doc__).parse("google")
|
|
|
6 |
import enum
|
7 |
import functools
|
8 |
import json
|
|
|
9 |
import importlib
|
10 |
import inspect
|
11 |
import pathlib
|
|
|
433 |
|
434 |
|
435 |
def get_doc(func):
|
436 |
+
"""Griffe is an optional dependency. When available, we returned the parsed docstring."""
|
437 |
+
try:
|
438 |
+
import griffe
|
439 |
+
except ImportError:
|
440 |
+
return func.__doc__
|
441 |
if func.__doc__ is None:
|
442 |
return None
|
443 |
doc = griffe.Docstring(func.__doc__).parse("google")
|