From c59a435e3b59f364a30a5684bb88207094df25ff Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 22 Nov 2024 09:24:45 +0900 Subject: [PATCH] python312Packages.datalad: refactor (cherry picked from commit 53b61e7a0ea65e009f2135d6d3474dcadf8209db) --- .../python-modules/datalad/default.nix | 72 +++++++++---------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 5021b2e1c3028..1df8ee11bf655 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -34,16 +34,15 @@ python-dateutil, # duecredit duecredit, - # python>=3.8 distro, # win colorama, # python-version-dependent pythonOlder, - importlib-resources, importlib-metadata, typing-extensions, # tests + pytest-xdist, pytestCheckHook, p7zip, curl, @@ -53,10 +52,11 @@ buildPythonPackage rec { pname = "datalad"; version = "1.1.4"; + pyproject = true; src = fetchFromGitHub { owner = "datalad"; - repo = pname; + repo = "datalad"; rev = "refs/tags/${version}"; hash = "sha256-l3II9xebSq09He5e4GGGiGtfe6ERtIQD00eHKGx46WA="; }; @@ -79,49 +79,44 @@ buildPythonPackage rec { ]; dependencies = - [ - # core - platformdirs - chardet - iso8601 - humanize - fasteners - packaging - patool - tqdm - annexremote - looseversion - setuptools - git-annex - - # downloaders-extra - # requests-ftp # not in nixpkgs yet - - # downloaders + optional-dependencies.core ++ optional-dependencies.downloaders ++ optional-dependencies.publish; + + optional-dependencies = { + core = + [ + platformdirs + chardet + distro + iso8601 + humanize + fasteners + packaging + patool + tqdm + annexremote + looseversion + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + downloaders = [ boto3 keyrings-alt keyring msgpack requests - - # publish - python-gitlab - - # misc + ]; + downloaders-extra = [ + # requests-ftp # not in nixpkgs yet + ]; + publish = [ python-gitlab ]; + misc = [ argcomplete pyperclip python-dateutil - - # duecredit - duecredit - - # python>=3.8 - distro - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] - ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] - ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + ]; + duecredit = [ duecredit ]; + }; postInstall = '' installShellCompletion --cmd datalad \ @@ -228,6 +223,7 @@ buildPythonPackage rec { nativeCheckInputs = [ p7zip + pytest-xdist pytestCheckHook git-annex curl