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

Upgrade pyo3 to 0.22 #1180

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Upgrade pyo3 to 0.22 #1180

wants to merge 2 commits into from

Conversation

jelmer
Copy link

@jelmer jelmer commented Jul 30, 2024

Summary

This updates PyO3 to version 0.22, and adapt to the new APIs.

Test Plan

cd native && cargo test

@facebook-github-bot
Copy link

Hi @jelmer!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 30, 2024
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.26%. Comparing base (b0d145d) to head (03ca796).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1180   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files         261      261           
  Lines       26883    26883           
=======================================
  Hits        24535    24535           
  Misses       2348     2348           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zsol
Copy link
Member

zsol commented Aug 4, 2024

This looks good to me, thanks! I need some time before I can merge this to figure out what other things need upgrading to 0.22 internally at Meta

@mcepl
Copy link

mcepl commented Sep 9, 2024

When trying to build with this patch (and after refreshing vendor/ directory) I get this:

   Compiling libcst v1.4.0 (/tmp/libcst-1.4.0/native/libcst)
warning: unused imports: `DeflatedAsynchronous as Asynchronous` and `DeflatedFormattedStringText as FormattedStringText`
  --> libcst/src/nodes/mod.rs:55:29
   |
55 |         DeflatedArg as Arg, DeflatedAsynchronous as Asynchronous, DeflatedAttribute as Attribute,
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
66 |         DeflatedFormattedStringText as FormattedStringText, DeflatedFrom as From,
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `DeflatedImportStar as ImportStar`
  --> libcst/src/nodes/mod.rs:89:9
   |
89 |         DeflatedImportStar as ImportStar, DeflatedSemicolon as Semicolon,
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated constant `py::libcst_native::__pyfunction_parse_module::SIGNATURE`: this function has implicit defaults for the trailing `Option<T>` arguments 
         = note: these implicit defaults are being phased out 
         = help: add `#[pyo3(signature = (source, encoding=None))]` to this function to silence this warning and keep the current behavior
  --> libcst/src/py.rs:13:8
   |
13 |     fn parse_module(source: String, encoding: Option<&str>) -> PyResult<PyObject> {
   |        ^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: field `string_start` is never read
  --> libcst/src/tokenizer/core/string_types.rs:74:9
   |
70 | pub struct FStringNode {
   |            ----------- field in this struct
...
74 |     pub string_start: Option<TextPositionSnapshot>,
   |         ^^^^^^^^^^^^
   |
   = note: `FStringNode` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: struct `Details` is never constructed
  --> libcst/src/parser/errors.rs:36:12
   |
36 |     struct Details {
   |            ^^^^^^^

warning: `libcst` (lib) generated 5 warnings (run `cargo fix --lib -p libcst` to apply 2 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 19.84s

Newer versions of pyo3 warn about missing signatures
@jelmer
Copy link
Author

jelmer commented Sep 9, 2024

I've fixed the signature warning and have rebased to resolve merge conflicts.

@mcepl the other warnings you're listing happen in "main" for me as well, they're not specific to this branch.

@mcepl
Copy link

mcepl commented Sep 9, 2024

Thank you, I will update the patch.

It is weirdly nice to meet old acquaintance. So, Instagram?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants