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

Fix binary operator mapping in setup.py ast parser #209

Merged
merged 9 commits into from
Mar 11, 2020
Merged

Conversation

techalchemy
Copy link
Member

- 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]>
@ghost
Copy link

ghost commented Mar 11, 2020

DeepCode's analysis on #14292e found:

  • 0 critical issues. ⚠️ 0 warnings and 8 minor issues. ✔️ 2 issues were fixed.

💬 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.


☺️ If you want to provide feedback on our bot, here is how to contact us.

@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #209 into master will decrease coverage by 1.12%.
The diff coverage is 55.35%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/requirementslib/models/dependencies.py 57.04% <31.25%> (+0.1%) ⬆️
src/requirementslib/models/requirements.py 59.19% <33.33%> (-2.23%) ⬇️
src/requirementslib/models/markers.py 70.7% <59.45%> (+0.36%) ⬆️
src/requirementslib/models/setup_info.py 67.11% <66.23%> (-0.78%) ⬇️
src/requirementslib/models/utils.py 61.93% <80%> (+0.33%) ⬆️
src/requirementslib/models/lockfile.py 65.62% <0%> (-2.34%) ⬇️
src/requirementslib/models/pipfile.py 78.19% <0%> (-1.63%) ⬇️
src/requirementslib/models/vcs.py 70% <0%> (-1.43%) ⬇️
... and 7 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 efcd987...14292e9. Read the comment docs.

@techalchemy techalchemy merged commit 392b028 into master Mar 11, 2020
@techalchemy techalchemy deleted the bugfix/204 branch March 11, 2020 23:25
techalchemy added a commit that referenced this pull request Mar 31, 2020
Fix binary operator mapping in setup.py ast parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant