From 536d238d525f0a15af0f7868ac6ceda08d67a905 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 10:07:40 -0800 Subject: [PATCH 1/9] python3Packages.datalad: set DATALAD_TESTS_NONETWORK to disable network tests --- .../python-modules/datalad/default.nix | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index c6fdcc61b5f8..df51a5e581fb 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -126,6 +126,7 @@ buildPythonPackage rec { preCheck = '' export HOME=$TMPDIR + export DATALAD_TESTS_NONETWORK=1 ''; # tests depend on apps in $PATH which only will get installed after the test @@ -143,8 +144,11 @@ buildPythonPackage rec { "test_status_custom_summary_no_repeats" "test_quoting" - # No such file or directory: 'git-annex-remote-[...]" + # Tries to run `git` and fails + "test_reckless" "test_create" + + # No such file or directory: 'git-annex-remote-[...]" "test_ensure_datalad_remote_maybe_enable" # "git-annex: unable to use external special remote git-annex-remote-datalad" @@ -191,28 +195,6 @@ buildPythonPackage rec { "test_download_url_need_datalad_remote" "test_datalad_credential_helper - assert False" - # need internet access - "test_clone_crcns" - "test_clone_datasets_root" - "test_reckless" - "test_autoenabled_remote_msg" - "test_ria_http_storedataladorg" - "test_gin_cloning" - "test_nonuniform_adjusted_subdataset" - "test_install_datasets_root" - "test_install_simple_local" - "test_install_dataset_from_just_source" - "test_install_dataset_from_just_source_via_path" - "test_datasets_datalad_org" - "test_get_cached_dataset" - "test_cached_dataset" - "test_cached_url" - "test_anonymous_s3" - "test_protocols" - "test_get_versioned_url_anon" - "test_install_recursive_github" - "test_failed_install_multiple" - # pbcopy not found "test_wtf" From 1f30221d2f1f788db3925451c133d963e67dff70 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 10:22:47 -0800 Subject: [PATCH 2/9] python3Packages.datalad: test with wrapped tools on PATH --- .../python-modules/datalad/default.nix | 64 ++++--------------- 1 file changed, 14 insertions(+), 50 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index df51a5e581fb..9635aed9a026 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -42,6 +42,7 @@ importlib-metadata, typing-extensions, # tests + pytest-retry, pytest-xdist, pytestCheckHook, p7zip, @@ -127,9 +128,13 @@ buildPythonPackage rec { preCheck = '' export HOME=$TMPDIR export DATALAD_TESTS_NONETWORK=1 + export PATH="$PATH:$out/bin" ''; - # tests depend on apps in $PATH which only will get installed after the test + disabledTestMarks = [ + "flaky" + ]; + disabledTests = [ # No such file or directory: 'datalad' "test_script_shims" @@ -147,59 +152,17 @@ buildPythonPackage rec { # Tries to run `git` and fails "test_reckless" "test_create" + "test_subsuperdataset_save" - # No such file or directory: 'git-annex-remote-[...]" - "test_ensure_datalad_remote_maybe_enable" - - # "git-annex: unable to use external special remote git-annex-remote-datalad" - "test_ria_postclonecfg" - "test_ria_postclone_noannex" - "test_ria_push" - "test_basic_scenario" - "test_annex_get_from_subdir" - "test_ensure_datalad_remote_init_and_enable_needed" - "test_ensure_datalad_remote_maybe_enable[False]" - "test_ensure_datalad_remote_maybe_enable[True]" - "test_create_simple" - "test_create_alias" - "test_storage_only" - "test_initremote" - "test_read_access" - "test_ephemeral" - "test_initremote_basic_fileurl" - "test_initremote_basic_httpurl" - "test_remote_layout" - "test_version_check" - "test_gitannex_local" - "test_push_url" - "test_url_keys" - "test_obtain_permission_root" - "test_source_candidate_subdataset" - "test_update_fetch_all" - "test_add_archive_dirs" - "test_add_archive_content" - "test_add_archive_content_strip_leading" - "test_add_archive_content_zip" - "test_add_archive_content_absolute_path" - "test_add_archive_use_archive_dir" - "test_add_archive_single_file" - "test_add_delete" - "test_add_archive_leading_dir" - "test_add_delete_after_and_drop" - "test_add_delete_after_and_drop_subdir" - "test_override_existing_under_git" - "test_copy_file_datalad_specialremote" - "test_download_url_archive" - "test_download_url_archive_from_subdir" - "test_download_url_archive_trailing_separator" - "test_download_url_need_datalad_remote" - "test_datalad_credential_helper - assert False" + # Tries to spawn a subshell and fails + "test_shell_completion_source" + # Times out + "test_rerun_unrelated_nonrun_left_run_right" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ # pbcopy not found "test_wtf" - - # CommandError: 'git -c diff.ignoreSubmodules=none -c core.quotepath=false ls-files -z -m -d' failed with exitcode 128 - "test_subsuperdataset_save" ] ++ lib.optionals (pythonAtLeast "3.14") [ # For all: https://github.com/datalad/datalad/issues/7781 @@ -215,6 +178,7 @@ buildPythonPackage rec { nativeCheckInputs = [ p7zip + pytest-retry pytest-xdist pytestCheckHook git-annex From 97f0cd2083fe01f97fa4d42fcceef3d4a84858fd Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 10:46:55 -0800 Subject: [PATCH 3/9] python3Packages.datalad: audit and cleanup disabledTests --- pkgs/development/python-modules/datalad/default.nix | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 9635aed9a026..f66dc3bd05d2 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -136,19 +136,6 @@ buildPythonPackage rec { ]; disabledTests = [ - # No such file or directory: 'datalad' - "test_script_shims" - "test_cfg_override" - "test_completion" - "test_nested_pushclone_cycle_allplatforms" - "test_create_sub_gh3463" - "test_create_sub_dataset_dot_no_path" - "test_cfg_passthrough" - "test_addurls_stdin_input_command_line" - "test_run_datalad_help" - "test_status_custom_summary_no_repeats" - "test_quoting" - # Tries to run `git` and fails "test_reckless" "test_create" From 6778c38350c6b90748dec1530400bca5172dc049 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 10:56:30 -0800 Subject: [PATCH 4/9] python3Packages.datalad: apply finalAttrs: fix --- pkgs/development/python-modules/datalad/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index f66dc3bd05d2..4e84aaa75577 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -50,7 +50,7 @@ httpretty, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "datalad"; version = "1.2.3"; pyproject = true; @@ -58,7 +58,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "datalad"; repo = "datalad"; - tag = version; + tag = finalAttrs.version; hash = "sha256-C3e9k4RDFfDMaimZ/7TtAJNzdlfVrKoTHVl0zKL9EjI="; }; @@ -78,7 +78,9 @@ buildPythonPackage rec { ]; dependencies = - optional-dependencies.core ++ optional-dependencies.downloaders ++ optional-dependencies.publish; + finalAttrs.passthru.optional-dependencies.core + ++ finalAttrs.passthru.optional-dependencies.downloaders + ++ finalAttrs.passthru.optional-dependencies.publish; optional-dependencies = { core = [ @@ -183,10 +185,11 @@ buildPythonPackage rec { meta = { description = "Keep code, data, containers under control with git and git-annex"; homepage = "https://www.datalad.org"; + changelog = "https://github.com/datalad/datalad/blob/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ renesat malik ]; }; -} +}) From 625bb9303491ab3d808e8ae96d1da03ccf378e3d Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 11:02:48 -0800 Subject: [PATCH 5/9] python3Packages.datalad: add sarahec as maintainer --- pkgs/development/python-modules/datalad/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 4e84aaa75577..9870e79d2112 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -190,6 +190,7 @@ buildPythonPackage (finalAttrs: { maintainers = with lib.maintainers; [ renesat malik + sarahec ]; }; }) From 9133935fc73831d222c82096c39e5de172650313 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 11:20:39 -0800 Subject: [PATCH 6/9] python3Packages.datalad: ensure tests work on Darwin --- pkgs/development/python-modules/datalad/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 9870e79d2112..ba5849f4ecb4 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -152,6 +152,8 @@ buildPythonPackage (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isDarwin [ # pbcopy not found "test_wtf" + # hangs + "test_keyring" ] ++ lib.optionals (pythonAtLeast "3.14") [ # For all: https://github.com/datalad/datalad/issues/7781 @@ -180,6 +182,9 @@ buildPythonPackage (finalAttrs: { "-Wignore::DeprecationWarning" ]; + # Tests use ports on localhost + __darwinAllowLocalNetworking = true; + pythonImportsCheck = [ "datalad" ]; meta = { From f7bf677632b42c3300af8ebe851b7f314d92e726 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 15 Jan 2026 12:48:31 -0800 Subject: [PATCH 7/9] python3Packages.datalad: disable extra-slow tests --- pkgs/development/python-modules/datalad/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index ba5849f4ecb4..57ebdb1d7685 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -148,6 +148,13 @@ buildPythonPackage (finalAttrs: { # Times out "test_rerun_unrelated_nonrun_left_run_right" + + # Top five slowest (2/3 of total runtime) + "test_files_split" + "test_gitannex_local" + "test_save_hierarchy" + "test_recurse_existing" + "test_source_candidate_subdataset" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # pbcopy not found From 0ced30df829095460d925fb2aa8bed87c7ff86d4 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Sun, 18 Jan 2026 09:37:40 -0800 Subject: [PATCH 8/9] python3Packages.datalad: 1.2.3 -> 1.3.0 --- pkgs/development/python-modules/datalad/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 57ebdb1d7685..62767e821de8 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -52,14 +52,14 @@ buildPythonPackage (finalAttrs: { pname = "datalad"; - version = "1.2.3"; + version = "1.3.0"; pyproject = true; src = fetchFromGitHub { owner = "datalad"; repo = "datalad"; tag = finalAttrs.version; - hash = "sha256-C3e9k4RDFfDMaimZ/7TtAJNzdlfVrKoTHVl0zKL9EjI="; + hash = "sha256-aTpiwcwRJyUF68+OsT+u9j/cibZEDhmL45I1MSY3Q7E="; }; postPatch = '' From eb8cef78ab91a834ca18e470a416cea03b7b3353 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Sun, 18 Jan 2026 10:10:04 -0800 Subject: [PATCH 9/9] python3Packages.datalad: restore tests fixed in release 1.3.0 --- pkgs/development/python-modules/datalad/default.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 62767e821de8..e01e2f1807b6 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -161,17 +161,6 @@ buildPythonPackage (finalAttrs: { "test_wtf" # hangs "test_keyring" - ] - ++ lib.optionals (pythonAtLeast "3.14") [ - # For all: https://github.com/datalad/datalad/issues/7781 - # AssertionError: `assert 1 == 0` (refcount error) - "test_GitRepo_flyweight" - "test_Dataset_flyweight" - "test_AnnexRepo_flyweight" - # TypeError: cannot pickle '_thread.lock' object - "test_popen_invocation" - # datalad.runner.exception.CommandError: '/python3.14 -i -u -q -']' timed out after 0.5 seconds - "test_asyncio_loop_noninterference1" ]; nativeCheckInputs = [