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

Testing: Linting, Add pyupgrade and fix isort #6587

Merged
merged 13 commits into from Mar 21, 2024

Commits on Mar 20, 2024

  1. Copy the full SHA
    be0ed2c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    bdf4e0b View commit details
    Browse the repository at this point in the history
  3. Testing: pyupgrade, remove unnecessary object inheritance; rucio#6538

    Since Python 3, all classes inherit from object by default,
    so object can be omitted from the list of base classes.
    
    See also:
    - https://docs.astral.sh/ruff/rules/useless-object-inheritance/
    - https://peps.python.org/pep-3115/
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    bd488c6 View commit details
    Browse the repository at this point in the history
  4. Testing: pyupgrade, replace exceptions that alias to OSError; rucio#6538

    
    
    In Python3.3+, a variety of exceptions (such as IOError) were aliased
    to OSError, with the latter being the preferred exception to use.
    
    See also:
    - https://docs.python.org/3/library/exceptions.html#OSError
    - https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror
    - https://docs.astral.sh/ruff/rules/os-error-alias/
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    a5e36a5 View commit details
    Browse the repository at this point in the history
  5. Testing: Remove extra parentheses when not needed; rucio#6538

    See also:
    - UP034
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    6166841 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    ca0f28e View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    ea1bdda View commit details
    Browse the repository at this point in the history
  8. Testing: Remove unnecessary encode to utf-8; rucio#6538

    UTF-8 is the default encoding in Python,
    so there is no need to call encode when UTF-8 is the desired encoding.
    Instead, use a bytes literal.
    
    See also:
    - https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8/
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    e745498 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    b6e266e View commit details
    Browse the repository at this point in the history
  10. Testing: Add pyupgrade linting; rucio#6538

    Pyupgrade is a linter to check for deprecated Python syntax.
    This commit configures ruff to perform pyupgrade linting.
    In the ignore list, I added some pyupgrade error codes (UP*) for the
    moment.
    These must either be fixed manually, or might be controversial in some
    way, so we can consider them at a later point.
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    26acb47 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    42ab87f View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    954c78a View commit details
    Browse the repository at this point in the history
  13. Mark rucio as first-party dependency for isort and re-sort imports; r…

    …ucio#6538
    
    rucio is detected as a third-party dependency by default
    (likely has to do with the project structure or __init__ files).
    This change configures isort to treat rucio as a first-party dependency,
    and re-formats the files.
    rdimaio committed Mar 20, 2024
    Copy the full SHA
    dd0e68e View commit details
    Browse the repository at this point in the history