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

[Adjust Rule] missing case with SIM108 #176

Open
Borda opened this issue Apr 20, 2023 · 0 comments
Open

[Adjust Rule] missing case with SIM108 #176

Borda opened this issue Apr 20, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Borda
Copy link

Borda commented Apr 20, 2023

Desired change

  • Rule(s): SIM108
  • Adjustment: in the following case the issue was not recognised

Explanation

this was correctly recognized by ruff nut missing here so in combination with yesqa we had disproportion

Example

This is an example where the mentioned rule(s) would currently be suboptimal:
https://github.com/Lightning-AI/lightning/blob/8dac2512733bae034f437334a71e4c114d458a7c/src/lightning/pytorch/trainer/connectors/callback_connector.py#L229

    if _PYTHON_GREATER_EQUAL_3_8_0:
        from importlib.metadata import entry_points

        if _PYTHON_GREATER_EQUAL_3_10_0:  # <-- HERE
            factories = entry_points(group=group)
        else:
            factories = entry_points().get(group, {})  # type: ignore[arg-type]
    else:
        from pkg_resources import iter_entry_points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants