Skip to content

Commit ac75516

Browse files
chore: migrate package manager to uv and automate releases (#84)
Completely migrated the project to uv and modernized the CI pipeline. Key Changes: - **Swapped Poetry for uv & Hatchling:** Replaced [tool.poetry] with standard PEP-621 [project] metadata in pyproject.toml. - **Automated Versioning:** Added release-please to automatically handle version bumping and CHANGELOG generation based on conventional commits. - **PyPI Trusted Publishing:** Upgraded the PyPI release workflow to use OIDC (PyPI Trusted Publishing) via uv publish. We no longer need to maintain the PYPI_API_TOKEN secret. - **Action Versions:** Set all GitHub Actions to their latest major versions (Checkout v6, Setup-Python v6, Setup-UV v7). --------- Co-authored-by: Mason Daugherty <github@mdrxy.com>
1 parent 9158732 commit ac75516

File tree

9 files changed

+4785
-5742
lines changed

9 files changed

+4785
-5742
lines changed

.github/workflows/pypi-release.yml

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

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
config-file: release-please-config.json
23+
manifest-file: .release-please-manifest.json
24+
25+
pypi-publish:
26+
needs: release-please
27+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
28+
runs-on: ubuntu-latest
29+
environment: pypi
30+
31+
# Required for PyPI Trusted Publishing (OIDC-based, tokenless auth).
32+
# See: https://docs.pypi.org/trusted-publishers/
33+
permissions:
34+
id-token: write # Allows the workflow to mint an OIDC token for PyPI trusted publishing
35+
contents: read # Allows actions/checkout to read the code
36+
37+
steps:
38+
- uses: actions/checkout@v6
39+
with:
40+
fetch-depth: 0
41+
ref: ${{ needs.release-please.outputs.tag_name }}
42+
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v7
45+
with:
46+
enable-cache: true
47+
cache-dependency-glob: "uv.lock"
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v6
51+
with:
52+
python-version: "3.10"
53+
54+
- name: Build package
55+
run: uv build
56+
57+
- name: Verify build artifacts
58+
run: ls -la dist/
59+
60+
- name: Publish to PyPI
61+
run: uv publish --trusted-publishing always

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
__pycache__
22
.venv/
3-
.ruff_cache/
3+
.ruff_cache/
4+
.pytest_cache/
5+
.vscode/
6+
.benchmarks/

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.5.1"
3+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<img src="https://img.shields.io/badge/Python-3670A0?style=flat&logo=python&logoColor=ffdd54" alt="Python">
3232
</a><br/>
3333

34-
<a href="https://python-poetry.org/">
35-
<img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
34+
<a href="https://github.com/astral-sh/uv">
35+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
3636
</a>
3737
</td>
3838

poetry.lock

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

pyproject.toml

Lines changed: 91 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,102 @@
11
[build-system]
2-
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
3-
build-backend = "poetry_dynamic_versioning.backend"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

5-
[tool.poetry]
5+
[project]
66
name = "langchain-litellm"
7-
version = "0.0.0"
7+
version = "0.5.1"
88
description = "An integration package connecting LiteLLM and LangChain"
9-
license = "MIT"
9+
authors = [{name = "Akshay Dongare"}]
10+
license = {text = "MIT"}
1011
readme = "README.md"
11-
authors = ["Akshay Dongare"]
12-
repository = "https://github.com/langchain-ai/langchain-litellm"
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: MIT License",
16+
"Natural Language :: English",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3 :: Only",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
25+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26+
"Topic :: Software Development :: Libraries :: Python Modules",
27+
"Typing :: Typed",
28+
]
29+
requires-python = ">=3.10,<4.0"
30+
dependencies = [
31+
"langchain-core>0.3.15,<2.0.0",
32+
"litellm>=1.77.2,<2.0.0",
33+
"httpx>=0.28.1,<0.29.0",
34+
"cryptography>=46.0.5,<47.0.0",
35+
]
36+
37+
[project.urls]
38+
Homepage = "https://docs.langchain.com/oss/python/integrations/providers/litellm"
39+
Documentation = "https://docs.langchain.com/oss/python/integrations/chat/litellm"
40+
Repository = "https://github.com/langchain-ai/langchain-litellm"
41+
Issues = "https://github.com/langchain-ai/langchain-litellm/issues"
42+
Changelog = "https://github.com/langchain-ai/langchain-litellm/releases"
43+
Twitter = "https://x.com/LangChain"
44+
Slack = "https://www.langchain.com/join-community"
45+
Reddit = "https://www.reddit.com/r/LangChain/"
46+
47+
[dependency-groups]
48+
test = [
49+
"pytest>=7.4.4,<8.0.0",
50+
"pytest-asyncio>=0.20.3,<1.0.0",
51+
"pytest-socket>=0.6.0,<1.0.0",
52+
"pytest-watcher>=0.2.6,<1.0.0",
53+
"langchain-tests>=1.0.0,<2.0.0",
54+
"pytest-cov>=4.1.0,<5.0.0",
55+
"pytest-dotenv>=0.5.2,<1.0.0",
56+
"duckdb-engine>=0.13.6,<1.0.0",
57+
"freezegun>=1.2.2,<2.0.0",
58+
"responses>=0.22.0,<1.0.0",
59+
"lark>=1.1.5,<2.0.0",
60+
"pandas>=2.0.0,<3.0.0",
61+
"pytest-mock>=3.10.0,<4.0.0",
62+
"syrupy>=4.0.2,<5.0.0",
63+
"requests-mock>=1.11.0,<2.0.0",
64+
"pytest-xdist>=3.6.1,<4.0.0",
65+
"blockbuster>=1.5.18,<1.6",
66+
"cffi>=2.0.0,<3.0.0; python_version >= '3.10'",
67+
"langchain-core>=1.0.0,<2.0.0",
68+
"langchain>=1.0.0,<2.0.0",
69+
"toml>=0.10.2",
70+
]
71+
codespell = [
72+
"codespell>=2.2.6,<3.0.0",
73+
]
74+
lint = [
75+
"ruff>=0.5.0,<0.6.0",
76+
]
77+
dev = [
78+
"ipykernel>=6.29.5,<7.0.0",
79+
"python-dotenv>=1.2.1,<2.0.0",
80+
]
81+
typing = [
82+
"mypy>=1.12,<2.0",
83+
"types-pyyaml>=6.0.12.2,<7.0.0.0",
84+
"types-requests>=2.28.11.5,<3.0.0.0",
85+
"types-toml>=0.10.8.1,<1.0.0.0",
86+
"types-pytz>=2023.3.0.0,<2024.0.0.0",
87+
"types-chardet>=5.0.4.6,<6.0.0.0",
88+
"types-redis>=4.3.21.6,<5.0.0.0",
89+
"mypy-protobuf>=3.0.0,<4.0.0",
90+
"langchain-core>=1.0.0,<2.0.0",
91+
"langchain-text-splitters>=0.3.7,<0.4.0",
92+
"langchain>=1.0.0,<2.0.0",
93+
"cffi>=2.0.0,<3.0.0",
94+
]
95+
test_integration = []
1396

