diff --git a/.config/Containerfile b/.config/Dockerfile similarity index 74% rename from .config/Containerfile rename to .config/Dockerfile index 9ad7bebd..7483dc43 100644 --- a/.config/Containerfile +++ b/.config/Dockerfile @@ -3,3 +3,6 @@ FROM quay.io/ansible/creator-ee:v0.21.0 as DEFAULT_EE # version of creator-ee we are supposed to use for testing execution # environments but also to dynamically retrieve the same set of constraints # for testing outside execution environments. +# +# Do not rename this file to Containerfile due to +# https://github.com/dependabot/dependabot-core/issues/6067 diff --git a/.config/dictionary.txt b/.config/dictionary.txt index 6fafed4a..e9379439 100644 --- a/.config/dictionary.txt +++ b/.config/dictionary.txt @@ -1,4 +1,5 @@ Ansible +CFLAGS Containerfile Dpkg FQCN @@ -58,8 +59,10 @@ lineinfile linkcheck linkify loglevel +lssh lxml markdownlint +mkdocs monospace mycollection mymodule @@ -118,7 +121,6 @@ wordwrap workdir xvfb yammlint -mkdocs # names and usernames: Ganesh diff --git a/.github/workflows/task.yml b/.github/workflows/task.yml index a66afdbf..778b7369 100644 --- a/.github/workflows/task.yml +++ b/.github/workflows/task.yml @@ -120,7 +120,7 @@ jobs: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles( 'package.json', 'package-lock.json', - '.config/Containerfile' + '.config/Dockerfile' ) }} - name: Enable caching for podman-machine @@ -130,7 +130,7 @@ jobs: path: | ~/.local/share/containers ~/.config/containers - key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/Containerfile', '**/Taskfile.yml', 'tools/*.*') }} + key: ${{ runner.os }}-${{ matrix.task-name }}-${{ hashFiles('package.json', 'yarn.lock', '.config/Dockerfile', '**/Taskfile.yml', 'tools/*.*') }} - name: Install Task if: "!contains(matrix.shell, 'wsl')" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1b524e5..d89bdf2e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,6 +23,8 @@ repos: - id: shellcheck args: - --color=always + - -e + - SC1091 - repo: local hooks: - id: npm-ci @@ -52,7 +54,7 @@ repos: files: "codecov.yml" pass_filenames: false - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.2.1 + rev: v8.3.0 hooks: - id: cspell name: Spell check with cspell @@ -103,7 +105,7 @@ repos: docs/settings.md $ - repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.0.0-alpha.0 + rev: v9.0.0-alpha.1 hooks: - id: eslint args: diff --git a/tools/get-image-version b/tools/get-image-version index 8a754d88..7f60f01b 100755 --- a/tools/get-image-version +++ b/tools/get-image-version @@ -1,7 +1,7 @@ #!/usr/bin/env python3 version = "latest" # read image version from dockerfile -with open(".config/Containerfile", "r") as f: +with open(".config/Dockerfile", "r") as f: for line in f: if line.startswith("FROM"): version = line.split()[1].split()[0].split(":")[1] diff --git a/tools/test-setup.sh b/tools/test-setup.sh index c40f464b..afbe35c7 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -173,16 +173,32 @@ if [[ ! -d "${VIRTUAL_ENV}" ]]; then log notice "Creating virtualenv ..." python3 -m venv "${VIRTUAL_ENV}" fi -# shellcheck disable=SC1091 +# shellcheck source=/dev/null . "${VIRTUAL_ENV}/bin/activate" +if [[ "$(which python3)" != ${VIRTUAL_ENV}/bin/python3 ]]; then + log warning "Virtualenv broken, trying to recreate it ..." + python3 -m venv --clear "${VIRTUAL_ENV}" + . "${VIRTUAL_ENV}/bin/activate" + if [[ "$(which python3)" != ${VIRTUAL_ENV}/bin/python3 ]]; then + log error "Virtualenv still broken." + exit 99 + fi +fi log notice "Upgrading pip ..." + python3 -m pip install -q -U pip EE_VERSION=$(./tools/get-image-version) if [[ $(uname || true) != MINGW* ]]; then # if we are not on pure Windows URL="https://raw.githubusercontent.com/ansible/creator-ee/${EE_VERSION}/_build/requirements.txt" - log notice "Installing dependencies from .config/requirements.in and ${URL} loaded from .config/Containerfile ..." + log notice "Installing dependencies from .config/requirements.in and ${URL} loaded from .config/Dockerfile ..." + + if [[ "${OS:-}" == "darwin" ]]; then + log notice "MacOS detected, altering CFLAGS to avoid potential build failure due to https://github.com/ansible/pylibssh/issues/207 ..." + CFLAGS="-I $(brew --prefix)/include -I ext -L $(brew --prefix)/lib -lssh" + export CFLAGS + fi python3 -m pip install -r "${URL}" -r .config/requirements.in fi