From 06259810f5a635f40d0dd183557b4bed5d12bc9c Mon Sep 17 00:00:00 2001 From: Heyuan Zeng Date: Mon, 11 Dec 2023 21:48:01 +0000 Subject: [PATCH] fix: python executable linking --- src/gapper/gradescope/resources/run_autograder | 2 +- src/gapper/gradescope/resources/setup.j2 | 3 +++ tests/test_zip_file_handle.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gapper/gradescope/resources/run_autograder b/src/gapper/gradescope/resources/run_autograder index 4cdad6e..015f79d 100644 --- a/src/gapper/gradescope/resources/run_autograder +++ b/src/gapper/gradescope/resources/run_autograder @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.12 +#!/usr/bin/env python3 from gapper.gradescope.main import run_autograder if __name__ == "__main__": diff --git a/src/gapper/gradescope/resources/setup.j2 b/src/gapper/gradescope/resources/setup.j2 index 5efcfc2..209207a 100644 --- a/src/gapper/gradescope/resources/setup.j2 +++ b/src/gapper/gradescope/resources/setup.j2 @@ -3,10 +3,13 @@ set -euo pipefail # install python {{ py_major }}.{{ py_minor }} +apt-get remove -y python3 +apt-get autoremove -y apt-get update -y apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get install -y python{{ py_major }}.{{ py_minor }} python{{ py_major }}.{{ py_minor }}-distutils +ln -s -f $(which python3.12) $(which python3) # install gapper curl -sS https://bootstrap.pypa.io/get-pip.py | python{{ py_major }}.{{ py_minor }} diff --git a/tests/test_zip_file_handle.py b/tests/test_zip_file_handle.py index 28d8fe5..3ff85bd 100644 --- a/tests/test_zip_file_handle.py +++ b/tests/test_zip_file_handle.py @@ -25,10 +25,13 @@ def test_zipping(tmp_path: Path) -> None: set -euo pipefail # install python {major}.{minor} + apt-get remove -y python3 + apt-get autoremove -y apt-get update -y apt-get install -y software-properties-common add-apt-repository -y ppa:deadsnakes/ppa apt-get install -y python{major}.{minor} python{major}.{minor}-distutils + ln -s -f $(which python3.12) $(which python3) # install gapper curl -sS https://bootstrap.pypa.io/get-pip.py | python{major}.{minor}