diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b51b9a8..bd6bbc48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.12' && matrix.toxenv=='django42-drf314' + if: matrix.python-version == '3.12' && matrix.toxenv=='django42-drflatest' uses: codecov/codecov-action@v4 with: flags: unittests diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2f0189d9..b0944fa8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,9 +12,9 @@ sphinx: # Set the version of python needed to build these docs. build: - os: "ubuntu-22.04" + os: "ubuntu-lts-latest" tools: - python: "3.8" + python: "3.12" # Optionally install extra requirements required to build your docs python: diff --git a/Makefile b/Makefile index 16b3df19..e8d0552a 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,8 @@ clean: ## Remove generated byte code, coverage reports, and build artifacts rm -fr dist/ rm -fr *.egg-info -docs: ## generate Sphinx HTML documentation - python setup.py build_sphinx +docs-html: ## generate Sphinx HTML documentation + make -C docs html dev_requirements: ## Install Dev Requirements pip install -qr requirements/pip.txt diff --git a/docs/source/conf.py b/docs/source/conf.py index a4b4b2a5..301155f2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -300,3 +300,14 @@ # directory. html_logo = "https://logos.openedx.org/open-edx-logo-color.png" html_favicon = "https://logos.openedx.org/open-edx-favicon.ico" + + +# -- Read the Docs Specific Configuration +# Define the canonical URL if you are using a custom domain on Read the Docs +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True diff --git a/requirements/base.txt b/requirements/base.txt index 7293af94..a3ac5414 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,16 +1,11 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # asgiref==3.8.1 # via django -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # django - # djangorestframework django==4.2.16 # via # -c requirements/common_constraints.txt @@ -35,5 +30,3 @@ six==1.16.0 # via edx-django-release-util sqlparse==0.5.1 # via django -typing-extensions==4.12.2 - # via asgiref diff --git a/requirements/ci.txt b/requirements/ci.txt index 2036e872..363022e4 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -30,19 +30,19 @@ distlib==0.3.8 # virtualenv docopt==0.6.2 # via coveralls -filelock==3.16.0 +filelock==3.16.1 # via # -r requirements/tox.txt # tox # virtualenv -idna==3.8 +idna==3.10 # via requests packaging==24.1 # via # -r requirements/tox.txt # pyproject-api # tox -platformdirs==4.3.2 +platformdirs==4.3.6 # via # -r requirements/tox.txt # tox @@ -51,23 +51,17 @@ pluggy==1.5.0 # via # -r requirements/tox.txt # tox -pyproject-api==1.7.1 +pyproject-api==1.8.0 # via # -r requirements/tox.txt # tox requests==2.32.3 # via coveralls -tomli==2.0.1 - # via - # -r requirements/tox.txt - # coverage - # pyproject-api - # tox -tox==4.18.1 +tox==4.20.0 # via -r requirements/tox.txt urllib3==2.2.3 # via requests -virtualenv==20.26.4 +virtualenv==20.26.5 # via # -r requirements/tox.txt # tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 763bf2e4..66c23afb 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,15 +1,15 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -accessible-pygments==0.0.4 +accessible-pygments==0.0.5 # via # -r requirements/docs.txt # -r requirements/test.txt # pydata-sphinx-theme -alabaster==0.7.13 +alabaster==1.0.0 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -20,7 +20,7 @@ asgiref==3.8.1 # -r requirements/docs.txt # -r requirements/test.txt # django -astroid==3.2.4 +astroid==3.3.4 # via # -r requirements/test.txt # pylint @@ -31,14 +31,6 @@ babel==2.16.0 # -r requirements/test.txt # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/base.txt - # -r requirements/docs.txt - # -r requirements/test.txt - # django - # djangorestframework beautifulsoup4==4.12.3 # via # -r requirements/docs.txt @@ -98,7 +90,7 @@ djangorestframework==3.15.2 # -r requirements/base.txt # -r requirements/docs.txt # -r requirements/test.txt -docutils==0.19 +docutils==0.21.2 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -113,19 +105,15 @@ edx-lint==5.3.7 # via # -c requirements/constraints.txt # -r requirements/test.txt -exceptiongroup==1.2.2 - # via - # -r requirements/test.txt - # pytest factory-boy==3.3.1 # via -r requirements/test.txt -faker==28.4.1 +faker==30.0.0 # via # -r requirements/test.txt # factory-boy freezegun==1.5.1 # via -r requirements/test.txt -idna==3.8 +idna==3.10 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -135,11 +123,6 @@ imagesize==1.4.1 # -r requirements/docs.txt # -r requirements/test.txt # sphinx -importlib-metadata==8.5.0 - # via - # -r requirements/docs.txt - # -r requirements/test.txt - # sphinx iniconfig==2.0.0 # via # -r requirements/test.txt @@ -181,7 +164,7 @@ pbr==6.1.0 # via # -r requirements/test.txt # stevedore -platformdirs==4.3.2 +platformdirs==4.3.6 # via # -r requirements/test.txt # pylint @@ -196,7 +179,7 @@ pockets==0.9.1 # sphinxcontrib-napoleon pycodestyle==2.12.1 # via -r requirements/test.txt -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.4 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -208,7 +191,7 @@ pygments==2.18.0 # accessible-pygments # pydata-sphinx-theme # sphinx -pylint==3.2.7 +pylint==3.3.1 # via # -r requirements/test.txt # edx-lint @@ -251,7 +234,6 @@ pytz==2024.2 # -r requirements/base.txt # -r requirements/docs.txt # -r requirements/test.txt - # babel pyyaml==6.0.2 # via # -r requirements/base.txt @@ -284,27 +266,27 @@ soupsieve==2.6 # -r requirements/docs.txt # -r requirements/test.txt # beautifulsoup4 -sphinx==6.2.1 +sphinx==8.0.2 # via # -r requirements/docs.txt # -r requirements/test.txt # pydata-sphinx-theme # sphinx-book-theme -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.3 # via # -r requirements/docs.txt # -r requirements/test.txt -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==2.0.0 # via # -r requirements/docs.txt # -r requirements/test.txt # sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==2.0.0 # via # -r requirements/docs.txt # -r requirements/test.txt # sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.1.0 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -318,12 +300,12 @@ sphinxcontrib-napoleon==0.7 # via # -r requirements/docs.txt # -r requirements/test.txt -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==2.0.0 # via # -r requirements/docs.txt # -r requirements/test.txt # sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==2.0.0 # via # -r requirements/docs.txt # -r requirements/test.txt @@ -342,32 +324,17 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # coverage - # pylint - # pytest tomlkit==0.13.2 # via # -r requirements/test.txt # pylint typing-extensions==4.12.2 # via - # -r requirements/base.txt # -r requirements/docs.txt # -r requirements/test.txt - # asgiref - # astroid # pydata-sphinx-theme - # pylint urllib3==2.2.3 # via # -r requirements/docs.txt # -r requirements/test.txt # requests -zipp==3.20.1 - # via - # -r requirements/docs.txt - # -r requirements/test.txt - # importlib-metadata diff --git a/requirements/docs.txt b/requirements/docs.txt index ccb85012..b140af46 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,12 +1,12 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -accessible-pygments==0.0.4 +accessible-pygments==0.0.5 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==1.0.0 # via sphinx asgiref==3.8.1 # via @@ -16,12 +16,6 @@ babel==2.16.0 # via # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/base.txt - # django - # djangorestframework beautifulsoup4==4.12.3 # via pydata-sphinx-theme certifi==2024.8.30 @@ -40,18 +34,16 @@ django-model-utils==5.0.0 # via -r requirements/base.txt djangorestframework==3.15.2 # via -r requirements/base.txt -docutils==0.19 +docutils==0.21.2 # via # pydata-sphinx-theme # sphinx edx-django-release-util==1.4.0 # via -r requirements/base.txt -idna==3.8 +idna==3.10 # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==8.5.0 - # via sphinx jinja2==3.1.4 # via sphinx jsonfield==3.1.0 @@ -64,7 +56,7 @@ packaging==24.1 # sphinx pockets==0.9.1 # via sphinxcontrib-napoleon -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.4 # via sphinx-book-theme pygments==2.18.0 # via @@ -72,9 +64,7 @@ pygments==2.18.0 # pydata-sphinx-theme # sphinx pytz==2024.2 - # via - # -r requirements/base.txt - # babel + # via -r requirements/base.txt pyyaml==6.0.2 # via # -r requirements/base.txt @@ -91,37 +81,32 @@ snowballstemmer==2.2.0 # via sphinx soupsieve==2.6 # via beautifulsoup4 -sphinx==6.2.1 +sphinx==8.0.2 # via # -r requirements/docs.in # pydata-sphinx-theme # sphinx-book-theme -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.3 # via -r requirements/docs.in -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==2.0.0 # via sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==2.0.0 # via sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.1.0 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-napoleon==0.7 # via -r requirements/docs.in -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==2.0.0 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==2.0.0 # via sphinx sqlparse==0.5.1 # via # -r requirements/base.txt # django typing-extensions==4.12.2 - # via - # -r requirements/base.txt - # asgiref - # pydata-sphinx-theme + # via pydata-sphinx-theme urllib3==2.2.3 # via requests -zipp==3.20.1 - # via importlib-metadata diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 937428a2..e6268ff6 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -8,8 +8,6 @@ build==1.2.2 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==8.5.0 - # via build packaging==24.1 # via build pip-tools==7.4.1 @@ -18,14 +16,8 @@ pyproject-hooks==1.1.0 # via # build # pip-tools -tomli==2.0.1 - # via - # build - # pip-tools wheel==0.44.0 # via pip-tools -zipp==3.20.1 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 08e7022d..488d41f8 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -10,5 +10,5 @@ wheel==0.44.0 # The following packages are considered to be unsafe in a requirements file: pip==24.2 # via -r requirements/pip.in -setuptools==74.1.2 +setuptools==75.1.0 # via -r requirements/pip.in diff --git a/requirements/test.txt b/requirements/test.txt index 8cf00aff..86b36766 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # -accessible-pygments==0.0.4 +accessible-pygments==0.0.5 # via # -r requirements/docs.txt # pydata-sphinx-theme -alabaster==0.7.13 +alabaster==1.0.0 # via # -r requirements/docs.txt # sphinx @@ -17,7 +17,7 @@ asgiref==3.8.1 # -r requirements/base.txt # -r requirements/docs.txt # django -astroid==3.2.4 +astroid==3.3.4 # via # pylint # pylint-celery @@ -26,13 +26,6 @@ babel==2.16.0 # -r requirements/docs.txt # pydata-sphinx-theme # sphinx -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/base.txt - # -r requirements/docs.txt - # django - # djangorestframework beautifulsoup4==4.12.3 # via # -r requirements/docs.txt @@ -75,7 +68,7 @@ django-model-utils==5.0.0 # via # -r requirements/base.txt # -r requirements/docs.txt -docutils==0.19 +docutils==0.21.2 # via # -r requirements/docs.txt # pydata-sphinx-theme @@ -88,15 +81,13 @@ edx-lint==5.3.7 # via # -c requirements/constraints.txt # -r requirements/test.in -exceptiongroup==1.2.2 - # via pytest factory-boy==3.3.1 # via -r requirements/test.in -faker==28.4.1 +faker==30.0.0 # via factory-boy freezegun==1.5.1 # via -r requirements/test.in -idna==3.8 +idna==3.10 # via # -r requirements/docs.txt # requests @@ -104,10 +95,6 @@ imagesize==1.4.1 # via # -r requirements/docs.txt # sphinx -importlib-metadata==8.5.0 - # via - # -r requirements/docs.txt - # sphinx iniconfig==2.0.0 # via pytest isort==5.13.2 @@ -139,7 +126,7 @@ packaging==24.1 # sphinx pbr==6.1.0 # via stevedore -platformdirs==4.3.2 +platformdirs==4.3.6 # via pylint pluggy==1.5.0 # via pytest @@ -149,7 +136,7 @@ pockets==0.9.1 # sphinxcontrib-napoleon pycodestyle==2.12.1 # via -r requirements/test.in -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.4 # via # -r requirements/docs.txt # sphinx-book-theme @@ -159,7 +146,7 @@ pygments==2.18.0 # accessible-pygments # pydata-sphinx-theme # sphinx -pylint==3.2.7 +pylint==3.3.1 # via # edx-lint # pylint-celery @@ -192,7 +179,6 @@ pytz==2024.2 # via # -r requirements/base.txt # -r requirements/docs.txt - # babel pyyaml==6.0.2 # via # -r requirements/base.txt @@ -220,22 +206,22 @@ soupsieve==2.6 # via # -r requirements/docs.txt # beautifulsoup4 -sphinx==6.2.1 +sphinx==8.0.2 # via # -r requirements/docs.txt # pydata-sphinx-theme # sphinx-book-theme -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.3 # via -r requirements/docs.txt -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==2.0.0 # via # -r requirements/docs.txt # sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==2.0.0 # via # -r requirements/docs.txt # sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.1.0 # via # -r requirements/docs.txt # sphinx @@ -245,11 +231,11 @@ sphinxcontrib-jsmath==1.0.1 # sphinx sphinxcontrib-napoleon==0.7 # via -r requirements/docs.txt -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==2.0.0 # via # -r requirements/docs.txt # sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==2.0.0 # via # -r requirements/docs.txt # sphinx @@ -262,26 +248,13 @@ stevedore==5.3.0 # via code-annotations text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # coverage - # pylint - # pytest tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via - # -r requirements/base.txt # -r requirements/docs.txt - # asgiref - # astroid # pydata-sphinx-theme - # pylint urllib3==2.2.3 # via # -r requirements/docs.txt # requests -zipp==3.20.1 - # via - # -r requirements/docs.txt - # importlib-metadata diff --git a/requirements/tox.txt b/requirements/tox.txt index d007f386..e34a1b78 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -12,7 +12,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.16.0 +filelock==3.16.1 # via # tox # virtualenv @@ -20,19 +20,15 @@ packaging==24.1 # via # pyproject-api # tox -platformdirs==4.3.2 +platformdirs==4.3.6 # via # tox # virtualenv pluggy==1.5.0 # via tox -pyproject-api==1.7.1 +pyproject-api==1.8.0 # via tox -tomli==2.0.1 - # via - # pyproject-api - # tox -tox==4.18.1 +tox==4.20.0 # via -r requirements/tox.in -virtualenv==20.26.4 +virtualenv==20.26.5 # via tox diff --git a/submissions/__init__.py b/submissions/__init__.py index d50c9bd8..745c2bc1 100644 --- a/submissions/__init__.py +++ b/submissions/__init__.py @@ -1,2 +1,2 @@ """ API for creating submissions and scores. """ -__version__ = '3.8.0' +__version__ = '3.8.1' diff --git a/submissions/api.py b/submissions/api.py index 1be2a84f..2c5c0564 100644 --- a/submissions/api.py +++ b/submissions/api.py @@ -486,6 +486,7 @@ def get_all_course_submission_information(course_id, item_type, read_replica=Tru ) +# pylint: disable=too-many-positional-arguments def get_top_submissions(course_id, item_id, item_type, number_of_top_scores, use_cache=True, read_replica=True): """ Get a number of top scores for an assessment based on a particular student item @@ -807,6 +808,7 @@ def reset_score(student_id, course_id, item_id, clear_state=False, emit_signal=T ) +# pylint: disable=too-many-positional-arguments def set_score(submission_uuid, points_earned, points_possible, annotation_creator=None, annotation_type=None, annotation_reason=None): """ diff --git a/submissions/management/commands/tests/test_analyze_uploaded_file_sizes.py b/submissions/management/commands/tests/test_analyze_uploaded_file_sizes.py index 3701bdce..ea014e3d 100644 --- a/submissions/management/commands/tests/test_analyze_uploaded_file_sizes.py +++ b/submissions/management/commands/tests/test_analyze_uploaded_file_sizes.py @@ -66,7 +66,7 @@ def create_another_submission( same_user=False, same_course=False, time_delta=None, - ): + ): # pylint: disable=too-many-positional-arguments """ Creates a new Submission, copying certain fields from the 'base' """ diff --git a/submissions/team_api.py b/submissions/team_api.py index cbd7a419..392e0d23 100644 --- a/submissions/team_api.py +++ b/submissions/team_api.py @@ -20,6 +20,7 @@ @transaction.atomic +# pylint: disable=too-many-positional-arguments def create_submission_for_team( course_id, item_id, @@ -359,7 +360,7 @@ def get_team_ids_by_team_submission_uuid(team_submission_uuids): } -def set_score(team_submission_uuid, points_earned, points_possible, +def set_score(team_submission_uuid, points_earned, points_possible, # pylint: disable=too-many-positional-arguments annotation_creator=None, annotation_type=None, annotation_reason=None): """Set a score for a particular team submission. This score is calculated externally to the API. Should call _api.set_score(...) for each child submission diff --git a/submissions/tests/test_team_api.py b/submissions/tests/test_team_api.py index bc0c39d6..d2362eab 100644 --- a/submissions/tests/test_team_api.py +++ b/submissions/tests/test_team_api.py @@ -74,7 +74,7 @@ def _make_team_submission( team_id=TEAM_1_ID, status=None, create_submissions=False - ): + ): # pylint: disable=too-many-positional-arguments """ Convenience method to create test TeamSubmissions with some default values """ model_args = { 'attempt_number': attempt_number, diff --git a/tox.ini b/tox.ini index 759c49da..f080f082 100644 --- a/tox.ini +++ b/tox.ini @@ -23,14 +23,15 @@ commands = make test_quality [testenv:docs] +allowlist_externals = + make deps = - setuptools - -r{toxinidir}/requirements/dev.txt -commands = - python setup.py build_sphinx + -r{toxinidir}/requirements/docs.txt +commands = + make docs-html [testenv:check_keywords] -whitelist_externals = +allowlist_externals = make deps = -r{toxinidir}/requirements/dev.txt