summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Schütz <rschuetz17@gmail.com>2018-08-07 10:49:37 +0200
committerGitHub <noreply@github.com>2018-08-07 10:49:37 +0200
commit746aae0e5581e9a26ea7d8feb423fb213a80a187 (patch)
tree3023f8bff179b9a0dd554494bed6e637487566d5 /pkgs
parent0359f150cd6704c3412275dd7e0a0e82f33deb93 (diff)
parente9cb147a3791c847958f89a11d03e64a9c7fd77d (diff)
downloadnixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar.gz
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar.bz2
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar.lz
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar.xz
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.tar.zst
nixlib-746aae0e5581e9a26ea7d8feb423fb213a80a187.zip
Merge pull request #44571 from kalbasit/nixpkgs-update-mycli
mycli: 1.6.0 -> 1.17.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/cli-helpers/default.nix59
-rw-r--r--pkgs/development/python-modules/pymysql/default.nix27
-rw-r--r--pkgs/tools/admin/mycli/default.nix23
-rw-r--r--pkgs/top-level/python-packages.nix23
4 files changed, 103 insertions, 29 deletions
diff --git a/pkgs/development/python-modules/cli-helpers/default.nix b/pkgs/development/python-modules/cli-helpers/default.nix
new file mode 100644
index 000000000000..69b811a94f4f
--- /dev/null
+++ b/pkgs/development/python-modules/cli-helpers/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, terminaltables
+, tabulate
+, backports_csv
+, wcwidth
+, pytest
+, isPy27
+}:
+
+buildPythonPackage rec {
+  pname = "cli_helpers";
+  version = "1.0.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1z5rqm8pznj6bvivm2al8rsxm82rai8hc9bqrgh3ksnbzg2kfy7p";
+  };
+
+  propagatedBuildInputs = [
+    terminaltables
+    tabulate
+    wcwidth
+  ] ++ (lib.optionals isPy27 [ backports_csv ]);
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = with lib; {
+    description = "Python helpers for common CLI tasks";
+    longDescription = ''
+      CLI Helpers is a Python package that makes it easy to perform common
+      tasks when building command-line apps. It's a helper library for
+      command-line interfaces.
+
+      Libraries like Click and Python Prompt Toolkit are amazing tools that
+      help you create quality apps. CLI Helpers complements these libraries by
+      wrapping up common tasks in simple interfaces.
+
+      CLI Helpers is not focused on your app's design pattern or framework --
+      you can use it on its own or in combination with other libraries. It's
+      lightweight and easy to extend.
+
+      What's included in CLI Helpers?
+
+      - Prettyprinting of tabular data with custom pre-processing
+      - [in progress] config file reading/writing
+
+      Read the documentation at http://cli-helpers.rtfd.io
+    '';
+    homepage = https://cli-helpers.readthedocs.io/en/stable/;
+    license = licenses.bsd3 ;
+    maintainers = [ maintainers.kalbasit ];
+  };
+}
diff --git a/pkgs/development/python-modules/pymysql/default.nix b/pkgs/development/python-modules/pymysql/default.nix
new file mode 100644
index 000000000000..b440df309977
--- /dev/null
+++ b/pkgs/development/python-modules/pymysql/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, cryptography
+}:
+
+buildPythonPackage rec {
+  pname = "PyMySQL";
+  version = "0.9.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0gvi63f1zq1bbd30x28kqyx351hal1yc323ckp0mihainb5n1iwy";
+  };
+
+  propagatedBuildInputs = [ cryptography ];
+
+  # Wants to connect to MySQL
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Pure Python MySQL Client";
+    homepage = https://github.com/PyMySQL/PyMySQL;
+    license = licenses.mit;
+    maintainers = [ maintainers.kalbasit ];
+  };
+}
diff --git a/pkgs/tools/admin/mycli/default.nix b/pkgs/tools/admin/mycli/default.nix
index 1a85bf21b224..d01dca459591 100644
--- a/pkgs/tools/admin/mycli/default.nix
+++ b/pkgs/tools/admin/mycli/default.nix
@@ -1,28 +1,31 @@
 { lib
-, python
+, python3
+, glibcLocales
 }:
 
-with python.pkgs;
+with python3.pkgs;
 
 buildPythonApplication rec {
   pname = "mycli";
-  version = "1.6.0";
+  version = "1.17.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0qg4b62kizyb16kk0cvpk70bfs3gg4q4hj2b15nnc7a3gqqfp67j";
+    sha256 = "11d3ssjifms6bid77jk06zl5wl3srihijmv5kggxa0w2l59y8h9m";
   };
 
   propagatedBuildInputs = [
-    pymysql configobj sqlparse prompt_toolkit pygments click pycrypto
+    pymysql configobj sqlparse prompt_toolkit pygments click pycrypto cli-helpers
   ];
 
-  postPatch = ''
-    substituteInPlace setup.py --replace "==" ">="
-  '';
+  checkInputs = [ pytest mock glibcLocales ];
+
+  checkPhase = ''
+    export HOME=.
+    export LC_ALL="en_US.UTF-8"
 
-  # No tests in archive. Newer versions do include tests
-  doCheck = false;
+    py.test
+  '';
 
   meta = {
     inherit version;
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 5be304a1d87f..eb58f67c5970 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -352,6 +352,8 @@ in {
 
   plantuml = callPackage ../tools/misc/plantuml { };
 
+  pymysql = callPackage ../development/python-modules/pymysql { };
+
   Pmw = callPackage ../development/python-modules/Pmw { };
 
   py_stringmatching = callPackage ../development/python-modules/py_stringmatching { };
@@ -1104,6 +1106,8 @@ in {
 
   cheroot = callPackage ../development/python-modules/cheroot {};
 
+  cli-helpers = callPackage ../development/python-modules/cli-helpers {};
+
   cmarkgfm = callPackage ../development/python-modules/cmarkgfm { };
 
   circus = callPackage ../development/python-modules/circus {};
@@ -8097,25 +8101,6 @@ in {
     };
   };
 
-  pymysql = buildPythonPackage rec {
-    name = "pymysql-${version}";
-    version = "0.6.6";
-    src = pkgs.fetchgit {
-      url = https://github.com/PyMySQL/PyMySQL.git;
-      rev = "refs/tags/pymysql-${version}";
-      sha256 = "0kpw11rxpyyhs9b139hxhbnx9n5kzjjw10wgwvhnf9m3mv7j4n71";
-    };
-
-    buildInputs = with self; [ unittest2 ];
-
-    checkPhase = ''
-      ${python.interpreter} runtests.py
-    '';
-
-    # Wants to connect to MySQL
-    doCheck = false;
-  };
-
   pymysqlsa = self.buildPythonPackage rec {
     name = "pymysqlsa-${version}";
     version = "1.0";