Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump pyo3 to 0.17.1 #236

Merged
merged 9 commits into from Aug 30, 2022
Merged

bump pyo3 to 0.17.1 #236

merged 9 commits into from Aug 30, 2022

Conversation

PrettyWood
Copy link
Member

@PrettyWood PrettyWood commented Aug 24, 2022

fix #214

@samuelcolvin
Copy link
Member

Will do, currently fighting with v1.10.

src/input/datetime.rs Outdated Show resolved Hide resolved
cannot infer type of the type parameter `V` declared on the associated function `set_item`
the trait bound `&pyo3::PyAny: pyo3::IntoPy<pyo3::Py<PyString>>` is not satisfied
@PrettyWood PrettyWood changed the title bump pyo3 0.17.0 bump pyo3 to 0.17.1 Aug 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2022

Codecov Report

Merging #236 (e3e4f3f) into main (59babff) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   98.69%   98.65%   -0.04%     
==========================================
  Files          48       48              
  Lines        5042     4992      -50     
  Branches       35       35              
==========================================
- Hits         4976     4925      -51     
- Misses         66       67       +1     
Impacted Files Coverage Δ
src/errors/kinds.rs 99.15% <ø> (ø)
pydantic_core/_types.py 100.00% <100.00%> (ø)
src/input/datetime.rs 98.16% <100.00%> (+0.01%) ⬆️
src/input/input_json.rs 97.51% <100.00%> (ø)
src/input/input_python.rs 98.14% <100.00%> (-0.53%) ⬇️
src/lookup_key.rs 98.25% <100.00%> (-0.04%) ⬇️
src/validators/float.rs 98.90% <100.00%> (+0.13%) ⬆️
src/validators/typed_dict.rs 98.88% <100.00%> (-0.02%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72b9cad...e3e4f3f. Read the comment docs.

@PrettyWood PrettyWood marked this pull request as ready for review August 29, 2022 09:54
@PrettyWood
Copy link
Member Author

@samuelcolvin @davidhewitt This is ready for review but I feel like this is hacky. If you have a better way of doing it I'm all ears 🙏

Some(offset) => {
let tz_info = TzInfo::new(offset);
Some(Py::new(py, tz_info)?.to_object(py))
let obj = Py::new(py, tz_info)?.to_object(py);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the following might work for these three lines:

Suggested change
let obj = Py::new(py, tz_info)?.to_object(py);
Some(Py::new(py, tz_info)?.to_object(py).extract(py)?)

Will rely on type inference for .extract() to give you the &PyTzInfo.

I do think there's some missing API and documentation for PyO3 in this area, just haven't quite decided what the API should look like.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I first tried that but had issue with lifetime of variable since Py::new takes ownership of the pointer (hence my usage of from_borrowed_ptr instead. I fixed it in 8f09d8c

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @PrettyWood merge if you think this is done.

@PrettyWood PrettyWood merged commit 784c9e0 into pydantic:main Aug 30, 2022
@PrettyWood PrettyWood deleted the pyo3-0.17.0 branch August 30, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove _pyo3_dict.rs once pyo3 0.17 is out
4 participants