Skip to content

Commit

Permalink
Update test deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Dec 27, 2023
1 parent 443ae74 commit 68b0c40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exclude: |
)$
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.291"
rev: "v0.1.9"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -35,7 +35,7 @@ repos:
- prettier-plugin-toml
- prettier-plugin-sort-json
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -51,23 +51,23 @@ repos:
- id: debug-statements
language_version: python3
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
rev: v1.33.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.12.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.8.0
hooks:
- id: mypy
# empty args needed in order to match mypy cli behavior
Expand All @@ -84,7 +84,7 @@ repos:
- types-pkg_resources
- types-jsonschema>=4.4.9
- repo: https://github.com/pycqa/pylint
rev: v3.0.0b0
rev: v3.0.3
hooks:
- id: pylint
additional_dependencies:
Expand Down Expand Up @@ -117,4 +117,5 @@ repos:
rev: v1.2.0
hooks:
- id: validate-config-in-container
name: packit
alias: packit
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.ruff": false,
"source.organizeImports": false
"source.fixAll": "explicit",
"source.fixAll.ruff": "never",
"source.organizeImports": "never"
}
},
"editor.formatOnSave": true,
Expand Down
2 changes: 0 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ comment: false
coverage:
status:
patch: false
project:
threshold: 0.5%
13 changes: 8 additions & 5 deletions src/ansible_compat/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def install_collection(
if isinstance(collection, Path):
collection = str(collection)
# As ansible-galaxy install is not able to automatically determine
# if the range requires a pre-release, we need to manuall add the --pre
# if the range requires a pre-release, we need to manually add the --pre
# flag when needed.
matches = version_re.search(collection)

Expand Down Expand Up @@ -621,7 +621,7 @@ def prepare_environment( # noqa: C901
f"{destination}/ansible_collections/{colpath_from_path(Path.cwd())}",
)
if colpath.is_symlink():
if os.path.realpath(colpath) == Path.cwd():
if os.path.realpath(colpath) == str(Path.cwd()):
_logger.warning(
"Found symlinked collection, skipping its installation.",
)
Expand Down Expand Up @@ -741,7 +741,7 @@ def _prepare_ansible_paths(self) -> None:
msg = "Unexpected ansible configuration"
raise RuntimeError(msg) from exc

alterations_list = [
alterations_list: list[tuple[list[str], str, bool]] = [
(library_paths, "plugins/modules", True),
(roles_path, "roles", True),
]
Expand All @@ -762,7 +762,7 @@ def _prepare_ansible_paths(self) -> None:
if must_be_present:
continue
path.mkdir(parents=True, exist_ok=True)
if path not in path_list:
if str(path) not in path_list:
path_list.insert(0, str(path))

if library_paths != self.config.DEFAULT_MODULE_PATH:
Expand Down Expand Up @@ -910,7 +910,10 @@ def _get_galaxy_role_ns(galaxy_infos: dict[str, Any]) -> str:

def _get_galaxy_role_name(galaxy_infos: dict[str, Any]) -> str:
"""Compute role name from meta/main.yml."""
return galaxy_infos.get("role_name", "")
result = galaxy_infos.get("role_name", "")
if not isinstance(result, str):
return ""
return result


def search_galaxy_paths(search_dir: Path) -> list[str]:
Expand Down

0 comments on commit 68b0c40

Please sign in to comment.