lektor / lektor-website

The main lektor website.
https://www.getlektor.com/
Other
160 stars 134 forks source link

Update install scripts for Python 3-only environments #202

Closed nixjdm closed 4 years ago

nixjdm commented 6 years ago

It was reported that some distros are no longer shipping with Python 3 ,and also we apparently were relying on Python 2 in our install scripts. We ought to handle both!

nixjdm commented 6 years ago

and 3 ought to be the default.

andoresuperesu commented 4 years ago

@nixjdm This is done, those seem like bs fixes, but i've tested both and comply with the minimum requirements. Please make clear if python2 compatibility is required or if a selection should be offered. Otherwise it is ready.

runfalk commented 4 years ago

I think we should support Python 2 only as long as we officially support Python 2. I guess that means one more release?

andoresuperesu commented 4 years ago

Ok I'll figure a way to test for both and pass the script to the right one. Another question @runfalk : in case both are installed (weird but possible) which should be prioritized? I'm guessing python3 should, right?

runfalk commented 4 years ago

I think having both is really common, at least it was very common in Linux distros until recently.

I think prioritizing Python 3 makes most sense since Python 2 is dying. I guess the check could be something like:

  if hash python3 2> /dev/null; then
    PYTHON_BIN="python3"
  elif hash python 2> /dev/null; then
    PYTHON_BIN="python"
  else
    echo "Error: To use this script you need to have Python installed"
    exit 1
  fi

  $PYTHON_BIN - <<'EOF'
andoresuperesu commented 4 years ago

I'll test and add to PR.

xlotlu commented 4 years ago

Closed in 1a059fa... sort of. The installer is now python, and works with 2 and 3. Hopefully the user decides to use 3, as suggested by the docs.