Skip to content

Commit 2dfb1dd

Browse files
414owentorymur
authored andcommitted
Make pyo3 dependency optional
At the moment, pulling in `outlines-core` with default features disabled still pulls in, compiles, and pins your version of, `pyo3`. To fix this, we need to add dependencies which transitively depend on pyo3 to the optional `python-bindings` dependency set.
1 parent a06d483 commit 2dfb1dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ once_cell = "1.20"
1212
thiserror = "2.0"
1313
pyo3 = { version = "0.22.0", features = ["extension-module"], optional = true }
1414
regex = "1.10.6"
15-
serde-pyobject = "0.4.0"
15+
serde-pyobject = { version = "0.4.0", optional = true }
1616
serde_json = { version = "1.0", features = ["preserve_order"] }
1717
serde = {version = "1.0", features = ["derive"]}
1818
bincode = "2.0.0-rc.3"
@@ -23,7 +23,7 @@ rustc-hash = "2.1.0"
2323
regex-automata = "0.4.9"
2424

2525
[features]
26-
python-bindings = ["pyo3"]
26+
python-bindings = ["pyo3", "serde-pyobject"]
2727

2828
[lib]
2929
name = "outlines_core"

0 commit comments

Comments
 (0)