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

Add Ruff UP check #1946

Merged
merged 20 commits into from
Jun 30, 2023
Merged

Add Ruff UP check #1946

merged 20 commits into from
Jun 30, 2023

Conversation

adam-narozniak
Copy link
Member

@adam-narozniak adam-narozniak commented Jun 19, 2023

Issue

Description

The current code is not checked if the updates recommended for new Python versions were made.

Related issues/PRs

NA

Proposal

Add Ruff check implemented from pyupgrade.
Fix the UP008 Use super() instead of super(class, self)

@adam-narozniak adam-narozniak marked this pull request as ready for review June 19, 2023 12:58
@adam-narozniak adam-narozniak enabled auto-merge (squash) June 19, 2023 12:59
@adam-narozniak adam-narozniak enabled auto-merge (squash) June 19, 2023 13:02
@tanertopal
Copy link
Member

@adam-narozniak would this mean it will upgrade up to the target version or the latest version? The latest version would if I understand correctly break the target version compatibility.

@adam-narozniak
Copy link
Member Author

@tanertopal By setting the target version to py37 the roof tool checks for possible code updates up to Python 3.7 that come as a result of Python updates. It checks for the changes that were introduced in Python recommendations up to Python 3.7. It doesn't upgrade any code itself.
We can't use Python 3.11 as the target because we use features that are compatible with 3.7, and by having the higher target version, we would have to use features introduced later than in 3.7 e.g.

UP006 [*] Use `tuple` instead of `Tuple` for type annotation
B905 `zip()` without an explicit `strict=` parameter
UP007 [*] Use `X | Y` for type annotations

@adam-narozniak adam-narozniak merged commit 78151e9 into main Jun 30, 2023
@adam-narozniak adam-narozniak deleted the ruff-UP-check branch June 30, 2023 13:39
tanertopal added a commit that referenced this pull request Jul 5, 2023
* main:
  Remove line with typo from script (#2001)
  Fix simulation error caused by Pydantic version in Ray (#2002)
  Update mxnet examples dependency versions (#1982)
  Update torch version in pyproject.toml files (#1993)
  Update tensorflow examples dependency versions (#1984)
  Fix the baseline template docstrings (#1983)
  Fix Baselines CI PyLint error by using Resampling (#1998)
  Make tensorflow optional when using tensorboard (#1879)
  Update dependencies for MXNet example (#1988)
  Fix `starlette` vulnerability (#1992)
  Fix vulnerability detected by Dependabot (#1990)
  Fix dependabot critical errors (#1989)
  Add Ruff UP check (#1946)
  Update torch examples dependency versions (#1981)
  Remove && from the end of lines in test.sh (#1979)
  Baselines docs updates (#1977)
  Fixes GitHub CI issue because of behaviour change (#1976)
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.

3 participants