-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix binary operator mapping in setup.py ast parser #209
Conversation
- Assorted additional optimizations around `pip_shims` invocations for tests to pass Signed-off-by: Dan Ryan <[email protected]>
- Fix bugs related to previous marker complexity reduction Signed-off-by: Dan Ryan <[email protected]>
- Fix handling of `ast.binOp` nodes during unmapping of `setup.py` files when parsing -- add mapping for all binary operators and execute translated functions using the unparsed left and right hand sides of the binary operator - Add equivalent handling for `ast.Compare` types - Add `importlib.import_module` attempts to `ast.Compare` evaluations when encountering `ast.Attribute` types on either side of the comparison - Add handling for `ast.IfExp` type to evaluate truth values of the expression and return `node.body` if the expression is `True`, otherwise `node.orelse` - Add equivalence mapping for `ast.Ellipsis` type which becomes `ast.Constant` in python `>= 3.8` - Fixes #204 - Fixes #206 - Fixes #207 Signed-off-by: Dan Ryan <[email protected]>
- Add AST tests Signed-off-by: Dan Ryan <[email protected]>
DeepCode's analysis on #14292e found:
💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues. |
Signed-off-by: Dan Ryan <[email protected]>
Signed-off-by: Dan Ryan <[email protected]>
Signed-off-by: Dan Ryan <[email protected]>
Signed-off-by: Dan Ryan <[email protected]>
Signed-off-by: Dan Ryan <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #209 +/- ##
==========================================
- Coverage 63.21% 62.09% -1.13%
==========================================
Files 13 13
Lines 5516 5345 -171
Branches 1339 1345 +6
==========================================
- Hits 3487 3319 -168
+ Misses 1578 1576 -2
+ Partials 451 450 -1
Continue to review full report at Codecov.
|
Fix binary operator mapping in setup.py ast parser
ast.binOp
nodes during unmapping ofsetup.py
files when parsing -- add mapping for all binary operators and execute translated functions using the unparsed left and right hand sides of the binary operatorast.Compare
typesimportlib.import_module
attempts toast.Compare
evaluations when encounteringast.Attribute
types on either side of the comparisonast.IfExp
type to evaluate truth values of the expression and returnnode.body
if the expression isTrue
, otherwisenode.orelse
ast.Ellipsis
type which becomesast.Constant
in python>= 3.8
pip_shims
invocations for tests to pass