From 8a10b16cfa1c4a591845aa94f14dab971cf6601a Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 10:02:07 +0200 Subject: [PATCH 1/8] python312Packages.outdated: init at 0.2.2 Signed-off-by: Florian Brandes --- .../python-modules/outdated/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/outdated/default.nix diff --git a/pkgs/development/python-modules/outdated/default.nix b/pkgs/development/python-modules/outdated/default.nix new file mode 100644 index 000000000000..3331966bb31f --- /dev/null +++ b/pkgs/development/python-modules/outdated/default.nix @@ -0,0 +1,40 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + littleutils, + requests, + setuptools-scm, +}: + +buildPythonPackage rec { + pname = "outdated"; + version = "0.2.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "alexmojaki"; + repo = "outdated"; + rev = "refs/tags/v${version}"; + hash = "sha256-5VpPmgIcVtY97F0Hb0m9MuSW0zjaUJ18ATA4GBRw+jc="; + }; + + build-system = [ setuptools-scm ]; + + dependencies = [ + littleutils + requests + ]; + + # checks rely on internet connection + doCheck = false; + + pythonImportsCheck = [ "outdated" ]; + + meta = { + description = "Mini-library which, given a package name and a version, checks if it's the latest version available on PyPI"; + homepage = "https://github.com/alexmojaki/outdated"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ gador ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a07033929d9..ba10b663c882 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9629,6 +9629,8 @@ self: super: with self; { outcome = callPackage ../development/python-modules/outcome { }; + outdated = callPackage ../development/python-modules/outdated { }; + outspin = callPackage ../development/python-modules/outspin { }; ovh = callPackage ../development/python-modules/ovh { }; From 585b762ec388044506b8521991c426cc08f6066c Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 10:04:19 +0200 Subject: [PATCH 2/8] python312Packages.datasalad: init at 0.2.1 Signed-off-by: Florian Brandes --- .../python-modules/datasalad/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/datasalad/default.nix diff --git a/pkgs/development/python-modules/datasalad/default.nix b/pkgs/development/python-modules/datasalad/default.nix new file mode 100644 index 000000000000..66303c1ff0cd --- /dev/null +++ b/pkgs/development/python-modules/datasalad/default.nix @@ -0,0 +1,46 @@ +{ + buildPythonPackage, + fetchFromGitHub, + hatchling, + hatch-vcs, + lib, + more-itertools, + psutil, + pytestCheckHook, + unzip, +}: + +buildPythonPackage rec { + pname = "datasalad"; + version = "0.2.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "datalad"; + repo = "datasalad"; + rev = "refs/tags/v${version}"; + hash = "sha256-qgHWTokNBzJcBbEPCA/YfklzqyX1lM2yro7ElqBfrig="; + }; + + build-system = [ + hatchling + hatch-vcs + ]; + + nativeCheckInputs = [ + pytestCheckHook + more-itertools + psutil + unzip + ]; + + pythonImportsCheck = [ "datasalad" ]; + + meta = { + description = "Pure-Python library with a collection of utilities for working with Git and git-annex"; + changelog = "https://github.com/datalad/datasalad/blob/main/CHANGELOG.md"; + homepage = "https://github.com/datalad/datasalad"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ gador ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ba10b663c882..ddaa073d14db 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2843,6 +2843,8 @@ self: super: with self; { dataproperty = callPackage ../development/python-modules/dataproperty { }; + datasalad = callPackage ../development/python-modules/datasalad { }; + dataset = callPackage ../development/python-modules/dataset { }; datasets = callPackage ../development/python-modules/datasets { }; From dddc92274547d0c3d63a7553877d8ac4f9c48318 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 14:29:31 +0200 Subject: [PATCH 3/8] python312Packages.datalad-next: init at 1.5.0 Signed-off-by: Florian Brandes --- .../python-modules/datalad-next/default.nix | 106 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 108 insertions(+) create mode 100644 pkgs/development/python-modules/datalad-next/default.nix diff --git a/pkgs/development/python-modules/datalad-next/default.nix b/pkgs/development/python-modules/datalad-next/default.nix new file mode 100644 index 000000000000..23192114502f --- /dev/null +++ b/pkgs/development/python-modules/datalad-next/default.nix @@ -0,0 +1,106 @@ +{ + annexremote, + buildPythonPackage, + datalad, + datasalad, + fetchFromGitHub, + git, + git-annex, + humanize, + lib, + more-itertools, + psutil, + pytestCheckHook, + setuptools, + openssh, + unzip, + webdavclient3, +}: + +buildPythonPackage rec { + pname = "datalad-next"; + version = "1.5.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "datalad"; + repo = "datalad-next"; + rev = "refs/tags/${version}"; + hash = "sha256-fqP6nG2ncDRg48kvlsmPjNBOzfQp9+7wTcGvsYVrRzA="; + }; + + nativeBuildInputs = [ git ]; + + build-system = [ setuptools ]; + + dependencies = [ + annexremote + datasalad + datalad + humanize + more-itertools + ]; + + preCheck = '' + export HOME=$TMPDIR + ''; + + nativeCheckInputs = [ + pytestCheckHook + webdavclient3 + psutil + git-annex + datalad + openssh + unzip + ]; + + disabledTests = [ + # remotes available after datalad-next install (through `console_scripts`), but not yet in $PATH during test + "test_uncurl_addurl_unredirected" + "test_uncurl" + "test_uncurl_ria_access" + "test_uncurl_store" + "test_uncurl_remove" + "test_uncurl_testremote" + "test_replace_add_archive_content" + "test_annex_remote" + "test_export_remote" + "test_annex_remote_autorepush" + "test_export_remote_autorepush" + "test_typeweb_annex" + "test_typeweb_annex_uncompressed" + "test_typeweb_export" + "test_submodule_url" + "test_uncurl_progress_reporting_to_annex" + "test_archivist_retrieval" + "test_archivist_retrieval_legacy" + + # hardcoded /bin path + "test_auto_if_wanted_data_transfer_path_restriction" + + # requires internet access + "test_push_wanted" + "test_auto_data_transfer" + "test_http_url_operations" + "test_transparent_decompression" + "test_compressed_file_stay_compressed" + "test_ls_file_collection_tarfile" + "test_iter_tar" + ]; + + disabledTestPaths = [ + # requires internet access + "datalad_next/commands/tests/test_download.py" + "datalad_next/archive_operations/tests/test_tarfile.py" + ]; + pythonImportsCheck = [ "datalad_next" ]; + + meta = { + description = "DataLad extension with a staging area for additional functionality, or for improved performance and user experience"; + changelog = "https://github.com/datalad/datalad-next/blob/main/CHANGELOG.md"; + homepage = "https://github.com/datalad/datalad-next"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ gador ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ddaa073d14db..2a7d840a6097 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2835,6 +2835,8 @@ self: super: with self; { inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration; }; + datalad-next = callPackage ../development/python-modules/datalad-next { }; + datamodeldict = callPackage ../development/python-modules/datamodeldict { }; datapoint = callPackage ../development/python-modules/datapoint { }; From f056e15e331959384990ac16630f1c7c01c87060 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 23 Jul 2024 14:30:42 +0200 Subject: [PATCH 4/8] datalad-gooey: init at unstable-2024-02-20 Signed-off-by: Florian Brandes --- pkgs/by-name/da/datalad-gooey/package.nix | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pkgs/by-name/da/datalad-gooey/package.nix diff --git a/pkgs/by-name/da/datalad-gooey/package.nix b/pkgs/by-name/da/datalad-gooey/package.nix new file mode 100644 index 000000000000..cab391b8dbcf --- /dev/null +++ b/pkgs/by-name/da/datalad-gooey/package.nix @@ -0,0 +1,58 @@ +{ + lib, + datalad, + git, + python3, + fetchFromGitHub, + fetchpatch, + darwin, + stdenv, + git-annex, +}: + +python3.pkgs.buildPythonApplication { + pname = "datalad-gooey"; + # many bug fixes on `master` but no new release + version = "unstable-2024-02-20"; + pyproject = true; + + src = fetchFromGitHub { + owner = "datalad"; + repo = "datalad-gooey"; + rev = "5bd6b9257ff1569439d2a77663271f5d665e61b6"; + hash = "sha256-8779SLcV4wwJ3124lteGzvimDxgijyxa818ZrumPMs4="; + }; + + build-system = with python3.pkgs; [ setuptools ]; + + dependencies = with python3.pkgs; [ + pyside6 + pyqtdarktheme + datalad-next + outdated + datalad + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppleScriptKit ]; + + pythonRemoveDeps = [ "applescript" ]; + + preCheck = '' + export HOME=$TMPDIR + ''; + + nativeCheckInputs = [ + python3.pkgs.pytestCheckHook + python3.pkgs.pytest-qt + git + git-annex + ]; + + pythonImportsCheck = [ "datalad_gooey" ]; + + meta = { + description = "Graphical user interface (GUI) for DataLad"; + homepage = "https://github.com/datalad/datalad-gooey"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ gador ]; + mainProgram = "datalad-gooey"; + }; +} From 2f83bdcfa798091a6f0fe0259530caba5f4887e7 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 30 Jul 2024 08:26:30 +0200 Subject: [PATCH 5/8] datalad: move to python-modules This move is necessarry to next introduce python311 compat Signed-off-by: Florian Brandes --- pkgs/by-name/da/datalad-gooey/package.nix | 1 - .../python-modules}/datalad/default.nix | 59 +++++++++++++++---- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 + 4 files changed, 52 insertions(+), 12 deletions(-) rename pkgs/{applications/version-management => development/python-modules}/datalad/default.nix (84%) diff --git a/pkgs/by-name/da/datalad-gooey/package.nix b/pkgs/by-name/da/datalad-gooey/package.nix index cab391b8dbcf..c24bd27c87d7 100644 --- a/pkgs/by-name/da/datalad-gooey/package.nix +++ b/pkgs/by-name/da/datalad-gooey/package.nix @@ -1,6 +1,5 @@ { lib, - datalad, git, python3, fetchFromGitHub, diff --git a/pkgs/applications/version-management/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix similarity index 84% rename from pkgs/applications/version-management/datalad/default.nix rename to pkgs/development/python-modules/datalad/default.nix index f9c3ac400d72..71e1fbefb82c 100644 --- a/pkgs/applications/version-management/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -1,17 +1,55 @@ { + buildPythonPackage, lib, + setuptools, stdenv, fetchFromGitHub, installShellFiles, - python3, git, + coreutils, + # core + platformdirs, + chardet, + iso8601, + humanize, + fasteners, + packaging, + patool, + tqdm, + annexremote, + looseversion, git-annex, + # downloaders + boto3, + keyrings-alt, + keyring, + msgpack, + requests, + # publish + python-gitlab, + # misc + argcomplete, + pyperclip, + python-dateutil, + # duecredit + duecredit, + # python>=3.8 + distro, + # win + colorama, + # python-version-dependent + pythonOlder, + importlib-resources, + importlib-metadata, + typing-extensions, + # tests + pytestCheckHook, p7zip, curl, - coreutils, + httpretty, }: -python3.pkgs.buildPythonApplication rec { +buildPythonPackage rec { pname = "datalad"; version = "1.1.1"; @@ -32,10 +70,9 @@ python3.pkgs.buildPythonApplication rec { git ]; - build-system = [ python3.pkgs.setuptools ]; + build-system = [ setuptools ]; dependencies = - with python3.pkgs; [ # core platformdirs @@ -68,15 +105,17 @@ python3.pkgs.buildPythonApplication rec { 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 ]; + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; postInstall = '' installShellCompletion --cmd datalad \ @@ -180,10 +219,10 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = [ p7zip - python3.pkgs.pytestCheckHook + pytestCheckHook git-annex curl - python3.pkgs.httpretty + httpretty ]; pythonImportsCheck = [ "datalad" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ed2d671e0b6e..3ef5eb8a70bc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2183,7 +2183,7 @@ with pkgs; conform = callPackage ../applications/version-management/conform { }; - datalad = callPackage ../applications/version-management/datalad { }; + datalad = with python3Packages; toPythonApplication datalad; darcs-to-git = callPackage ../applications/version-management/darcs-to-git { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2a7d840a6097..b92cb57f4c6e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2835,6 +2835,8 @@ self: super: with self; { inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration; }; + datalad = callPackage ../development/python-modules/datalad { }; + datalad-next = callPackage ../development/python-modules/datalad-next { }; datamodeldict = callPackage ../development/python-modules/datamodeldict { }; From db44236e1dc92f67cda22c0f0eec4b25417b7003 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Wed, 31 Jul 2024 18:38:35 +0200 Subject: [PATCH 6/8] datalad: Python3.11 compat remove vendored versioneer and replace with nixpkgs version Signed-off-by: Florian Brandes --- pkgs/development/python-modules/datalad/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index 71e1fbefb82c..8d6d7b4ce3b1 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -7,6 +7,7 @@ installShellFiles, git, coreutils, + versioneer, # core platformdirs, chardet, @@ -63,6 +64,8 @@ buildPythonPackage rec { postPatch = '' substituteInPlace datalad/distribution/create_sibling.py \ --replace-fail "/bin/ls" "${coreutils}/bin/ls" + # Remove vendorized versioneer.py + rm versioneer.py ''; nativeBuildInputs = [ @@ -70,7 +73,10 @@ buildPythonPackage rec { git ]; - build-system = [ setuptools ]; + build-system = [ + setuptools + versioneer + ]; dependencies = [ From 5daabc568f91cc4a569f40181a95151ea19a654e Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Wed, 31 Jul 2024 18:39:17 +0200 Subject: [PATCH 7/8] datalad-gooey: move to Python packages datalad-gooey expoes a module system. Therefore we move it to python-modules. Signed-off-by: Florian Brandes --- .../python-modules/datalad-gooey/default.nix} | 21 ++++++++++++------- pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 2 ++ 3 files changed, 18 insertions(+), 7 deletions(-) rename pkgs/{by-name/da/datalad-gooey/package.nix => development/python-modules/datalad-gooey/default.nix} (80%) diff --git a/pkgs/by-name/da/datalad-gooey/package.nix b/pkgs/development/python-modules/datalad-gooey/default.nix similarity index 80% rename from pkgs/by-name/da/datalad-gooey/package.nix rename to pkgs/development/python-modules/datalad-gooey/default.nix index c24bd27c87d7..a84e6c7a2be7 100644 --- a/pkgs/by-name/da/datalad-gooey/package.nix +++ b/pkgs/development/python-modules/datalad-gooey/default.nix @@ -1,15 +1,22 @@ { + buildPythonPackage, lib, git, - python3, fetchFromGitHub, - fetchpatch, darwin, + setuptools, stdenv, git-annex, + pyside6, + pyqtdarktheme, + datalad-next, + outdated, + datalad, + pytestCheckHook, + pytest-qt, }: -python3.pkgs.buildPythonApplication { +buildPythonPackage { pname = "datalad-gooey"; # many bug fixes on `master` but no new release version = "unstable-2024-02-20"; @@ -22,9 +29,9 @@ python3.pkgs.buildPythonApplication { hash = "sha256-8779SLcV4wwJ3124lteGzvimDxgijyxa818ZrumPMs4="; }; - build-system = with python3.pkgs; [ setuptools ]; + build-system = [ setuptools ]; - dependencies = with python3.pkgs; [ + dependencies = [ pyside6 pyqtdarktheme datalad-next @@ -39,8 +46,8 @@ python3.pkgs.buildPythonApplication { ''; nativeCheckInputs = [ - python3.pkgs.pytestCheckHook - python3.pkgs.pytest-qt + pytestCheckHook + pytest-qt git git-annex ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3ef5eb8a70bc..96ff9ea24f4d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2185,6 +2185,8 @@ with pkgs; datalad = with python3Packages; toPythonApplication datalad; + datalad-gooey = with python3Packages; toPythonApplication datalad-gooey; + darcs-to-git = callPackage ../applications/version-management/darcs-to-git { }; degit = callPackage ../applications/version-management/degit { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b92cb57f4c6e..57d4f38b4c67 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2837,6 +2837,8 @@ self: super: with self; { datalad = callPackage ../development/python-modules/datalad { }; + datalad-gooey = callPackage ../development/python-modules/datalad-gooey { }; + datalad-next = callPackage ../development/python-modules/datalad-next { }; datamodeldict = callPackage ../development/python-modules/datamodeldict { }; From e89304a6e803e0dfb4165fc59815732228603629 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Wed, 31 Jul 2024 18:20:08 +0200 Subject: [PATCH 8/8] python312Packages.datalad-next: remove vendored versioneer Signed-off-by: Florian Brandes --- .../python-modules/datalad-next/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/datalad-next/default.nix b/pkgs/development/python-modules/datalad-next/default.nix index 23192114502f..19b651db3ac6 100644 --- a/pkgs/development/python-modules/datalad-next/default.nix +++ b/pkgs/development/python-modules/datalad-next/default.nix @@ -14,6 +14,7 @@ setuptools, openssh, unzip, + versioneer, webdavclient3, }: @@ -29,9 +30,17 @@ buildPythonPackage rec { hash = "sha256-fqP6nG2ncDRg48kvlsmPjNBOzfQp9+7wTcGvsYVrRzA="; }; + postPatch = '' + # Remove vendorized versioneer.py + rm versioneer.py + ''; + nativeBuildInputs = [ git ]; - build-system = [ setuptools ]; + build-system = [ + setuptools + versioneer + ]; dependencies = [ annexremote