Skip to content

Commit ad5ada5

Browse files
committed
chore: move optional dependencies to dependency groups
PEP 735 defines dependency groups which is a bit different from optional dependencies -- notablely this dependency information is not exported as part of the package metadata. For dependencies needed for testing purposes, we can use dependency groups and having optional dependencies to focus on providing customizations for the users.
1 parent e0ee449 commit ad5ada5

File tree

7 files changed

+37
-33
lines changed

7 files changed

+37
-33
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: tests
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
types:
99
- opened
@@ -24,7 +24,7 @@ jobs:
2424
python-version: "3.10"
2525
- name: Install dependencies
2626
run: |
27-
pip install .[lint]
27+
pip install . --group lint
2828
- name: Lint Python code with ruff
2929
run: |
3030
ruff check .
@@ -45,7 +45,7 @@ jobs:
4545
python-version: ${{ matrix.python-version }}
4646
- name: Install dependencies
4747
run: |
48-
pip install ".[dev, memory]"
48+
pip install ".[memory]" --group dev
4949
- name: Run tests
5050
run: |
5151
pytest tests/
@@ -66,7 +66,7 @@ jobs:
6666
- name: Install dependencies
6767
run: |
6868
pip install .
69-
pip install integrations/langchain[dev]
69+
pip install integrations/langchain --group dev
7070
- name: Run tests
7171
run: |
7272
pytest integrations/langchain/tests/unit_tests
@@ -87,7 +87,7 @@ jobs:
8787
- name: Install dependencies
8888
run: |
8989
pip install .[memory]
90-
pip install "integrations/langchain[dev, memory]"
90+
pip install "integrations/langchain[memory]" --group dev
9191
- name: Run tests
9292
run: |
9393
pytest tests/databricks_ai_bridge/test_lakebase.py
@@ -131,7 +131,7 @@ jobs:
131131
cp -r older-version/integrations/langchain integrations/
132132
- name: Install langchain dependency
133133
run: |
134-
pip install integrations/langchain[dev]
134+
pip install integrations/langchain --group dev
135135
- name: Run tests
136136
run: |
137137
# Only testing initialization since functionality can change
@@ -156,7 +156,7 @@ jobs:
156156
- name: Install dependencies
157157
run: |
158158
pip install .
159-
pip install integrations/openai[dev]
159+
pip install integrations/openai --group dev
160160
- name: Run tests
161161
run: |
162162
pytest integrations/openai/tests/unit_tests
@@ -198,7 +198,8 @@ jobs:
198198
cp -r older-version/integrations/openai integrations/
199199
- name: Install openai dependency
200200
run: |
201-
pip install integrations/openai[dev]
201+
pip install .
202+
pip install integrations/openai --group dev
202203
- name: Run tests
203204
run: |
204205
# Only testing initialization since functionality can change
@@ -220,7 +221,7 @@ jobs:
220221
- name: Install dependencies
221222
run: |
222223
pip install .
223-
pip install integrations/llamaindex[dev]
224+
pip install integrations/llamaindex --group dev
224225
- name: Run tests
225226
run: |
226227
pytest integrations/llamaindex/tests/unit_tests
@@ -241,7 +242,7 @@ jobs:
241242
- name: Install dependencies
242243
run: |
243244
pip install .
244-
pip install -e databricks_mcp[dev]
245+
pip install -e databricks_mcp --group dev
245246
- name: Run tests
246247
run: |
247248
pytest databricks_mcp/tests/unit_tests
@@ -262,7 +263,7 @@ jobs:
262263
- name: Install dependencies
263264
run: |
264265
pip install .
265-
pip install integrations/dspy[dev]
266+
pip install integrations/dspy --group dev
266267
- name: Run tests
267268
run: |
268269
pytest integrations/dspy/tests/unit_tests

databricks_mcp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
"mlflow>=3.1"
1616
]
1717

18-
[project.optional-dependencies]
18+
[dependency-groups]
1919
dev = [
2020
"pytest",
2121
"pytest-asyncio",

integrations/dspy/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies = [
1414
"mlflow>=3.0.0",
1515
]
1616

17-
[project.optional-dependencies]
17+
[dependency-groups]
1818
dev = [
1919
"pytest",
2020
"ruff",

integrations/langchain/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ dependencies = [
2020
]
2121

2222
[project.optional-dependencies]
23+
memory = [
24+
"langgraph-checkpoint-postgres>=2.0.0",
25+
"databricks-ai-bridge[memory]>=0.10.0",
26+
]
27+
28+
[dependency-groups]
2329
dev = [
2430
"pytest",
2531
"typing_extensions",
@@ -33,10 +39,6 @@ integration = [
3339
"anyio",
3440
]
3541

36-
memory = [
37-
"langgraph-checkpoint-postgres>=2.0.0",
38-
"databricks-ai-bridge[memory]>=0.10.0",
39-
]
4042

4143
[build-system]
4244
requires = ["hatchling"]

integrations/llamaindex/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
"unitycatalog-llamaindex[databricks]>=0.2.0",
1616
]
1717

18-
[project.optional-dependencies]
18+
[dependency-groups]
1919
dev = [
2020
"pytest",
2121
"typing_extensions",
@@ -69,4 +69,4 @@ docstring-code-format = true
6969
docstring-code-line-length = 88
7070

7171
[tool.ruff.lint.pydocstyle]
72-
convention = "google"
72+
convention = "google"

integrations/openai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies = [
2020
"openai-agents>=0.5.0"
2121
]
2222

23-
[project.optional-dependencies]
23+
[dependency-groups]
2424
dev = [
2525
"pytest",
2626
"pytest-asyncio",

pyproject.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ dependencies = [
2121
[project.license]
2222
file = "LICENSE.txt"
2323

24-
[build-system]
25-
requires = ["hatchling"]
26-
build-backend = "hatchling.build"
27-
28-
[tool.hatch.build]
29-
include = [
30-
"src/*"
24+
[project.optional-dependencies]
25+
memory = [
26+
"psycopg[binary,pool]>=3.1",
3127
]
3228

33-
[tool.hatch.build.targets.wheel]
34-
packages = ["src/databricks_ai_bridge"]
35-
36-
[project.optional-dependencies]
29+
[dependency-groups]
3730
dev = [
3831
"hatch",
3932
"pytest",
@@ -56,10 +49,18 @@ lint = [
5649
"ruff==0.12.10",
5750
]
5851

59-
memory = [
60-
"psycopg[binary,pool]>=3.1",
52+
[build-system]
53+
requires = ["hatchling"]
54+
build-backend = "hatchling.build"
55+
56+
[tool.hatch.build]
57+
include = [
58+
"src/*"
6159
]
6260

61+
[tool.hatch.build.targets.wheel]
62+
packages = ["src/databricks_ai_bridge"]
63+
6364
[tool.ruff]
6465
line-length = 100
6566
target-version = "py39"

0 commit comments

Comments
 (0)