diff --git a/pyproject.toml b/pyproject.toml index c924cca..ce27432 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ dev = [ "pre-commit>=4.3.0", "pytest>=9.0.1", - "ruff>=0.11", + "ruff>=0.16,<0.17", ] [tool.ruff] diff --git a/skills/python-patterns/references/api-clients.md b/skills/python-patterns/references/api-clients.md index 8b7dd02..2c8c7e6 100644 --- a/skills/python-patterns/references/api-clients.md +++ b/skills/python-patterns/references/api-clients.md @@ -15,14 +15,16 @@ LLM outputs often include markdown fences that break JSON parsing. Always clean ```python import json + def clean_llm_response(text): for prefix in ("```markdown", "```json", "```"): if text.startswith(prefix): - text = text[len(prefix):].strip() + text = text[len(prefix) :].strip() if text.endswith("```"): text = text[:-3].strip() return text + def parse_llm_json(text): text = clean_llm_response(text) try: diff --git a/skills/python-patterns/references/testing.md b/skills/python-patterns/references/testing.md index 353f564..07550ae 100644 --- a/skills/python-patterns/references/testing.md +++ b/skills/python-patterns/references/testing.md @@ -10,6 +10,7 @@ # DataFrame testing import pandas.testing as tm + def test_feature_engineering(): input_df = pd.DataFrame({"price": [100, 200], "quantity": [2, 3]}) result = add_total_column(input_df)