From dde7586eb40cf1773cc8b31786a37232cb44bad1 Mon Sep 17 00:00:00 2001 From: HHR2020 <76608828+HHR2020@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:46:18 +0800 Subject: [PATCH 1/2] python3Packages.fica: init at 0.4.1 --- .../python-modules/fica/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/fica/default.nix diff --git a/pkgs/development/python-modules/fica/default.nix b/pkgs/development/python-modules/fica/default.nix new file mode 100644 index 000000000000..73719ab51654 --- /dev/null +++ b/pkgs/development/python-modules/fica/default.nix @@ -0,0 +1,51 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + docutils, + pyyaml, + sphinx, + pytestCheckHook, + numpy, +}: + +buildPythonPackage (finalAttrs: { + pname = "fica"; + version = "0.4.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "chrispyles"; + repo = "fica"; + tag = "v${finalAttrs.version}"; + hash = "sha256-A13xC8BGsPddsk8ZN2DeMCYc0phy/B4JD9shuoorOwg="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + docutils + pyyaml + sphinx + ]; + + pythonImportsCheck = [ + "fica" + ]; + + nativeCheckInputs = [ + pytestCheckHook + numpy + ]; + + meta = { + description = "Library for managing and documenting user configurations"; + homepage = "https://github.com/chrispyles/fica"; + changelog = "https://github.com/chrispyles/fica/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hhr2020 ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f24b0a29d716..aeec278f7112 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5507,6 +5507,8 @@ self: super: with self; { fiblary3-fork = callPackage ../development/python-modules/fiblary3-fork { }; + fica = callPackage ../development/python-modules/fica { }; + fickling = callPackage ../development/python-modules/fickling { }; fido2 = callPackage ../development/python-modules/fido2 { }; From 72e2be4cfbba5326c1e8b1a3784b8e0dc284814a Mon Sep 17 00:00:00 2001 From: HHR2020 <76608828+HHR2020@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:46:50 +0800 Subject: [PATCH 2/2] python3Packages.otter-grader: init at 6.1.6 --- .../python-modules/otter-grader/default.nix | 153 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 155 insertions(+) create mode 100644 pkgs/development/python-modules/otter-grader/default.nix diff --git a/pkgs/development/python-modules/otter-grader/default.nix b/pkgs/development/python-modules/otter-grader/default.nix new file mode 100644 index 000000000000..7821be272a4d --- /dev/null +++ b/pkgs/development/python-modules/otter-grader/default.nix @@ -0,0 +1,153 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + click, + dill, + fica, + ipylab, + ipython, + ipywidgets, + jinja2, + jupytext, + nbconvert, + nbformat, + pandas, + python-on-whales, + pyyaml, + requests, + wrapt, + ipykernel, + jupyter-client, + pypdf, + google-api-python-client, + google-auth-oauthlib, + gspread, + six, + rpy2, + pytestCheckHook, + writableTmpDirAsHomeHook, + pytest-html, + matplotlib, + tqdm, + R, + rPackages, +}: + +buildPythonPackage (finalAttrs: { + pname = "otter-grader"; + version = "6.1.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ucbds-infra"; + repo = "otter-grader"; + tag = "v${finalAttrs.version}"; + hash = "sha256-bqBwDbxnvRm7W9r87YK9vwi3sSyoyqbdnqVs5HxOzsg="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + click + dill + fica + ipylab + ipython + ipywidgets + jinja2 + jupytext + nbconvert + nbformat + pandas + python-on-whales + pyyaml + requests + wrapt + ]; + + optional-dependencies = { + grading = [ + ipykernel + jupyter-client + pypdf + ]; + plugins = [ + google-api-python-client + google-auth-oauthlib + gspread + six + ]; + r = [ + rpy2 + ]; + }; + + pythonRelaxDeps = [ + "fica" + ]; + + pythonImportsCheck = [ + "otter" + ]; + + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + pytest-html + matplotlib + tqdm + R + ] + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; + + checkInputs = [ + rPackages.knitr + rPackages.ottr + ]; + + disabledTests = [ + # requires Docker + "test_timeout_some_notebooks_finish" + "test_timeout_no_notebooks_finish" + "test_network" + "test_notebooks_with_pdfs" + "test_config_overrides_integration" + "test_queue" + # testthat 3.x assertion message format differs from the expected results in + # this R Markdown test, causing a partial credit output mismatch + "test_rmd" + ] + ++ lib.optionals stdenv.isDarwin [ + # socket.bind() fails under macOS sandbox + "test_otter_example" + "test_jupyterlite" + "test_require_no_pdf_ack" + "test_require_no_pdf_ack_with_message" + "test_otter_check_script" + "test_otter_check_notebook" + "test_kernel_override" + "test_log_execution" + "test_results_load_failure_handling" + "test_notebook" + "test_pdf_generation_failure" + "test_use_submission_pdf" + "test_force_public_test_summary" + "test_script" + "test_assignment_name" + "test_token_sanitization" + "test_pdf_via_html" + ]; + + meta = { + description = "Python and R autograder"; + homepage = "https://github.com/ucbds-infra/otter-grader"; + changelog = "https://github.com/ucbds-infra/otter-grader/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ hhr2020 ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index aeec278f7112..cb8b4f14f16f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11985,6 +11985,8 @@ self: super: with self; { ots-python = callPackage ../development/python-modules/ots-python { }; + otter-grader = callPackage ../development/python-modules/otter-grader { }; + otxv2 = callPackage ../development/python-modules/otxv2 { }; ourgroceries = callPackage ../development/python-modules/ourgroceries { };