Skip to content

change pyo3 as optional dependency in native Python Parser #598

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

Merged
merged 4 commits into from
Jan 16, 2022

Conversation

sehz
Copy link
Contributor

@sehz sehz commented Jan 12, 2022

@zsol great work on Python Parser. This makes it more accessible outside this project.

Summary

Native Rust parser has pyo3 as a mandatory dependency. Since I am only interested in Python Parser, I want to change to optional dependency to reduce compile and build complexity. With the change,pyo3 is still included as a default feature thus everything is the same as before.

Pyo3 related code changes (conversion) are segregated together.

Test Plan

The existing test plan should be sufficient since this is feature separation.

@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 Jan 12, 2022
Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks largely good, but I'd like to change two things before merging:

  1. let's run something in CI to make sure the crate isn't broken without the new feature (at least it should build)
  2. can we call the new feature py or python? Just in case later we decide to change pyo3 to something else

@sehz
Copy link
Contributor Author

sehz commented Jan 13, 2022

Thanks for the PR! Looks largely good, but I'd like to change two things before merging:

  1. let's run something in CI to make sure the crate isn't broken without the new feature (at least it should build)
  2. can we call the new feature py or python? Just in case later we decide to change pyo3 to something else

Done. Change to py feature flag

@sehz sehz requested a review from zsol January 13, 2022 16:59
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2022

Codecov Report

Merging #598 (a339051) into main (31ba5bf) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #598      +/-   ##
==========================================
+ Coverage   94.73%   94.76%   +0.03%     
==========================================
  Files         242      245       +3     
  Lines       24843    25038     +195     
==========================================
+ Hits        23534    23728     +194     
- Misses       1309     1310       +1     
Impacted Files Coverage Δ
libcst/tests/test_batched_visitor.py 100.00% <0.00%> (ø)
...emod/visitors/tests/test_apply_type_annotations.py 100.00% <0.00%> (ø)
libcst/tests/test_add_slots.py 100.00% <0.00%> (ø)
...demod/commands/tests/test_convert_type_comments.py 91.30% <0.00%> (ø)
libcst/codemod/commands/convert_type_comments.py 94.00% <0.00%> (ø)
libcst/_nodes/whitespace.py 98.94% <0.00%> (+0.01%) ⬆️
libcst/_nodes/statement.py 95.15% <0.00%> (+0.01%) ⬆️
libcst/_nodes/expression.py 96.78% <0.00%> (+0.03%) ⬆️
libcst/_nodes/op.py 95.73% <0.00%> (+0.07%) ⬆️
libcst/_nodes/base.py 95.48% <0.00%> (+0.07%) ⬆️
... 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 31ba5bf...a339051. Read the comment docs.

Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

looks good, thanks for the contribution

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