Commit cfed86ee authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/py_ln_py3' into 'master'

fix: add python cmd if only python3 is present

See merge request to-be-continuous/python!151
parents 78b35c84 e6c8d7f9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -607,6 +607,17 @@ variables:
    fi
  }

  function enforce_python_cmd() {
    _p3=$(command -v python3)
    if [[ "$_p3" ]] && ! command -v python > /dev/null
    then
      _p3dir=$(dirname "$_p3")
      ln -s "$_p3" "$_p3dir/python"
      if [ -n "$TRACE" ]; then
        log_info "python3 symlinked to $_p3dir/python"
      fi
    fi
  }
  function guess_build_system() {
    _start_time=$(get_current_ts_ms)

@@ -1090,6 +1101,7 @@ stages:
  before_script:
    - !reference [.python-scripts]
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    - enforce_python_cmd
    - cd ${PYTHON_PROJECT_DIR}
    - guess_build_system