From 99da3425f924c01e122eb2768c6c48570bf7ce2d Mon Sep 17 00:00:00 2001 From: Muhammad Tayyab Tahir Qureshi Date: Mon, 21 Apr 2025 12:35:02 +0500 Subject: [PATCH 1/3] chore: add python 3.12 support - drop python support earlier than 3.11 - bump version --- .github/workflows/ci.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8f1cb9..6862d9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: matrix: os: - ubuntu-latest - python-version: ['3.8', '3.11', '3.12'] + python-version: ['3.11', '3.12'] steps: - uses: actions/checkout@v2 - name: setup python diff --git a/setup.py b/setup.py index 0129be5..f50b1f5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='xqueue_watcher', - version='0.3', + version='0.4', description='XQueue Pull Grader', packages=[ 'grader_support', From 6357ddf252b1bfc6fb2fbb0851e2b57065666206 Mon Sep 17 00:00:00 2001 From: Muhammad Tayyab Tahir Qureshi Date: Mon, 21 Apr 2025 14:16:53 +0500 Subject: [PATCH 2/3] chore: upgrade requirements --- requirements/base.txt | 22 +++++++------- requirements/ci.txt | 46 +++++++++++------------------ requirements/common_constraints.txt | 17 +++++------ requirements/pip.txt | 12 ++++---- requirements/pip_tools.txt | 20 ++++++------- requirements/production.txt | 19 ++++++------ requirements/test.txt | 41 +++++++++++-------------- 7 files changed, 81 insertions(+), 96 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 3729e47..6b91cc0 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,28 +1,30 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -e git+https://github.com/openedx/codejail.git@4127fc4bd5775cc72aee8d7f0a70e31405e22439#egg=codejail # via -r requirements/base.in -certifi==2022.12.7 +certifi==2025.1.31 # via requests -charset-normalizer==3.1.0 +charset-normalizer==3.4.1 # via requests dogstatsd-python==0.5.6 # via -r requirements/base.in -idna==3.4 +idna==3.10 # via requests -newrelic==8.7.0 +newrelic==10.9.0 # via -r requirements/base.in -path==16.6.0 +path==17.1.0 # via path-py path-py==12.5.0 # via -r requirements/base.in -requests==2.28.2 +requests==2.32.3 # via -r requirements/base.in -six==1.16.0 +six==1.17.0 # via -r requirements/base.in -urllib3==1.26.15 - # via requests +urllib3==2.2.3 + # via + # -c requirements/common_constraints.txt + # requests diff --git a/requirements/ci.txt b/requirements/ci.txt index ba49c94..70fd249 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,76 +1,64 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -e git+https://github.com/openedx/codejail.git@4127fc4bd5775cc72aee8d7f0a70e31405e22439#egg=codejail # via -r requirements/test.txt -attrs==22.2.0 - # via - # -r requirements/test.txt - # pytest -certifi==2022.12.7 +certifi==2025.1.31 # via # -r requirements/test.txt # requests -charset-normalizer==3.1.0 +charset-normalizer==3.4.1 # via # -r requirements/test.txt # requests -coverage[toml]==7.2.1 +coverage[toml]==7.8.0 # via # -r requirements/ci.in # -r requirements/test.txt # pytest-cov dogstatsd-python==0.5.6 # via -r requirements/test.txt -exceptiongroup==1.1.1 - # via - # -r requirements/test.txt - # pytest -idna==3.4 +idna==3.10 # via # -r requirements/test.txt # requests -iniconfig==2.0.0 +iniconfig==2.1.0 # via # -r requirements/test.txt # pytest -mock==5.0.1 +mock==5.2.0 # via -r requirements/test.txt -newrelic==8.7.0 +newrelic==10.9.0 # via -r requirements/test.txt -packaging==23.0 +packaging==25.0 # via # -r requirements/test.txt # pytest -path==16.6.0 +path==17.1.0 # via # -r requirements/test.txt # path-py path-py==12.5.0 # via -r requirements/test.txt -pluggy==1.0.0 +pluggy==1.5.0 # via # -r requirements/test.txt # pytest -pytest==7.2.2 +pytest==8.3.5 # via # -r requirements/test.txt # pytest-cov -pytest-cov==4.0.0 +pytest-cov==6.1.1 # via -r requirements/test.txt -requests==2.28.2 +requests==2.32.3 # via -r requirements/test.txt -six==1.16.0 +six==1.17.0 # via -r requirements/test.txt -tomli==2.0.1 - # via - # -r requirements/test.txt - # coverage - # pytest -urllib3==1.26.15 +urllib3==2.2.3 # via + # -c requirements/common_constraints.txt # -r requirements/test.txt # requests diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 7e39123..1511019 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -11,22 +11,21 @@ # Note: Changes to this file will automatically be used by other repos, referencing # this file from Github directly. It does not require packaging in edx-lint. - # using LTS django version -Django<4.0 +Django<5.0 # elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. # elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html +# See https://github.com/openedx/edx-platform/issues/35126 for more info elasticsearch<7.14.0 # django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected django-simple-history==3.0.0 -# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. -# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 -tox<4.0.0 +# Cause: https://github.com/openedx/edx-lint/issues/458 +# This can be unpinned once https://github.com/openedx/edx-lint/issues/459 has been resolved. +pip<24.3 -# edx-sphinx-theme is not compatible with latest Sphinx==6.0.0 version -# Pinning Sphinx version unless the compatibility issue gets resolved -# For details, see issue https://github.com/openedx/edx-sphinx-theme/issues/197 -sphinx<6.0.0 +# Cause: https://github.com/openedx/edx-lint/issues/475 +# This can be unpinned once https://github.com/openedx/edx-lint/issues/476 has been resolved. +urllib3<2.3.0 diff --git a/requirements/pip.txt b/requirements/pip.txt index 45fb600..6bb638b 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,14 +1,16 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -wheel==0.40.0 +wheel==0.45.1 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==23.0.1 - # via -r requirements/pip.in -setuptools==67.6.0 +pip==24.2 + # via + # -c requirements/common_constraints.txt + # -r requirements/pip.in +setuptools==79.0.0 # via -r requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 1570d1d..61561d7 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,22 +1,22 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -build==0.10.0 +build==1.2.2.post1 # via pip-tools -click==8.1.3 +click==8.1.8 # via pip-tools -packaging==23.0 +packaging==25.0 # via build -pip-tools==6.12.3 +pip-tools==7.4.1 # via -r requirements/pip_tools.in -pyproject-hooks==1.0.0 - # via build -tomli==2.0.1 - # via build -wheel==0.40.0 +pyproject-hooks==1.2.0 + # via + # build + # pip-tools +wheel==0.45.1 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/production.txt b/requirements/production.txt index 7b3f094..5bc444a 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,38 +1,39 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -e git+https://github.com/openedx/codejail.git@4127fc4bd5775cc72aee8d7f0a70e31405e22439#egg=codejail # via -r requirements/base.txt -certifi==2022.12.7 +certifi==2025.1.31 # via # -r requirements/base.txt # requests -charset-normalizer==3.1.0 +charset-normalizer==3.4.1 # via # -r requirements/base.txt # requests dogstatsd-python==0.5.6 # via -r requirements/base.txt -idna==3.4 +idna==3.10 # via # -r requirements/base.txt # requests -newrelic==8.7.0 +newrelic==10.9.0 # via -r requirements/base.txt -path==16.6.0 +path==17.1.0 # via # -r requirements/base.txt # path-py path-py==12.5.0 # via -r requirements/base.txt -requests==2.28.2 +requests==2.32.3 # via -r requirements/base.txt -six==1.16.0 +six==1.17.0 # via -r requirements/base.txt -urllib3==1.26.15 +urllib3==2.2.3 # via + # -c requirements/common_constraints.txt # -r requirements/base.txt # requests diff --git a/requirements/test.txt b/requirements/test.txt index 8179c75..f293a1a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,60 +1,53 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # make upgrade # -e git+https://github.com/openedx/codejail.git@4127fc4bd5775cc72aee8d7f0a70e31405e22439#egg=codejail # via -r requirements/production.txt -attrs==22.2.0 - # via pytest -certifi==2022.12.7 +certifi==2025.1.31 # via # -r requirements/production.txt # requests -charset-normalizer==3.1.0 +charset-normalizer==3.4.1 # via # -r requirements/production.txt # requests -coverage[toml]==7.2.1 +coverage[toml]==7.8.0 # via pytest-cov dogstatsd-python==0.5.6 # via -r requirements/production.txt -exceptiongroup==1.1.1 - # via pytest -idna==3.4 +idna==3.10 # via # -r requirements/production.txt # requests -iniconfig==2.0.0 +iniconfig==2.1.0 # via pytest -mock==5.0.1 +mock==5.2.0 # via -r requirements/test.in -newrelic==8.7.0 +newrelic==10.9.0 # via -r requirements/production.txt -packaging==23.0 +packaging==25.0 # via pytest -path==16.6.0 +path==17.1.0 # via # -r requirements/production.txt # path-py path-py==12.5.0 # via -r requirements/production.txt -pluggy==1.0.0 +pluggy==1.5.0 # via pytest -pytest==7.2.2 +pytest==8.3.5 # via pytest-cov -pytest-cov==4.0.0 +pytest-cov==6.1.1 # via -r requirements/test.in -requests==2.28.2 +requests==2.32.3 # via -r requirements/production.txt -six==1.16.0 +six==1.17.0 # via -r requirements/production.txt -tomli==2.0.1 - # via - # coverage - # pytest -urllib3==1.26.15 +urllib3==2.2.3 # via + # -c requirements/common_constraints.txt # -r requirements/production.txt # requests From b3fcc31ab229017bb81c682564dc097e9b3dc953 Mon Sep 17 00:00:00 2001 From: Muhammad Tayyab Tahir Qureshi Date: Mon, 28 Apr 2025 15:55:50 +0500 Subject: [PATCH 3/3] fix: fix --- .github/workflows/ci.yml | 4 ++-- xqueue_watcher/grader.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6862d9e..ba11cd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: - ubuntu-latest python-version: ['3.11', '3.12'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/xqueue_watcher/grader.py b/xqueue_watcher/grader.py index 7708e58..ed3744d 100644 --- a/xqueue_watcher/grader.py +++ b/xqueue_watcher/grader.py @@ -2,7 +2,7 @@ Implementation of a grader compatible with XServer """ import html -import sys +import os import time import json from path import Path @@ -130,7 +130,7 @@ def process_item(self, content, queue=None): self.log.debug(f"Processing submission, grader payload: {payload}") relative_grader_path = grader_config['grader'] - grader_path = (self.grader_root / relative_grader_path).abspath() + grader_path = os.path.abspath(self.grader_root / relative_grader_path) start = time.time() results = self.grade(grader_path, grader_config, student_response)