pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Pip: Temporary Failure in Name Resolution #80

Closed learnitall closed 3 years ago

learnitall commented 3 years ago

Hello! I have a question/concern about a recent CI run for our repo (can be found at https://results.pre-commit.ci/run/github/190794759/1629904875.ZfPbKKAGSqO4ZowEPRq5wQ). We're using the mypy hook and have enabled typing stubs to be automatically downloaded via pip, however we had the following errors crop up during the hook execution:

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

Installing missing stub packages:
/pc/clone/YrazQxi0S1yH44hGHdKFJg/py_env-python3/bin/python -m pip install types-PyYAML types-python-dateutil types-redis types-requests types-setuptools

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fdfdb70c850>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/types-pyyaml/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fdfdb70ca60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/types-pyyaml/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fdfdb70cc10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/types-pyyaml/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fdfdb70cdc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/types-pyyaml/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fdfdb70cf70>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/types-pyyaml/
ERROR: Could not find a version that satisfies the requirement types-PyYAML (from versions: none)
ERROR: No matching distribution found for types-PyYAML
...

From my perspective this seems to be an issue within the pre-commit CI environment because I can successfully do a fresh pre-commit run on my local dev machine:

[rydrew@redhat-worklp benchmark-wrapper]$ pre-commit clean
Cleaned /home/rydrew/.cache/pre-commit.
[rydrew@redhat-worklp benchmark-wrapper]$ pre-commit run --all
[INFO] Initializing environment for git://github.com/Lucas-C/pre-commit-hooks.
[INFO] Initializing environment for git://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://github.com/pycqa/isort.
[INFO] Initializing environment for https://gitlab.com/PyCQA/flake8.
[INFO] Initializing environment for https://gitlab.com/PyCQA/flake8:flake8-docstrings,pep8-naming.
[INFO] Initializing environment for https://github.com/PyCQA/pylint.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Installing environment for git://github.com/Lucas-C/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for git://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pycqa/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://gitlab.com/PyCQA/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/pyupgrade.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Tabs remover.............................................................Passed
Trim Trailing Whitespace.................................................Passed
Check for merge conflicts................................................Passed
Fix End of Files.........................................................Passed
Check for case conflicts.................................................Passed
Detect Private Key.......................................................Passed
Check python ast.........................................................Passed
black....................................................................Passed
isort....................................................................Passed
flake8...................................................................Passed
pylint...................................................................Passed
mypy.....................................................................Passed
pyupgrade................................................................Passed

Here is our pre-commit config:

[rydrew@redhat-worklp benchmark-wrapper]$ cat .pre-commit-config.yaml 
---
repos:
  - repo: git://github.com/Lucas-C/pre-commit-hooks
    rev: v1.1.10
    hooks:
      - id: remove-tabs

  - repo: git://github.com/pre-commit/pre-commit-hooks
    rev: v4.0.1
    hooks:
      - id: trailing-whitespace
      - id: check-merge-conflict
      - id: end-of-file-fixer
      - id: check-case-conflict
      - id: detect-private-key
      - id: check-ast

  - repo: https://github.com/psf/black
    rev: 21.7b0
    hooks:
      - id: black
        args: ['--line-length', '110']

  - repo: https://github.com/pycqa/isort
    rev: 5.9.2
    hooks:
      - id: isort
        args:
        - --profile=black
        - --color
        - --line-length=110

  - repo: https://gitlab.com/PyCQA/flake8
    rev: '3.9.2'
    hooks:
      - id: flake8
        additional_dependencies: ['pep8-naming', 'flake8-docstrings']

  - repo: https://github.com/PyCQA/pylint
    rev: v2.9.5
    hooks:
      - id: pylint

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.910
    hooks:
      - id: mypy
        args:
        - --ignore-missing-imports
        - --install-types
        - --non-interactive

  - repo: https://github.com/asottile/pyupgrade
    rev: v2.21.2
    hooks:
      - id: pyupgrade

ci:
    autofix_commit_msg: |
        [pre-commit.ci] auto fixes from pre-commit.com hooks

        for more information, see https://pre-commit.ci
    autofix_prs: true
    autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
    autoupdate_schedule: weekly
    skip: []
    submodules: false

Is this a temporary error within the CI? Or is there something on our end that we need to do? We've been using pre-commit CI for a couple weeks now and this is the first time an issue like this has cropped up. If this would be more appropriate to raise within the mypy hook repo, then let me know and I can move this over there.

Thanks!

asottile commented 3 years ago

duplicate of #47

note that you're using mypy in an unsupported configuration: https://github.com/pre-commit/mirrors-mypy/issues/50#issuecomment-859261537

learnitall commented 3 years ago

Ah I see, thank you!

asottile commented 3 years ago

also #69

learnitall commented 3 years ago

I appreciate your help- my apologies for not doing my research before raising an issue. I'll be more diligent next time.