From 77e769a3f0e6d2dedaae3d9203b16ff55116550a Mon Sep 17 00:00:00 2001 From: Nicolas Brichet <32258950+brichet@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:03:49 +0200 Subject: [PATCH 1/4] Upgrade upload-artifact action to v4 (#1928) --- .github/workflows/check-release.yml | 2 +- .github/workflows/test-extensions.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 7e22430d7..0853c22e8 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -26,7 +26,7 @@ jobs: if: ${{ matrix.group == 'link_check' }} uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 - name: Upload Distributions - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: nbgrader-jupyter-releaser-dist-${{ github.run_number }} path: .jupyter_releaser_checkout/dist diff --git a/.github/workflows/test-extensions.yml b/.github/workflows/test-extensions.yml index 425e9e39a..015a5255c 100644 --- a/.github/workflows/test-extensions.yml +++ b/.github/workflows/test-extensions.yml @@ -91,7 +91,7 @@ jobs: python tasks.py tests --group=${{ matrix.group }} - name: Upload Playwright Test report if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: nbgrader-uitests-${{ matrix.group }}-${{ matrix.os }}-python${{ matrix.python }} path: | From b786ea669fed1d1bb122aa61fd3299ebd70db97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Fri, 4 Oct 2024 08:29:41 +0200 Subject: [PATCH 2/4] Fix labextension plugin IDs in the docs and demos (#1927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jakub Klinkovský <1289205+lahwaacz@users.noreply.github.com> --- demos/restart_demo.sh | 12 +++---- demos/utils.sh | 18 +++++----- .../docs/source/user_guide/installation.rst | 36 +++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/demos/restart_demo.sh b/demos/restart_demo.sh index e4c18ea0e..c67ff16f8 100755 --- a/demos/restart_demo.sh +++ b/demos/restart_demo.sh @@ -70,14 +70,14 @@ install_nbgrader () { # Install global extensions, and disable them globally. We will re-enable # specific ones for different user accounts in each demo. jupyter labextension develop --overwrite . - jupyter labextension disable --level=sys_prefix nbgrader:assignment-list - jupyter labextension disable --level=sys_prefix nbgrader:formgrader - jupyter labextension disable --level=sys_prefix nbgrader:course-list - jupyter labextension disable --level=sys_prefix nbgrader:create-assignment + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:assignment-list + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:formgrader + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:course-list + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:create-assignment jupyter server extension disable --sys-prefix --py nbgrader # Everybody gets the validate extension, however. - jupyter labextension enable --level=sys_prefix nbgrader:validate-assignment + jupyter labextension enable --level=sys_prefix @jupyter/nbgrader:validate-assignment jupyter server extension enable --sys-prefix nbgrader.server_extensions.validate_assignment # Reset exchange. @@ -114,4 +114,4 @@ restart_demo () { jupyterhub } -restart_demo "${@}" \ No newline at end of file +restart_demo "${@}" diff --git a/demos/utils.sh b/demos/utils.sh index f2b1d60ee..e80019105 100644 --- a/demos/utils.sh +++ b/demos/utils.sh @@ -65,8 +65,8 @@ enable_create_assignment () { HOME="/home/${USER}" local runas="sudo -u ${USER}" - ${runas} jupyter labextension disable --level=user nbgrader:create-assignment - ${runas} jupyter labextension enable --level=user nbgrader:create-assignment + ${runas} jupyter labextension disable --level=user @jupyter/nbgrader:create-assignment + ${runas} jupyter labextension enable --level=user @jupyter/nbgrader:create-assignment } enable_formgrader () { @@ -74,8 +74,8 @@ enable_formgrader () { HOME="/home/${USER}" local runas="sudo -u ${USER}" - ${runas} jupyter labextension disable --level=user nbgrader:formgrader - ${runas} jupyter labextension enable --level=user nbgrader:formgrader + ${runas} jupyter labextension disable --level=user @jupyter/nbgrader:formgrader + ${runas} jupyter labextension enable --level=user @jupyter/nbgrader:formgrader ${runas} jupyter server extension enable --user nbgrader.server_extensions.formgrader } @@ -84,8 +84,8 @@ enable_assignment_list () { HOME="/home/${USER}" local runas="sudo -u ${USER}" - ${runas} jupyter labextension disable --level=user nbgrader:assignment-list - ${runas} jupyter labextension enable --level=user nbgrader:assignment-list + ${runas} jupyter labextension disable --level=user @jupyter/nbgrader:assignment-list + ${runas} jupyter labextension enable --level=user @jupyter/nbgrader:assignment-list ${runas} jupyter server extension enable --user nbgrader.server_extensions.assignment_list } @@ -94,8 +94,8 @@ enable_course_list () { HOME="/home/${USER}" local runas="sudo -u ${USER}" - ${runas} jupyter labextension disable --level=user nbgrader:course-list - ${runas} jupyter labextension enable --level=user nbgrader:course-list + ${runas} jupyter labextension disable --level=user @jupyter/nbgrader:course-list + ${runas} jupyter labextension enable --level=user @jupyter/nbgrader:course-list ${runas} jupyter server extension enable --user nbgrader.server_extensions.course_list } @@ -112,4 +112,4 @@ create_course () { ${runas} nbgrader generate_assignment ps1 ${runas} nbgrader release_assignment ps1 cd "${currdir}" -} \ No newline at end of file +} diff --git a/nbgrader/docs/source/user_guide/installation.rst b/nbgrader/docs/source/user_guide/installation.rst index 344761d54..d3f6f8587 100644 --- a/nbgrader/docs/source/user_guide/installation.rst +++ b/nbgrader/docs/source/user_guide/installation.rst @@ -33,19 +33,19 @@ The server extensions can be disabled individually by running:: The labextensions are all enabled by default, but can be disabled individually by running:: - jupyter labextension disable nbgrader:formgrader - jupyter labextension disable nbgrader:assignment-list - jupyter labextension disable nbgrader:course-list - jupyter labextension disable nbgrader:create-assignment - jupyter labextension disable nbgrader:validate-assignment + jupyter labextension disable @jupyter/nbgrader:formgrader + jupyter labextension disable @jupyter/nbgrader:assignment-list + jupyter labextension disable @jupyter/nbgrader:course-list + jupyter labextension disable @jupyter/nbgrader:create-assignment + jupyter labextension disable @jupyter/nbgrader:validate-assignment or enabled:: - jupyter labextension enable nbgrader:formgrader - jupyter labextension enable nbgrader:assignment-list - jupyter labextension enable nbgrader:course-list - jupyter labextension enable nbgrader:create-assignment - jupyter labextension enable nbgrader:validate-assignment + jupyter labextension enable @jupyter/nbgrader:formgrader + jupyter labextension enable @jupyter/nbgrader:assignment-list + jupyter labextension enable @jupyter/nbgrader:course-list + jupyter labextension enable @jupyter/nbgrader:create-assignment + jupyter labextension enable @jupyter/nbgrader:validate-assignment To work properly, the **assignment list**, **formgrader**, **course list** and **validate assignment** extensions require both the labextension and server extension. The **create @@ -65,13 +65,13 @@ There are a number of ways you may need to customize the installation: - To install or enable the labextensions/server extension for just the current user, run the above commands with ``--user`` instead of ``--sys-prefix``:: - jupyter labextension enable --level=user nbgrader + jupyter labextension enable --level=user @jupyter/nbgrader jupyter server extension enable --user --py nbgrader - To install or enable the labextensions/server extension for all Python installations on the system, run the above commands with ``--system`` instead of ``--sys-prefix``:: - jupyter labextension enable --level=system nbgrader + jupyter labextension enable --level=system @jupyter/nbgrader jupyter server extension enable --system --py nbgrader Disabling extensions @@ -81,21 +81,21 @@ You may want to only install one of the nbgrader extensions. To do this, follow the above steps to install everything and then disable the extension you don't need. For example, to disable the Assignment List extension:: - jupyter labextension disable --level=sys_prefix nbgrader:assignment-list + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:assignment-list jupyter server extension disable --sys-prefix nbgrader.server_extensions.assignment_list or to disable the Create Assignment extension:: - jupyter labextension disable --level=sys_prefix nbgrader:create-assignment + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:create-assignment or to disable the Formgrader extension:: - jupyter labextension disable --level=sys_prefix nbgrader:formgrader + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:formgrader jupyter server extension disable --sys-prefix nbgrader.server_extensions.formgrader or to disable the Course List extension:: - jupyter labextension disable --level=sys_prefix nbgrader:course-list + jupyter labextension disable --level=sys_prefix @jupyter/nbgrader:course-list jupyter server extension disable --sys-prefix nbgrader.server_extensions.course_list For example lets assume you have installed nbgrader via `Anaconda @@ -106,12 +106,12 @@ only want the *create assignment* extension available to a specific user and not everyone else. First you will need to disable the *create assignment* extension for everyone else:: - jupyter labextension disable nbgrader:create-assignment + jupyter labextension disable @jupyter/nbgrader:create-assignment Log in with the specific user and then enable the *create assignment* extension only for that user:: - jupyter labextension enable --level=user nbgrader:create-assignment + jupyter labextension enable --level=user @jupyter/nbgrader:create-assignment Finally to see all installed labextensions/server extensions, run:: From be97e17c4453b66d3dfa8abc8c8fe4dc1dc42968 Mon Sep 17 00:00:00 2001 From: Frans Welin <73482123+franswel@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:22:24 +0300 Subject: [PATCH 3/4] fix an issue in release_feedback where groupshared user could not re-release feedback (#1667) Co-authored-by: Frans Welin --- nbgrader/exchange/default/release_feedback.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nbgrader/exchange/default/release_feedback.py b/nbgrader/exchange/default/release_feedback.py index 00dd05687..b9370f550 100644 --- a/nbgrader/exchange/default/release_feedback.py +++ b/nbgrader/exchange/default/release_feedback.py @@ -67,9 +67,12 @@ def copy_files(self): submission_secret = fh.read() checksum = notebook_hash(secret=submission_secret, notebook_id=notebook_id) - dest = os.path.join(self.dest_path, "{}.html".format(checksum)) + dest = os.path.join(self.dest_path, "{}-tmp.html".format(checksum)) self.log.info("Releasing feedback for student '{}' on assignment '{}/{}/{}' ({})".format( student_id, self.coursedir.course_id, self.coursedir.assignment_id, notebook_id, timestamp)) shutil.copy(html_file, dest) + # Copy to temporary location and mv to update atomically. + updated_feedback = os.path.join(self.dest_path, "{}.html". format(checksum)) + shutil.move(dest, updated_feedback) self.log.info("Feedback released to: {}".format(dest)) From 11a0a2d6d9df3c68bc4c3d7c3c81521d9c450d28 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet <32258950+brichet@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:40:49 +0100 Subject: [PATCH 4/4] Prevent dependabot from using yarn 4 (#1938) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f43950383..452677a48 100644 --- a/package.json +++ b/package.json @@ -109,5 +109,6 @@ "extension": true, "outputDir": "nbgrader/labextension", "schemaDir": "schema" - } + }, + "packageManager": "yarn@3.5.0" }