From 7c2bc1f05a95e19342cf27ae58478b5f4d3e369f Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 10:16:45 +0200 Subject: [PATCH 1/3] datalad: 1.0.2 -> 1.1.1 fixes python 3.12 compat Signed-off-by: Florian Brandes --- pkgs/applications/version-management/datalad/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/datalad/default.nix b/pkgs/applications/version-management/datalad/default.nix index 2b7d9eb032f9..4c1c2c39f2ff 100644 --- a/pkgs/applications/version-management/datalad/default.nix +++ b/pkgs/applications/version-management/datalad/default.nix @@ -2,13 +2,13 @@ python3.pkgs.buildPythonApplication rec { pname = "datalad"; - version = "1.0.2"; + version = "1.1.1"; src = fetchFromGitHub { owner = "datalad"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-oq+DdlWcwjJSQdnqHlYCa9I7iSOKf+hI35Lcv/GM24c="; + hash = "sha256-Vw/RpMf+jnUijJ3GZ9nLk1IRWOADmM+jNtYl5Ba6uLg="; }; nativeBuildInputs = [ installShellFiles git ]; @@ -32,7 +32,7 @@ python3.pkgs.buildPythonApplication rec { # requests-ftp # not in nixpkgs yet # downloaders - boto + boto3 keyrings-alt keyring msgpack From 47b4b80c07b4b7b32bc7d34bf432db44b74b6ab2 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 14:28:06 +0200 Subject: [PATCH 2/3] datalad: add python tests, use new PEP builder Signed-off-by: Florian Brandes --- .../version-management/datalad/default.nix | 132 +++++++++++++++--- 1 file changed, 110 insertions(+), 22 deletions(-) diff --git a/pkgs/applications/version-management/datalad/default.nix b/pkgs/applications/version-management/datalad/default.nix index 4c1c2c39f2ff..140c41323ab0 100644 --- a/pkgs/applications/version-management/datalad/default.nix +++ b/pkgs/applications/version-management/datalad/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, installShellFiles, python3, git, git-annex }: +{ lib, stdenv, fetchFromGitHub, installShellFiles, python3, git, git-annex, p7zip, curl, coreutils }: python3.pkgs.buildPythonApplication rec { pname = "datalad"; @@ -11,9 +11,16 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-Vw/RpMf+jnUijJ3GZ9nLk1IRWOADmM+jNtYl5Ba6uLg="; }; + postPatch = '' + substituteInPlace datalad/distribution/create_sibling.py \ + --replace-fail "/bin/ls" "${coreutils}/bin/ls" + ''; + nativeBuildInputs = [ installShellFiles git ]; - propagatedBuildInputs = with python3.pkgs; [ + build-system = [ python3.pkgs.setuptools ]; + + dependencies = with python3.pkgs; [ # core platformdirs chardet @@ -45,25 +52,14 @@ python3.pkgs.buildPythonApplication rec { argcomplete pyperclip python-dateutil - - # metadata - simplejson - whoosh - - # metadata-extra - pyyaml - mutagen - exifread - python-xmp-toolkit - pillow - # duecredit duecredit - # python>=3.8 distro ] ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] - ++ lib.optionals (python3.pythonOlder "3.10") [ importlib-metadata ]; + ++ lib.optionals (python3.pythonOlder "3.9") [ importlib-resources ] + ++ lib.optionals (python3.pythonOlder "3.10") [ importlib-metadata ] + ++ lib.optionals (python3.pythonOlder "3.11") [ typing_extensions ]; postInstall = '' installShellCompletion --cmd datalad \ @@ -72,15 +68,107 @@ python3.pkgs.buildPythonApplication rec { wrapProgram $out/bin/datalad --prefix PYTHONPATH : "$PYTHONPATH" ''; - # no tests - doCheck = false; + preCheck = '' + export HOME=$TMPDIR + ''; + + # tests depend on apps in $PATH which only will get installed after the test + 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" + + # No such file or directory: 'git-annex-remote-[...]" + "test_create" + "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" + + # 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" + ]; + + nativeCheckInputs = [ p7zip python3.pkgs.pytestCheckHook git-annex curl python3.pkgs.httpretty ]; pythonImportsCheck = [ "datalad" ]; - meta = with lib; { + meta = { description = "Keep code, data, containers under control with git and git-annex"; homepage = "https://www.datalad.org"; - license = licenses.mit; - maintainers = with maintainers; [ renesat ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ renesat ]; }; -} +} \ No newline at end of file From 9e885bb15bef25f87f768762b21d8c522653b350 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Mon, 29 Jul 2024 19:32:21 +0200 Subject: [PATCH 3/3] datalad: format Signed-off-by: Florian Brandes --- .../version-management/datalad/default.nix | 97 ++++++++++++------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/pkgs/applications/version-management/datalad/default.nix b/pkgs/applications/version-management/datalad/default.nix index 140c41323ab0..f9c3ac400d72 100644 --- a/pkgs/applications/version-management/datalad/default.nix +++ b/pkgs/applications/version-management/datalad/default.nix @@ -1,4 +1,15 @@ -{ lib, stdenv, fetchFromGitHub, installShellFiles, python3, git, git-annex, p7zip, curl, coreutils }: +{ + lib, + stdenv, + fetchFromGitHub, + installShellFiles, + python3, + git, + git-annex, + p7zip, + curl, + coreutils, +}: python3.pkgs.buildPythonApplication rec { pname = "datalad"; @@ -16,47 +27,53 @@ python3.pkgs.buildPythonApplication rec { --replace-fail "/bin/ls" "${coreutils}/bin/ls" ''; - nativeBuildInputs = [ installShellFiles git ]; + nativeBuildInputs = [ + installShellFiles + git + ]; build-system = [ python3.pkgs.setuptools ]; - dependencies = with python3.pkgs; [ - # core - platformdirs - chardet - iso8601 - humanize - fasteners - packaging - patool - tqdm - annexremote - looseversion - setuptools - git-annex + dependencies = + with python3.pkgs; + [ + # core + platformdirs + chardet + iso8601 + humanize + fasteners + packaging + patool + tqdm + annexremote + looseversion + setuptools + git-annex - # downloaders-extra - # requests-ftp # not in nixpkgs yet + # downloaders-extra + # requests-ftp # not in nixpkgs yet - # downloaders - boto3 - keyrings-alt - keyring - msgpack - requests + # downloaders + boto3 + keyrings-alt + keyring + msgpack + requests - # publish - python-gitlab + # publish + python-gitlab - # misc - argcomplete - pyperclip - python-dateutil - # duecredit - duecredit - # python>=3.8 - distro - ] ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] + # misc + argcomplete + pyperclip + python-dateutil + # duecredit + duecredit + # python>=3.8 + distro + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] ++ lib.optionals (python3.pythonOlder "3.9") [ importlib-resources ] ++ lib.optionals (python3.pythonOlder "3.10") [ importlib-metadata ] ++ lib.optionals (python3.pythonOlder "3.11") [ typing_extensions ]; @@ -161,7 +178,13 @@ python3.pkgs.buildPythonApplication rec { "test_wtf" ]; - nativeCheckInputs = [ p7zip python3.pkgs.pytestCheckHook git-annex curl python3.pkgs.httpretty ]; + nativeCheckInputs = [ + p7zip + python3.pkgs.pytestCheckHook + git-annex + curl + python3.pkgs.httpretty + ]; pythonImportsCheck = [ "datalad" ]; @@ -171,4 +194,4 @@ python3.pkgs.buildPythonApplication rec { license = lib.licenses.mit; maintainers = with lib.maintainers; [ renesat ]; }; -} \ No newline at end of file +}