1497
[tool.mypy]
1598
disallow_untyped_defs = "True"
1699

17-
[tool.poetry.urls]
18-
"Source Code" = "https://github.com/langchain-ai/langchain-litellm"
19-
"Release Notes" = "https://github.com/langchain-ai/langchain-litellm/releases"
20-
21-
[tool.poetry.dependencies]
22-
python = ">=3.10,<4.0"
23-
langchain-core = ">0.3.15,<2.0.0"
24-
litellm = "^1.77.2"
25-
httpx = "^0.28.1"
26-
cryptography = ">=46.0.5,<47.0.0"
27-
28100
[tool.ruff.lint]
29101
select = ["E", "F", "I", "T201"]
30102

@@ -38,72 +110,6 @@ skip = "*.lock"
38110
addopts = "--strict-markers --strict-config --durations=5"
39111
markers = [
40112
"compile: mark placeholder test used to compile integration tests without running them",
113+
"integration: mark test as an integration test",
41114
]
42115
asyncio_mode = "auto"
43-
44-
[tool.poetry.group.test]
45-
optional = true
46-
47-
[tool.poetry.group.codespell]
48-
optional = true
49-
50-
[tool.poetry.group.test_integration]
51-
optional = true
52-
53-
[tool.poetry.group.lint]
54-
optional = true
55-
56-
[tool.poetry.group.dev]
57-
optional = true
58-
59-
[tool.poetry.group.dev.dependencies]
60-
ipykernel = "^6.29.5"
61-
python-dotenv = "^1.2.1"
62-
63-
[tool.poetry.group.test.dependencies]
64-
pytest = ">=7.4.4,<8.0.0"
65-
pytest-asyncio = ">=0.20.3,<1.0.0"
66-
pytest-socket = ">=0.6.0,<1.0.0"
67-
pytest-watcher = ">=0.2.6,<1.0.0"
68-
langchain-tests = "^1.0.0"
69-
pytest-cov = ">=4.1.0,<5.0.0"
70-
pytest-dotenv = ">=0.5.2,<1.0.0"
71-
duckdb-engine = ">=0.13.6,<1.0.0"
72-
freezegun = ">=1.2.2,<2.0.0"
73-
responses = ">=0.22.0,<1.0.0"
74-
lark = ">=1.1.5,<2.0.0"
75-
pandas = ">=2.0.0,<3.0.0"
76-
pytest-mock = ">=3.10.0,<4.0.0"
77-
syrupy = ">=4.0.2,<5.0.0"
78-
requests-mock = ">=1.11.0,<2.0.0"
79-
pytest-xdist = ">=3.6.1,<4.0.0"
80-
blockbuster = ">=1.5.18,<1.6"
81-
cffi = { markers = "python_version >= \"3.10\"", version = ">=2.0.0,<3.0.0" }
82-
langchain-core = "^1.0.0"
83-
langchain = "^1.0.0"
84-
toml = ">=0.10.2"
85-
86-
[tool.poetry.group.codespell.dependencies]
87-
codespell = "^2.2.6"
88-
89-
[tool.poetry.group.test_integration.dependencies]
90-
91-
[tool.poetry.group.lint.dependencies]
92-
ruff = "^0.5"
93-
94-
[tool.poetry.group.typing.dependencies]
95-
mypy = ">=1.12,<2.0"
96-
types-pyyaml = ">=6.0.12.2,<7.0.0.0"
97-
types-requests = ">=2.28.11.5,<3.0.0.0"
98-
types-toml = ">=0.10.8.1,<1.0.0.0"
99-
types-pytz = ">=2023.3.0.0,<2024.0.0.0"
100-
types-chardet = ">=5.0.4.6,<6.0.0.0"
101-
types-redis = ">=4.3.21.6,<5.0.0.0"
102-
mypy-protobuf = ">=3.0.0,<4.0.0"
103-
langchain-core = "^1.0.0"
104-
langchain-text-splitters = "^0.3.7"
105-
langchain = "^1.0.0"
106-
cffi = ">=2.0.0,<3.0.0"
107-
108-
[tool.poetry-dynamic-versioning]
109-
enable = true

release-please-config.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "python",
6+
"package-name": "langchain-litellm",
7+
"bump-minor-pre-major": true,
8+
"bump-patch-for-minor-pre-major": true
9+
}
10+
},
11+
"changelog-sections": [
12+
{
13+
"type": "feat",
14+
"section": "Features"
15+
},
16+
{
17+
"type": "fix",
18+
"section": "Bug Fixes"
19+
},
20+
{
21+
"type": "perf",
22+
"section": "Performance Improvements"
23+
},
24+
{
25+
"type": "revert",
26+
"section": "Reverted Changes"
27+
},
28+
{
29+
"type": "docs",
30+
"section": "Documentation",
31+
"hidden": true
32+
},
33+
{
34+
"type": "style",
35+
"hidden": true
36+
},
37+
{
38+
"type": "chore",
39+
"hidden": true
40+
},
41+
{
42+
"type": "refactor",
43+
"hidden": true
44+
},
45+
{
46+
"type": "test",
47+
"hidden": true
48+
},
49+
{
50+
"type": "ci",
51+
"hidden": true
52+
}
53+
]
54+
}

0 commit comments

Comments
 (0)