feat: adding Python 3.12 support for Xqueue (#30)

This commit is contained in:
Jhony Avella 2024-05-03 09:00:16 -05:00 committed by GitHub
parent fe3742a0f0
commit 5db7addac8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 23 deletions

View File

@ -7,12 +7,15 @@ on:
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.12']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Python 3.8 - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: 3.8 python-version: ${{ matrix.python-version }}
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install --upgrade pip setuptools run: python -m pip install --upgrade pip setuptools
- name: Install dependencies - name: Install dependencies

View File

@ -146,21 +146,19 @@ def grade_submission(
print_result( print_result(
context, context,
"grade_submission", "grade_submission",
( submission_id,
submission_id, submission_key,
submission_key, grade,
grade, correct,
correct, message,
message,
),
) )
def print_result( def print_result(
context: click.Context, context: click.Context,
client_func_name: str, client_func_name: str,
*args: tuple[Any, ...], *args: Any,
**kwargs: dict[str, Any], **kwargs: Any,
) -> None: ) -> None:
user_config = tutor_config.load(context.root) # type: ignore user_config = tutor_config.load(context.root) # type: ignore
client = Client(user_config, url=context.url) # type: ignore client = Client(user_config, url=context.url) # type: ignore

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.4 # syntax=docker/dockerfile:1.4
###### Minimal image with base system requirements for most stages ###### ###### Minimal image with base system requirements for most stages ######
FROM docker.io/ubuntu:20.04 as minimal FROM docker.io/python:3.12-slim-bookworm
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
@ -8,19 +8,21 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt update && \ apt update && \
apt upgrade -y && \ apt upgrade -y && \
apt install -y \ apt install -y \
language-pack-en \ locales \
git \ git \
python3 \ python3-dev \
python3-pip \ build-essential \
python3-venv \ default-libmysqlclient-dev \
libmysqlclient-dev \ pkg-config && \
pkg-config sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
RUN ln -s /usr/bin/python3 /usr/bin/python locale-gen
ENV LC_ALL en_US.UTF-8
###### Git-clone xqueue repo ###### ###### Git-clone xqueue repo ######
ARG APP_USER_ID=1000 ARG APP_USER_ID=1000
RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app
USER ${APP_USER_ID} USER ${APP_USER_ID}
RUN git clone {{ XQUEUE_REPOSITORY }} --branch {{ XQUEUE_REPOSITORY_VERSION }} --depth 1 /openedx/xqueue RUN git clone {{ XQUEUE_REPOSITORY }} --branch {{ XQUEUE_REPOSITORY_VERSION }} --depth 1 /openedx/xqueue
WORKDIR /openedx/xqueue WORKDIR /openedx/xqueue
@ -30,9 +32,9 @@ ENV PATH /openedx/venv/bin:${PATH}
# https://pypi.org/project/setuptools/ # https://pypi.org/project/setuptools/
# https://pypi.org/project/pip/ # https://pypi.org/project/pip/
# https://pypi.org/project/wheel/ # https://pypi.org/project/wheel/
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install setuptools==68.2.2 pip==23.2.1. wheel==0.41.2 RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install setuptools==69.2.0 pip==24.0 wheel==0.43.0
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install -r requirements.txt RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install -r requirements.txt
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install uwsgi==2.0.22 RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install uwsgi==2.0.25.1
RUN mkdir /openedx/data /openedx/data/media RUN mkdir /openedx/data /openedx/data/media