Skip to content

Isort might not find its metadata when run in pre-commit hooks #2362

Open
@imrehg

Description

@imrehg

I have some issues with running isort, and while debugging that, I've found that the tool also don't seem to know it's own version - and likely some other metadata or setup as well...

Using verison 6.0.0 as a pre-commit hook:

  - repo: https://github.com/PyCQA/isort
    rev: 6.0.0
    hooks:
      - id: isort
        args: ['-v']

and then running that hook directly pre-commit run isort -a with some files that need changing so we can actually have a failure and thus a printout:

isort....................................................................Failed
- hook id: isort
- files were modified by this hook

_                 _
                (_) ___  ___  _ __| |_
                | |/ _/ / _ \/ '__  _/
                | |\__ \/\_\/| |  | |_
                |_|\___/\___/\_/   \_/

      isort your imports, so you don't have to.

                    VERSION 0.1.dev1

If I run bare isort -vv ... or isort --version when installed the same version, then I get the proper 6.0.0.

Verison 5.13.2 was showing the correct info.

This might sound minor, but it might also mean it doesn't find other relevant information that can have side-effects on how isort is run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions