Skip to content

Commit b1ece19

Browse files
committed
updates for new jiter
1 parent 3773bd6 commit b1ece19

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

Cargo.lock

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ include = [
2626
]
2727

2828
[dependencies]
29-
pyo3 = { version = "0.20.0", features = ["generate-import-lib", "num-bigint"] }
29+
pyo3 = { git = "https://github.com/davidhewitt/pyo3", branch="complete-py2", version = "0.21.0-dev", default-features=false, features = ["macros", "generate-import-lib", "num-bigint"] }
3030
regex = "1.10.2"
3131
strum = { version = "0.25.0", features = ["derive"] }
3232
strum_macros = "0.25.3"
@@ -43,8 +43,8 @@ base64 = "0.21.5"
4343
num-bigint = "0.4.4"
4444
python3-dll-a = "0.2.7"
4545
uuid = "1.5.0"
46-
jiter = {version = "0.0.4", features = ["python"]}
47-
#jiter = {path = "../jiter", features = ["python"]}
46+
jiter = { git = "https://github.com/pydantic/jiter", branch = "dh/py2", version = "0.0.4", features = ["python"]}
47+
4848

4949
[lib]
5050
name = "_pydantic_core"
@@ -69,12 +69,12 @@ debug = true
6969
strip = false
7070

7171
[dev-dependencies]
72-
pyo3 = { version = "0.20.0", features = ["auto-initialize"] }
72+
pyo3 = { git = "https://github.com/davidhewitt/pyo3", branch="complete-py2", version = "0.21.0-dev", default-features=false, features = ["auto-initialize"] }
7373

7474
[build-dependencies]
7575
version_check = "0.9.4"
7676
# used where logic has to be version/distribution specific, e.g. pypy
77-
pyo3-build-config = { version = "0.20.0" }
77+
pyo3-build-config = { git = "https://github.com/davidhewitt/pyo3", branch="complete-py2", version = "0.21.0-dev" }
7878

7979
[lints.clippy]
8080
dbg_macro = "warn"
@@ -106,3 +106,10 @@ too_many_lines = "allow"
106106
unnecessary_wraps = "allow"
107107
unused_self = "allow"
108108
used_underscore_binding = "allow"
109+
110+
[patch.'https://github.com/davidhewitt/pyo3']
111+
pyo3 = { path = "../pyo3" }
112+
pyo3-build-config = { path = "../pyo3/pyo3-build-config" }
113+
114+
[patch.'https://github.com/pydantic/jiter']
115+
jiter = { path = "../jiter" }

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub use serializers::{
3838
pub use validators::{validate_core_schema, PySome, SchemaValidator};
3939

4040
#[pyfunction(signature = (data, *, allow_inf_nan=true))]
41-
pub fn from_json(py: Python, data: &PyAny, allow_inf_nan: bool) -> PyResult<PyObject> {
41+
pub fn from_json<'py>(py: Python<'py>, data: &PyAny, allow_inf_nan: bool) -> PyResult<Py2<'py, PyAny>> {
4242
if let Ok(py_bytes) = data.downcast::<PyBytes>() {
4343
jiter::python_parse(py, py_bytes.as_bytes(), allow_inf_nan)
4444
} else if let Ok(py_str) = data.downcast::<PyString>() {

0 commit comments

Comments
 (0)