Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#142)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- https://github.com/pre-commit/mirrors-isorthttps://github.com/PyCQA/isort
- [github.com/PyCQA/isort: v5.9.3 → 5.9.3](PyCQA/isort@v5.9.3...5.9.3)
- https://github.com/python/black.githttps://github.com/psf/black
- [github.com/psf/black: 21.7b0 → 21.9b0](psf/black@21.7b0...21.9b0)
- https://gitlab.com/pycqa/flake8.githttps://github.com/PyCQA/flake8
- [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](PyCQA/flake8@3.9.2...4.0.1)
- [github.com/ansible/ansible-lint.git: v5.1.2 → v5.2.0](https://github.com/ansible/ansible-lint.git/compare/v5.1.2...v5.2.0)
- [github.com/pre-commit/mirrors-mypy: v0.910 → v0.910-1](pre-commit/mirrors-mypy@v0.910...v0.910-1)
- [github.com/PyCQA/pylint: v2.10.2 → v2.11.1](pylint-dev/pylint@v2.10.2...v2.11.1)

* Linting fixes

* Avoided lru_cache due mypy problems

python/mypy#5107

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and ssbarnea authored Jul 16, 2022
1 parent f4efce3 commit cfa2a75
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.2.0
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -41,8 +41,8 @@ repos:
- flake8-absolute-import>=1.0
- flake8-docstrings>=1.6.0
language_version: python3
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.0.2
- repo: https://github.com/ansible/ansible-lint.git
rev: v6.3.0
hooks:
- id: ansible-lint
always_run: true
Expand All @@ -52,7 +52,7 @@ repos:
- ansible-core>=2.11
- yamllint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v0.961
hooks:
- id: mypy
# empty args needed in order to match mypy cli behavior
Expand All @@ -65,7 +65,7 @@ repos:
- packaging
- types-requests
- repo: https://github.com/PyCQA/pylint
rev: v2.13.5
rev: v2.14.4
hooks:
- id: pylint
additional_dependencies:
Expand Down
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ disable =
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
abstract-method,
arguments-differ,
bad-continuation,
broad-except,
consider-merging-isinstance,
consider-using-in,
Expand Down
10 changes: 7 additions & 3 deletions src/molecule_docker/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import os
from typing import Dict

from ansible_compat.ports import cache
from molecule import logger
from molecule.api import Driver
from molecule.util import sysexit_with_message
Expand Down Expand Up @@ -183,6 +182,8 @@ class Docker(Driver):
.. _`CMD`: https://docs.docker.com/engine/reference/builder/#cmd
""" # noqa

_passed_sanity = False

def __init__(self, config=None):
"""Construct Docker."""
super(Docker, self).__init__(config)
Expand Down Expand Up @@ -224,11 +225,12 @@ def ansible_connection_options(self, instance_name):
x["ansible_docker_extra_args"] = f"-H={os.environ['DOCKER_HOST']}"
return x

@cache
def sanity_checks(self):
"""Implement Docker driver sanity checks."""
log.info("Sanity checks: '%s'", self._name)
if self._passed_sanity:
return

log.info("Sanity checks: '%s'", self._name)
try:
import docker
import requests
Expand All @@ -243,6 +245,8 @@ def sanity_checks(self):
)
sysexit_with_message(msg)

self._passed_sanity = True

def reset(self):
import docker

Expand Down

0 comments on commit cfa2a75

Please sign in to comment.