Implementation:Langchain ai Langchain Pyproject Toml Configuration
Overview
Concrete configuration file for a LangChain partner package, provided by the langchain-deepseek pyproject.toml at libs/partners/deepseek/pyproject.toml.
Description
The pyproject.toml for langchain-deepseek demonstrates the standard configuration structure that every LangChain partner integration package follows. It is organized into the following sections:
Build system: Uses hatchling as the PEP 517 build backend.
Project metadata: Declares the package name (langchain-deepseek), version, description, MIT license, supported Python versions (3.10 through 3.14), and PyPI classifiers.
Runtime dependencies: Requires langchain-core>=1.1.0,<2.0.0 and langchain-openai>=1.1.0,<2.0.0 (since DeepSeek is OpenAI-compatible).
Dependency groups:
test: pytest, pytest-asyncio, pytest-socket (for disabling network in unit tests), pytest-watcher, pytest-timeout, langchain-tests, langchain-openaitest_integration: Empty (no extra deps needed beyond test group)lint: rufftyping: mypy
Local development sources ([tool.uv.sources]): Maps langchain-openai, langchain-core, and langchain-tests to local editable paths so that changes are reflected immediately during development.
Tool configurations: Includes settings for mypy (strict untyped defs), ruff (format, lint rules, per-file ignores for tests), pytest (strict markers, asyncio_mode=auto), and coverage.
Usage
Use this file as a reference when creating or modifying the pyproject.toml for any LangChain partner integration package. Copy the structure and adjust the package-specific fields (name, version, description, dependencies).
Code Reference
Source Location: libs/partners/deepseek/pyproject.toml, Lines 1-111
Full configuration:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "langchain-deepseek"
description = "An integration package connecting DeepSeek and LangChain"
license = { text = "MIT" }
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
version = "1.1.0"
requires-python = ">=3.10.0,<4.0.0"
dependencies = [
"langchain-core>=1.1.0,<2.0.0",
"langchain-openai>=1.1.0,<2.0.0",
]
[project.urls]
Homepage = "https://docs.langchain.com/oss/python/integrations/providers/deepseek"
Documentation = "https://reference.langchain.com/python/integrations/langchain_deepseek/"
Repository = "https://github.com/langchain-ai/langchain"
[dependency-groups]
test = [
"pytest>=7.4.3,<8.0.0",
"pytest-asyncio>=0.23.2,<1.0.0",
"pytest-socket>=0.7.0,<1.0.0",
"pytest-watcher>=0.3.4,<1.0.0",
"pytest-timeout>=2.3.1,<3.0.0",
"langchain-tests",
"langchain-openai",
]
test_integration = []
lint = ["ruff>=0.13.1,<0.14.0"]
dev = []
typing = ["mypy>=1.10.0,<2.0.0"]
[tool.uv.sources]
langchain-openai = { path = "../openai", editable = true }
langchain-core = { path = "../../core", editable = true }
langchain-tests = { path = "../../standard-tests", editable = true }
[tool.mypy]
disallow_untyped_defs = "True"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 100
[tool.ruff.lint]
select = [ "ALL" ]
[tool.pytest.ini_options]
addopts = "--strict-markers --strict-config --durations=5"
asyncio_mode = "auto"
[tool.ruff.lint.pydocstyle]
convention = "google"
I/O Contract
| Input | Type | Description |
|---|---|---|
[build-system].requires |
list[str] | Build backend requirement; must be ["hatchling"]
|
[project].name |
str | Package name in langchain-<name> format
|
[project].version |
str | Semantic version string |
[project].dependencies |
list[str] | Runtime dependencies with version constraints |
[dependency-groups].test |
list[str] | Test-time dependencies including langchain-tests
|
| Output | Type | Description |
|---|---|---|
| Built wheel | .whl file | Installable Python package |
| Dependency resolution | uv.lock | Locked dependency graph for reproducible builds |
| Tool behavior | N/A | Configured linting, formatting, type-checking, and test behavior |
Usage Examples
Installing dependencies for a specific group:
# Install test dependencies only
uv sync --group test
# Install all dependency groups
uv sync --all-groups
# Build the package
uv build
Adding a new runtime dependency:
[project]
dependencies = [
"langchain-core>=1.1.0,<2.0.0",
"langchain-openai>=1.1.0,<2.0.0",
"some-new-dependency>=1.0.0,<2.0.0", # Added
]
Adding a new test dependency:
[dependency-groups]
test = [
"pytest>=7.4.3,<8.0.0",
"pytest-asyncio>=0.23.2,<1.0.0",
"pytest-socket>=0.7.0,<1.0.0",
"langchain-tests",
"new-test-helper>=1.0.0", # Added
]