From d62a3558843daf869ecd1a608cfba7a7439e1b30 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Thu, 14 Jun 2018 10:25:14 +0900 Subject: [PATCH 1/3] pythonPackages.wcwith: 0.1.6 -> 0.1.7 --- .../python-modules/wcwidth/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 25 +----------------- 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/python-modules/wcwidth/default.nix diff --git a/pkgs/development/python-modules/wcwidth/default.nix b/pkgs/development/python-modules/wcwidth/default.nix new file mode 100644 index 000000000000..fa993c593e1a --- /dev/null +++ b/pkgs/development/python-modules/wcwidth/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, buildPythonPackage }: + +buildPythonPackage rec { + name = "wcwidth-${version}"; + version = "0.1.7"; + + src = fetchurl { + url = "mirror://pypi/w/wcwidth/${name}.tar.gz"; + sha256 = "0pn6dflzm609m4r3i8ik5ni9ijjbb5fa3vg1n7hn6vkd49r77wrx"; + }; + + # Checks fail due to missing tox.ini file: + doCheck = false; + + meta = with stdenv.lib; { + description = "Measures number of Terminal column cells of wide-character codes"; + longDescription = '' + This API is mainly for Terminal Emulator implementors -- any Python + program that attempts to determine the printable width of a string on + a Terminal. It is implemented in python (no C library calls) and has + no 3rd-party dependencies. + ''; + homepage = https://github.com/jquast/wcwidth; + license = licenses.mit; + }; + } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5c694f4d801b..7fe5f9f9ffca 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14845,30 +14845,7 @@ EOF imagemagick = pkgs.imagemagickBig; }; - wcwidth = buildPythonPackage rec { - name = "wcwidth-${version}"; - version = "0.1.6"; - - src = pkgs.fetchurl { - url = "mirror://pypi/w/wcwidth/${name}.tar.gz"; - sha256 = "02wjrpf001gjdjsaxxbzcwfg19crlk2dbddayrfc2v06f53yrcyw"; - }; - - # Checks fail due to missing tox.ini file: - doCheck = false; - - meta = { - description = "Measures number of Terminal column cells of wide-character codes"; - longDescription = '' - This API is mainly for Terminal Emulator implementors -- any Python - program that attempts to determine the printable width of a string on - a Terminal. It is implemented in python (no C library calls) and has - no 3rd-party dependencies. - ''; - homepage = https://github.com/jquast/wcwidth; - license = licenses.mit; - }; - }; + wcwidth = callPackage ../development/python-modules/wcwidth { }; web = buildPythonPackage rec { version = "0.37"; From bb47fd0fece6cc95bbf0791d38af4929a6e2147c Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Thu, 14 Jun 2018 10:25:58 +0900 Subject: [PATCH 2/3] python3Packages.cmd2: 0.8.0 -> 0.9.1 --- .../python-modules/cmd2/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/cmd2/default.nix b/pkgs/development/python-modules/cmd2/default.nix index 5ffa51def0d2..e83fd4163e4a 100644 --- a/pkgs/development/python-modules/cmd2/default.nix +++ b/pkgs/development/python-modules/cmd2/default.nix @@ -1,17 +1,15 @@ -{ stdenv, fetchPypi, buildPythonPackage, pythonOlder -, pyperclip, six, pyparsing, vim +{ stdenv, fetchPypi, buildPythonPackage, pythonOlder, isPy3k +, pyperclip, six, pyparsing, vim, wcwidth, colorama , contextlib2 ? null, subprocess32 ? null , pytest, mock, which, fetchFromGitHub, glibcLocales }: buildPythonPackage rec { pname = "cmd2"; - version = "0.8.0"; + version = "0.9.1"; - src = fetchFromGitHub { - owner = "python-cmd2"; - repo = "cmd2"; - rev = version; - sha256 = "0nw2b7n7zg51bc3glxw0l9fn91mwjnjshklhmxhyvjbsg7khf64z"; + src = fetchPypi { + inherit pname version; + sha256 = "1wpw4f9zix30hfncm0hwxjjdx78zq26x3r8s9nvsq9vnxf41xb49"; }; LC_ALL="en_US.UTF-8"; @@ -31,14 +29,16 @@ buildPythonPackage rec { py.test -k 'not test_path_completion_user_expansion' ''; doCheck = !stdenv.isDarwin; + disabled = !isPy3k; propagatedBuildInputs = [ + colorama pyperclip six pyparsing + wcwidth ] ++ stdenv.lib.optional (pythonOlder "3.5") contextlib2 - ++ stdenv.lib.optional (pythonOlder "3.0") subprocess32 ; meta = with stdenv.lib; { From 65b15ba6a96760125cc3984893f587af1ffacaac Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Fri, 15 Jun 2018 03:42:45 +0900 Subject: [PATCH 3/3] pythonPackages.cmd2: keep 0.8 version ...which is the last one with python2 support until ~ august 2018 --- pkgs/development/python-modules/cmd2/old.nix | 49 ++++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/cmd2/old.nix diff --git a/pkgs/development/python-modules/cmd2/old.nix b/pkgs/development/python-modules/cmd2/old.nix new file mode 100644 index 000000000000..5ffa51def0d2 --- /dev/null +++ b/pkgs/development/python-modules/cmd2/old.nix @@ -0,0 +1,49 @@ +{ stdenv, fetchPypi, buildPythonPackage, pythonOlder +, pyperclip, six, pyparsing, vim +, contextlib2 ? null, subprocess32 ? null +, pytest, mock, which, fetchFromGitHub, glibcLocales +}: +buildPythonPackage rec { + pname = "cmd2"; + version = "0.8.0"; + + src = fetchFromGitHub { + owner = "python-cmd2"; + repo = "cmd2"; + rev = version; + sha256 = "0nw2b7n7zg51bc3glxw0l9fn91mwjnjshklhmxhyvjbsg7khf64z"; + }; + + LC_ALL="en_US.UTF-8"; + + postPatch = stdenv.lib.optional stdenv.isDarwin '' + # Fake the impure dependencies pbpaste and pbcopy + mkdir bin + echo '#/bin/sh' > bin/pbpaste + echo '#/bin/sh' > bin/pbcopy + chmod +x bin/{pbcopy,pbpaste} + export PATH=$(realpath bin):$PATH + ''; + + checkInputs= [ pytest mock which vim glibcLocales ]; + checkPhase = '' + # test_path_completion_user_expansion might be fixed in the next release + py.test -k 'not test_path_completion_user_expansion' + ''; + doCheck = !stdenv.isDarwin; + + propagatedBuildInputs = [ + pyperclip + six + pyparsing + ] + ++ stdenv.lib.optional (pythonOlder "3.5") contextlib2 + ++ stdenv.lib.optional (pythonOlder "3.0") subprocess32 + ; + + meta = with stdenv.lib; { + description = "Enhancements for standard library's cmd module"; + homepage = https://github.com/python-cmd2/cmd2; + maintainers = with maintainers; [ teto ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7fe5f9f9ffca..e16bb977fae2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9142,7 +9142,9 @@ in { cachetools_1 = callPackage ../development/python-modules/cachetools/1.nix {}; cachetools = callPackage ../development/python-modules/cachetools {}; - cmd2 = callPackage ../development/python-modules/cmd2 {}; + cmd2_8 = callPackage ../development/python-modules/cmd2/old.nix {}; + cmd2_9 = callPackage ../development/python-modules/cmd2 {}; + cmd2 = if isPy27 then self.cmd2_8 else self.cmd2_9; warlock = buildPythonPackage rec { name = "warlock-${version}";