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

Introduce pyupgrade to remove py2 and < py3.6 related code #2986

Merged
merged 7 commits into from Jun 13, 2023

Conversation

thatlittleboy
Copy link
Collaborator

Overview

Description of the changes proposed in this pull request:

  • Added UP ruff checks during pre-commit and set minimum python version in setup.py. Note: I ran both asottile's pyupgrade and ruff's UP rule locally just to make sure we cover our bases.
  • Ran ruff --fix. This removed __future__ imports and switched to using f-string's for the most part. I visually inspected all the fixes and everything looks fine.
  • Removed the try-except block for urrlib.request, this module is present in stdlib since py3.
  • I also removed pylint and flake8 related config. We don't use these tools, and should be translated to corresponding ruff config, if necessary.

Checklist

  • All pre-commit checks pass.
  • Unit tests added (if fixing a bug or adding a new feature)
  • Added entry to CHANGELOG.md (if changes will affect users)

@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Merging #2986 (d105839) into master (c24ff9a) will decrease coverage by 0.03%.
The diff coverage is 61.90%.

@@            Coverage Diff             @@
##           master    #2986      +/-   ##
==========================================
- Coverage   54.75%   54.72%   -0.03%     
==========================================
  Files          90       90              
  Lines       12904    12887      -17     
==========================================
- Hits         7066     7053      -13     
+ Misses       5838     5834       -4     
Impacted Files Coverage Δ
shap/benchmark/experiments.py 0.00% <0.00%> (ø)
shap/benchmark/framework.py 0.00% <0.00%> (ø)
shap/benchmark/models.py 0.00% <0.00%> (ø)
shap/benchmark/plots.py 0.00% <0.00%> (ø)
shap/explainers/_additive.py 28.20% <0.00%> (ø)
shap/explainers/_deep/deep_pytorch.py 91.33% <0.00%> (ø)
shap/plots/_beeswarm.py 77.71% <ø> (-0.05%) ⬇️
shap/plots/_benchmark.py 4.80% <0.00%> (ø)
shap/plots/_decision.py 50.20% <0.00%> (-0.21%) ⬇️
shap/plots/_scatter.py 26.45% <ø> (-0.17%) ⬇️
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@connortann connortann left a comment

Choose a reason for hiding this comment

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

LGTM

@connortann connortann merged commit 918465d into master Jun 13, 2023
12 of 13 checks passed
@thatlittleboy thatlittleboy deleted the pyupgrade branch June 14, 2023 00:09
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.

None yet

2 participants