Skip to content

Commit 89730bf

Browse files
authored
chore: upgrade ruff + merge configurations (#1535)
1 parent 42a0f62 commit 89730bf

File tree

9 files changed

+49
-60
lines changed

9 files changed

+49
-60
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v3
22-
- uses: chartboost/ruff-action@v1
23-
with:
24-
args: check --config ci.ruff.toml
22+
- uses: astral-sh/ruff-action@v3
2523

2624
type-checking:
2725
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.14.4
3+
rev: v0.15.2
44
hooks:
55
# Run the linter and fix
6-
- id: ruff
6+
- id: ruff-check
77
types_or: [python, pyi, jupyter]
8-
args: [--fix, --config=ci.ruff.toml]
8+
args: [--fix]
99

1010
# Run the formatter.
1111
- id: ruff-format
1212
types_or: [python, pyi, jupyter]
13-
args: [--config=ci.ruff.toml]
1413

1514
- repo: https://github.com/pre-commit/mirrors-mypy
1615
rev: v1.18.2

CLAUDE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ Environment variables (defined in `_client/environment_variables.py`):
114114
## Important Files
115115

116116
- `pyproject.toml`: Poetry configuration, dependencies, and tool settings
117-
- `ruff.toml`: Local development linting config (stricter)
118-
- `ci.ruff.toml`: CI linting config (more permissive)
119117
- `langfuse/version.py`: Version string (updated by CI release workflow)
120118

121119
## API Generation

ci.ruff.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

poetry.lock

Lines changed: 23 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pytest-xdist = "^3.3.1"
2727
pre-commit = "^3.2.2"
2828
pytest-asyncio = ">=0.21.1,<1.2.0"
2929
pytest-httpserver = "^1.0.8"
30-
ruff = ">=0.1.8,<0.13.0"
30+
ruff = "^0.15.2"
3131
mypy = "^1.0.0"
3232
langchain-openai = ">=0.0.5,<0.4"
3333
langchain = ">=1"
@@ -101,3 +101,20 @@ module = [
101101
]
102102
ignore_errors = true
103103

104+
[tool.ruff]
105+
target-version = "py310"
106+
107+
[tool.ruff.lint]
108+
extend-select = [
109+
"I", # Import formatting
110+
# These used to be enabled in the "local ruff.toml",
111+
# which was never enforced; hence, enabling these will
112+
# cause a large number of linting errors.
113+
114+
# "D", # Docstring lints
115+
# "D401", # Enforce imperative mood in docstrings
116+
]
117+
exclude = ["langfuse/api/**/*.py"]
118+
119+
[tool.ruff.lint.pydocstyle]
120+
convention = "google"

ruff.toml

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/test_datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import time
3-
from datetime import timedelta
43
from concurrent.futures import ThreadPoolExecutor
4+
from datetime import timedelta
55
from typing import Sequence
66

77
from langchain_core.prompts import PromptTemplate
@@ -573,8 +573,8 @@ def test_get_dataset_with_version():
573573

574574
def test_run_experiment_with_versioned_dataset():
575575
"""Test that running an experiment on a versioned dataset works correctly."""
576-
from datetime import timedelta
577576
import time
577+
from datetime import timedelta
578578

579579
langfuse = Langfuse(debug=False)
580580

tests/test_error_logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import logging
2+
23
import pytest
34

45
from langfuse._utils.error_logging import (
5-
catch_and_log_errors,
66
auto_decorate_methods_with,
7+
catch_and_log_errors,
78
)
89

910

0 commit comments

Comments
 (0)