Skip to content

Flake8 pre-commit dependency has moved #2374

@ruben-chainalysis

Description

@ruben-chainalysis

Flake8 has moved to GitHub and this breaks the pre-commit hook using the now 404 Gitlab URL.

Running tox -e lint locally gives an error like the following:

[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.
An unexpected error has occurred: CalledProcessError: command: ('/thisiswhereyourbinis/bin/git', 'fetch', 'origin', '--tags')
return code: 128
expected return code: 0
stdout: (none)
stderr:
    remote: The project you were looking for could not be found or you don't have permission to view it.
    fatal: repository 'https://gitlab.com/pycqa/flake8.git/' not found

Check the log at /yourcacheplace/pre-commit/pre-commit.log
ERROR: InvocationError for command /yourProjectPath/PyGithub/.tox/lint/bin/pre-commit run --all-files --show-diff-on-failure (exited with code 3)
_________________________________________________________________________________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________________________________________________________________________________
ERROR:   lint: commands failed

CI pipelines are breaking too with the following error:

[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.
  An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')
  return code: 128
  expected return code: 0
  stdout: (none)
  stderr:
      fatal: could not read Username for 'https://gitlab.com/': No such device or address
      
  Check the log at /home/runner/.cache/pre-commit/pre-commit.log
  Error: ERROR: InvocationError for command /home/runner/work/PyGithub/PyGithub/.tox/lint/bin/pre-commit run --all-files --show-diff-on-failure (exited with code 3)
py38 create: /home/runner/work/PyGithub/PyGithub/.tox/py38

It's a quick fix, easier than creating this issue, but I'm creating it because it's the first place I look for problems and others might benefit from it. Will submit PR in a minute.

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