Skip to content
Merged
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
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ permissions:
contents: read

env:
# `[tool.uv.sources]` pins langchain-core / langchain-tests to a sibling
# `../langchain/` checkout that does not exist on CI. `--no-sources` ignores
# that table and resolves them from PyPI instead — the same path release
# builds take. It forces re-resolution, so the lockfile is not used here.
# `uv sync` below passes `--no-sources`. pyproject.toml no longer has a
# `[tool.uv.sources]` table, so the flag is redundant but harmless; every
# dependency resolves from PyPI, the same path release builds take.
UV_NO_SYNC: "true"

jobs:
Expand Down Expand Up @@ -54,7 +53,6 @@ jobs:
- run: uv sync --no-sources --group test
- run: make test
- name: Check for unexpected file changes
# `uv sync --no-sources` rewrites uv.lock in place (local editable
# source -> PyPI registry); that diff is expected in CI. Exclude it so
# the guard still catches stray files a test might have written.
# uv.lock is excluded so a lockfile rewrite by `uv sync` cannot fail
# this guard; it still catches stray files a test might have written.
run: git diff --exit-code -- ':!uv.lock'
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ LangChain integration package for the Diffbot APIs (Knowledge Graph, Extract, We
## Stack

- **Build/deps**: `uv` (not Poetry/pip). `pyproject.toml` is PEP 621 with `hatchling` as the build backend. Dependency groups (`test`, `lint`, `typing`) are declared under `[dependency-groups]` and invoked via `uv run --group <name> ...`.
- **HTTP / Diffbot transport**: the official [`diffbot-python`](https://github.com/diffbot/diffbot-python) SDK. It wraps `httpx` under the hood, so `respx` continues to work for unit tests — mocks target the real upstream URLs (KG: `POST https://kg.diffbot.com/kg/v3/dql` with a JSON body, web search: `https://llm.diffbot.com/api/v1/web_search`, extract: `https://api.diffbot.com/v3/analyze`, ask: `https://llm.diffbot.com/rag/v1/chat/completions`, NLP: `https://nl.diffbot.com/v1/`, crawl: `https://api.diffbot.com/v3/crawl`, ontology: `https://kg.diffbot.com/kg/ontology`). It is published on PyPI as `diffbot` and declared as `diffbot>=3.4.0,<4`; `uv.lock` resolves it from PyPI. To pick up a new SDK release, run `uv lock --upgrade-package diffbot --no-sources` with the uv version CI pins (0.9.5, so the lock stays at `revision = 3`). `langchain-core` / `langchain-tests` are still resolved during local dev from the sibling `../langchain/` checkout via `[tool.uv.sources]` — release builds use the published versions.
- **HTTP / Diffbot transport**: the official [`diffbot-python`](https://github.com/diffbot/diffbot-python) SDK. It wraps `httpx` under the hood, so `respx` continues to work for unit tests — mocks target the real upstream URLs (KG: `POST https://kg.diffbot.com/kg/v3/dql` with a JSON body, web search: `https://llm.diffbot.com/api/v1/web_search`, extract: `https://api.diffbot.com/v3/analyze`, ask: `https://llm.diffbot.com/rag/v1/chat/completions`, NLP: `https://nl.diffbot.com/v1/`, crawl: `https://api.diffbot.com/v3/crawl`, ontology: `https://kg.diffbot.com/kg/ontology`). It is published on PyPI as `diffbot` and declared as `diffbot>=3.4.0,<4`; `uv.lock` resolves it from PyPI. To pick up a new SDK release, run `uv lock --upgrade-package diffbot --no-sources` with the uv version CI pins (0.9.5, so the lock stays at `revision = 3`). `langchain-core` / `langchain-tests` also come from PyPI, locally and in release builds; there is no `[tool.uv.sources]` table.
- **Models**: `pydantic` v2.
- **LangChain**: targets `langchain-core >=1.0,<2.0`. During local dev `langchain-core` and `langchain-tests` are resolved from a sibling `../langchain/` checkout via `[tool.uv.sources]` — release builds use the published versions.
- **LangChain**: targets `langchain-core >=1.0,<2.0`. `langchain-core` and `langchain-tests` resolve from PyPI everywhere, the same as release builds.
- **Test runner**: `pytest` with `asyncio_mode = "auto"`.

## Architectural decisions
Expand Down Expand Up @@ -78,7 +78,7 @@ make test_integration # integration tests (needs DIFFBOT_API_TOKEN)

`.github/workflows/ci.yml` runs on every push to `main` and every PR: `make lint` + `make typing` (Python 3.12) and `make test` (Python 3.10 and 3.13). `.github/workflows/integration.yml` runs `make test_integration` on push to `main`, on a twice-monthly drift schedule (1st and 15th at 14:17 UTC), and on-demand (`workflow_dispatch`), reading the repo-level `DIFFBOT_API_TOKEN` secret. It is kept off the per-PR path on purpose so the token is never exposed to untrusted fork PR code.

CI cannot use the `[tool.uv.sources]` table, which pins `langchain-core` / `langchain-tests` to the sibling `../langchain/` checkout that only exists locally. Every CI install is `uv sync --no-sources` (resolves those from PyPI, the same path release builds take) and sets `UV_NO_SYNC=true` so the `make` targets' `uv run` reuse the synced env instead of re-resolving against the sources table. `--no-sources` re-resolves, so `uv.lock` is not used in CI.
Every CI install is `uv sync --no-sources` and sets `UV_NO_SYNC=true` so the `make` targets' `uv run` reuse the synced env. pyproject.toml has no `[tool.uv.sources]` table (it was removed so Dependabot's `uv` updater can resolve the project), so `--no-sources` is now redundant but harmless; everything resolves from PyPI, the same path release builds take.

## Releasing

Expand Down
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ test = [
lint = ["ruff>=0.6,<1.0"]
typing = ["mypy>=1.10,<2.0"]

# Local dev only: langchain-core / langchain-tests from a sibling ../langchain
# checkout. CI and release builds pass --no-sources and use PyPI. The diffbot SDK
# is deliberately not a source; it always comes from PyPI.
[tool.uv.sources]
langchain-core = { path = "../langchain/libs/core", editable = true }
langchain-tests = { path = "../langchain/libs/standard-tests", editable = true }

[tool.hatch.build.targets.wheel]
packages = ["langchain_diffbot"]

Expand Down