Skip to content

Commit

Permalink
Make pyo3 dependency optional
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
414owen authored and torymur committed Feb 10, 2025
1 parent a06d483 commit 2dfb1dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ once_cell = "1.20"
thiserror = "2.0"
pyo3 = { version = "0.22.0", features = ["extension-module"], optional = true }
regex = "1.10.6"
serde-pyobject = "0.4.0"
serde-pyobject = { version = "0.4.0", optional = true }
serde_json = { version = "1.0", features = ["preserve_order"] }
serde = {version = "1.0", features = ["derive"]}
bincode = "2.0.0-rc.3"
Expand All @@ -23,7 +23,7 @@ rustc-hash = "2.1.0"
regex-automata = "0.4.9"

[features]
python-bindings = ["pyo3"]
python-bindings = ["pyo3", "serde-pyobject"]

[lib]
name = "outlines_core"
Expand Down

0 comments on commit 2dfb1dd

Please sign in to comment.