From 0f1483d1a261a1f7f9a3ac109a16cdff68312db4 Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sun, 5 Mar 2023 16:50:01 +0530 Subject: [PATCH 1/3] python310Packages.lineedit: init at 0.1.6 --- maintainers/maintainer-list.nix | 6 +++ .../python-modules/lineedit/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/lineedit/default.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 161a6065df87..158bd00285e7 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -13103,6 +13103,12 @@ githubId = 8534888; name = "Savanni D'Gerinel"; }; + savyajha = { + email = "savya.jha@hawkradius.com"; + github = "savyajha"; + githubId = 3996019; + name = "Savyasachee Jha"; + }; sayanarijit = { email = "sayanarijit@gmail.com"; github = "sayanarijit"; diff --git a/pkgs/development/python-modules/lineedit/default.nix b/pkgs/development/python-modules/lineedit/default.nix new file mode 100644 index 000000000000..563105462764 --- /dev/null +++ b/pkgs/development/python-modules/lineedit/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pygments +, six +, wcwidth +, pytestCheckHook +, pyte +, ptyprocess +, pexpect +}: + +buildPythonPackage rec { + pname = "lineedit"; + version = "0.1.6"; + + src = fetchFromGitHub { + owner = "randy3k"; + repo = pname; + rev = "v${version}"; + sha256 = "fq2NpjIQkIq1yzXEUxi6cz80kutVqcH6MqJXHtpTFsk="; + }; + + propagatedBuildInputs = [ + pygments + six + wcwidth + ]; + + nativeCheckInputs = [ + pytestCheckHook + pyte + pexpect + ptyprocess + ]; + + pythonImportsCheck = [ "lineedit" ]; + + meta = with lib; { + description = "A readline library based on prompt_toolkit which supports multiple modes"; + homepage = "https://github.com/randy3k/lineedit"; + license = licenses.mit; + maintainers = with maintainers; [ savyajha ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f09a8eb1a188..59947512aeb4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5492,6 +5492,8 @@ self: super: with self; { linecache2 = callPackage ../development/python-modules/linecache2 { }; + lineedit = callPackage ../development/python-modules/lineedit { }; + line_profiler = callPackage ../development/python-modules/line_profiler { }; lingua = callPackage ../development/python-modules/lingua { }; From 73f2d0074aa039a40fd11ffcce6495568528c56e Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sun, 5 Mar 2023 19:11:34 +0530 Subject: [PATCH 2/3] python310Packages.rchitect: init at 0.3.40 --- .../python-modules/rchitect/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/rchitect/default.nix diff --git a/pkgs/development/python-modules/rchitect/default.nix b/pkgs/development/python-modules/rchitect/default.nix new file mode 100644 index 000000000000..9e0b1b48d29d --- /dev/null +++ b/pkgs/development/python-modules/rchitect/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, cffi +, six +, pytestCheckHook +, pytest-mock +, R +, rPackages }: + +buildPythonPackage rec { + pname = "rchitect"; + version = "0.3.40"; + + src = fetchFromGitHub { + owner = "randy3k"; + repo = pname; + rev = "v${version}"; + sha256 = "yJMiPmusZ62dd6+5VkA2uSjq57a0C3arG8CgiUUHKpk="; + }; + + postPatch = '' + substituteInPlace setup.py --replace '"pytest-runner"' "" + ''; + + propagatedBuildInputs = [ + cffi + six + ] ++ (with rPackages; [ + reticulate + ]); + + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + R + ]; + + preCheck = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R}/lib/R/lib + cd $TMPDIR + ''; + + pythonImportsCheck = [ "rchitect" ]; + + meta = with lib; { + description = "Interoperate R with Python"; + homepage = "https://github.com/randy3k/rchitect"; + license = licenses.mit; + maintainers = with maintainers; [ savyajha ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 59947512aeb4..4a3f3a4ceffb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9887,6 +9887,8 @@ self: super: with self; { rbtools = callPackage ../development/python-modules/rbtools { }; + rchitect = callPackage ../development/python-modules/rchitect { }; + rcssmin = callPackage ../development/python-modules/rcssmin { }; rdflib = callPackage ../development/python-modules/rdflib { }; From e730867dc051f9f9f6bd0b641838a24b74cad4c8 Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sun, 5 Mar 2023 19:12:32 +0530 Subject: [PATCH 3/3] python310Packages.radian: init at 0.6.4 and provide radianWrapper --- .../python-modules/radian/default.nix | 71 +++++++++++++++++++ pkgs/development/r-modules/wrapper-radian.nix | 37 ++++++++++ pkgs/top-level/all-packages.nix | 13 ++++ pkgs/top-level/python-packages.nix | 2 + 4 files changed, 123 insertions(+) create mode 100644 pkgs/development/python-modules/radian/default.nix create mode 100644 pkgs/development/r-modules/wrapper-radian.nix diff --git a/pkgs/development/python-modules/radian/default.nix b/pkgs/development/python-modules/radian/default.nix new file mode 100644 index 000000000000..d348c6e0c561 --- /dev/null +++ b/pkgs/development/python-modules/radian/default.nix @@ -0,0 +1,71 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pyte +, pexpect +, ptyprocess +, jedi +, git +, lineedit +, prompt-toolkit +, pygments +, rchitect +, six +, R +, rPackages +}: + +buildPythonPackage rec { + pname = "radian"; + version = "0.6.4"; + + src = fetchFromGitHub { + owner = "randy3k"; + repo = pname; + rev = "v${version}"; + sha256 = "QEHVdyVgsZxvs+d+xeeJqwx531+6e0uPi1J3t+hJ0d0="; + }; + + postPatch = '' + substituteInPlace setup.py --replace '"pytest-runner"' "" + ''; + + nativeBuildInputs = [ + R # needed at setup time to detect R_HOME + ]; + + propagatedBuildInputs = [ + lineedit + prompt-toolkit + pygments + rchitect + six + ] ++ (with rPackages; [ + reticulate + askpass + ]); + + nativeCheckInputs = [ + pytestCheckHook + pyte + pexpect + ptyprocess + jedi + git + ]; + + preCheck = '' + export HOME=$TMPDIR + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${R}/lib/R/lib + ''; + + pythonImportsCheck = [ "radian" ]; + + meta = with lib; { + description = "A 21 century R console"; + homepage = "https://github.com/randy3k/radian"; + license = licenses.mit; + maintainers = with maintainers; [ savyajha ]; + }; +} diff --git a/pkgs/development/r-modules/wrapper-radian.nix b/pkgs/development/r-modules/wrapper-radian.nix new file mode 100644 index 000000000000..a0a23222b523 --- /dev/null +++ b/pkgs/development/r-modules/wrapper-radian.nix @@ -0,0 +1,37 @@ +{ lib +, runCommand +, R +, radian +, makeWrapper +, recommendedPackages +, packages +, wrapR ? false +}: + +runCommand (radian.name + "-wrapper") { + preferLocalBuild = true; + allowSubstitutes = false; + + buildInputs = [ radian ] ++ recommendedPackages ++ packages + ++ lib.optional wrapR R; + + nativeBuildInputs = [ makeWrapper ]; + + passthru = { inherit recommendedPackages; }; + + meta = radian.meta // { + # To prevent builds on hydra + hydraPlatforms = [ ]; + # prefer wrapper over the package + priority = (radian.meta.priority or 0) - 1; + }; +} ('' + makeWrapper "${radian}/bin/radian" "$out/bin/radian" \ + --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE" +'' + lib.optionalString wrapR '' + cd ${R}/bin + for exe in *; do + makeWrapper "${R}/bin/$exe" "$out/bin/$exe" \ + --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE" + done +'') diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fe53012194ed..0bde921a49f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24218,6 +24218,19 @@ with pkgs; packages = []; }; + radianWrapper = callPackage ../development/r-modules/wrapper-radian.nix { + recommendedPackages = with rPackages; [ + boot class cluster codetools foreign KernSmooth lattice MASS + Matrix mgcv nlme nnet rpart spatial survival + ]; + radian = python3Packages.radian; + # Override this attribute to register additional libraries. + packages = []; + # Override this attribute if you want to expose R with the same set of + # packages as specified in radian + wrapR = false; + }; + rstudioWrapper = libsForQt5.callPackage ../development/r-modules/wrapper-rstudio.nix { recommendedPackages = with rPackages; [ boot class cluster codetools foreign KernSmooth lattice MASS diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4a3f3a4ceffb..d3c376a55ac0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9841,6 +9841,8 @@ self: super: with self; { radicale = pkgs.radicale.override { python3 = python; }; }; + radian = callPackage ../development/python-modules/radian { }; + radio_beam = callPackage ../development/python-modules/radio_beam { }; radios = callPackage ../development/python-modules/radios { };