Commit cbcb7e27 authored by Ruben ten Hove's avatar Ruben ten Hove Committed by Federico Falconieri
Browse files

fix: better default for python outdated deps check (allowed failure by default, see #24)

parent f3ac1f55
Loading
Loading
Loading
Loading
+9 −16
Original line number Diff line number Diff line
@@ -4,23 +4,16 @@ python:pip:outdated:
  stage: test
  image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
  variables:
    CHECK_ALL: "false"  # Set to true if you also want to check packages such as pip, setuptools and dependencies of your dependencies
    EXTRA_ARGS: ""
  script:
    - echo "CHECK_ALL=${CHECK_ALL}"
    - OUTDATED="$(pip list --outdated --format freeze)"
    - |
      if "${CHECK_ALL}" = "true"; then
      OUTDATED="$(pip list --outdated --format freeze)"
      if [ ! -z "${OUTDATED}" ]; then
        echo "[!] Your image has outdated packages:"
          pip list --outdated
        pip list --outdated ${EXTRA_ARGS}
        echo "These may not all be dependencies of your package, but these are shipped in your Docker image. Consider updating all packages by default."
        echo "If it still fails after updating, you may have a package requiring an outdated dependency. You may then ignore this outdated package."
        exit 1
      fi
      else
        OUTDATED_NOT_REQUIRED="$(pip list --outdated --format freeze --not-required)"
        if [ ! -z "${OUTDATED_NOT_REQUIRED}" ]; then
          echo "[!] Your image has outdated packages:"
          pip list --outdated --not-required
          exit 1
        fi
      fi
    - echo "[+] Well done! You're up to date."
  allow_failure: true