diff --git a/.licenserc.yaml b/.licenserc.yaml index 390070a87..bbce65405 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -82,6 +82,9 @@ header: # `header` section is configurations for source codes license header. - '**/poetry.lock' - '.github/**/*' - 'docker/**/*' + - '**/*.interp' + - '**/*.tokens' + - '**/*.csv' comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`. diff --git a/pyproject.toml b/pyproject.toml index 43ff9cbcc..bdbdc4f8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -163,6 +163,9 @@ addopts = "--strict-markers --strict-config" [tool.ruff] line-length = 120 target-version = "py310" +extend-exclude = [ + "text2gremlin/AST_Text2Gremlin/base/gremlin/*.py", +] [tool.ruff.lint] # Select a broad set of rules for comprehensive checks. @@ -188,6 +191,30 @@ ignore = [ "tests/**/*.py" = ["T20"] "hugegraph-ml/src/hugegraph_ml/examples/**/*.py" = ["T20"] "hugegraph-python-client/src/pyhugegraph/structure/*.py" = ["N802"] +"text2gremlin/AST_Text2Gremlin/base/*.py" = [ + "N999", # Keep existing standalone module names such as GremlinBase.py. +] +"text2gremlin/AST_Text2Gremlin/analyze_syntax.py" = ["T20"] +"text2gremlin/AST_Text2Gremlin/generate_corpus.py" = ["T20"] +"text2gremlin/AST_Text2Gremlin/run_llm_pipeline.py" = ["T20"] +"text2gremlin/AST_Text2Gremlin/base/GremlinBase.py" = ["T20"] +"text2gremlin/AST_Text2Gremlin/base/GremlinTransVisitor.py" = [ + "F403", # ANTLR visitor compatibility import style. + "F811", # Visitor methods mirror grammar alternatives and may intentionally repeat names. + "T20", # Parser diagnostics are printed by the standalone visitor helper. +] +"text2gremlin/AST_Text2Gremlin/base/TraversalGenerator.py" = [ + "E501", # Long generated traversal fragments are kept readable. + "E741", # Gremlin examples may use compact variable names in local comprehensions. + "RUF012", # Class-level step configuration dictionaries are constants in practice. + "SIM102", # Keep complex traversal-generation branching explicit. + "SIM108", # Keep complex traversal-generation branching explicit. +] +"text2gremlin/AST_Text2Gremlin/llm_augment/*.py" = [ + "E501", # Long prompts are kept readable. + "RUF002", # Chinese prompt text intentionally uses full-width punctuation. + "T20", # Standalone data-generation scripts write progress to stdout. +] [tool.ruff.lint.isort] known-first-party = ["hugegraph_llm", "hugegraph_python_client", "hugegraph_ml", "vermeer_python_client"] diff --git a/text2gremlin/AST_Text2Gremlin/.gitignore b/text2gremlin/AST_Text2Gremlin/.gitignore new file mode 100644 index 000000000..4b7b70bd3 --- /dev/null +++ b/text2gremlin/AST_Text2Gremlin/.gitignore @@ -0,0 +1,13 @@ +# 配置文件 +config.json +.env +output/ + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +*.egg-info/ +.eggs/ diff --git a/text2gremlin/AST_Text2Gremlin/requirements.txt b/text2gremlin/AST_Text2Gremlin/requirements.txt new file mode 100644 index 000000000..c9eea951b --- /dev/null +++ b/text2gremlin/AST_Text2Gremlin/requirements.txt @@ -0,0 +1,5 @@ +antlr4-python3-runtime==4.13.1 +openai~=1.61.0 +pandas~=2.2.3 +pydantic~=2.10.6 +pytest~=8.0.0