From 36a68c8e822d458e859ab7b70020cf591281efa4 Mon Sep 17 00:00:00 2001 From: Kevin Cox Date: Fri, 25 Sep 2020 16:29:42 -0400 Subject: [PATCH 1/2] pythonPackages.class-registry: init at 2.1.2 --- .../python-modules/class-registry/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/class-registry/default.nix diff --git a/pkgs/development/python-modules/class-registry/default.nix b/pkgs/development/python-modules/class-registry/default.nix new file mode 100644 index 000000000000..9a3650bceb8b --- /dev/null +++ b/pkgs/development/python-modules/class-registry/default.nix @@ -0,0 +1,30 @@ +{ + buildPythonPackage, + fetchPypi, + lib, + nose, + six, +}: + +buildPythonPackage rec { + pname = "class-registry"; + version = "2.1.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "0zjf9nczl1ifzj07bgs6mwxsfd5xck9l0lchv2j0fv2n481xp2v7"; + }; + + propagatedBuildInputs = [ six ]; + checkInputs = [ nose ]; + + # Tests currently failing. + doCheck = false; + + meta = { + description = "Factory+Registry pattern for Python classes."; + homepage = "https://class-registry.readthedocs.io/en/latest/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ kevincox ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index af2ec27f733b..39aeeecdef5b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1150,6 +1150,8 @@ in { ckcc-protocol = callPackage ../development/python-modules/ckcc-protocol { }; + class-registry = callPackage ../development/python-modules/class-registry { }; + cld2-cffi = callPackage ../development/python-modules/cld2-cffi { }; cleo = callPackage ../development/python-modules/cleo { }; From 28142d6f84b22cbc95b8825cb281b45a5ef26800 Mon Sep 17 00:00:00 2001 From: Kevin Cox Date: Fri, 25 Sep 2020 16:29:52 -0400 Subject: [PATCH 2/2] backblaze-b2: 1.3.8 -> 2.0.2 --- .../tools/backblaze-b2/default.nix | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/pkgs/development/tools/backblaze-b2/default.nix b/pkgs/development/tools/backblaze-b2/default.nix index b1671b098b32..46e54465ab67 100644 --- a/pkgs/development/tools/backblaze-b2/default.nix +++ b/pkgs/development/tools/backblaze-b2/default.nix @@ -1,40 +1,39 @@ -{ lib, buildPythonApplication, fetchFromGitHub -, arrow, futures, logfury, requests, six, tqdm +{ + fetchFromGitHub, + lib, + python3Packages, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "backblaze-b2"; - version = "1.3.8"; + version = "2.0.2"; src = fetchFromGitHub { owner = "Backblaze"; repo = "B2_Command_Line_Tool"; rev = "v${version}"; - sha256 = "1y4z4w6fj92rh9mrjsi0nmnzcmrj5jikarq2vs5qznvjdjm62igw"; + sha256 = "00zs0a580vvfm2w4ja68mc46360p475wlgagjkq1hi4m8s4qwd75"; }; - propagatedBuildInputs = [ arrow futures logfury requests six tqdm ]; + propagatedBuildInputs = with python3Packages; [ + b2sdk + class-registry + setuptools + ]; + checkInputs = with python3Packages; [ + nose + ]; + + # doCheck = false; checkPhase = '' - python test_b2_command_line.py test - ''; - - postPatch = '' - # b2 uses an upper bound on arrow, because arrow 0.12.1 is not - # compatible with Python 2.6: - # - # https://github.com/crsmithdev/arrow/issues/517 - # - # However, since we use Python 2.7, newer versions of arrow are fine. - - sed -i 's/,<0.12.1//g' requirements.txt + nosetests ''; postInstall = '' mv "$out/bin/b2" "$out/bin/backblaze-b2" - sed 's/^_have b2 \&\&$/_have backblaze-b2 \&\&/' -i contrib/bash_completion/b2 - sed 's/^\(complete -F _b2\) b2/\1 backblaze-b2/' -i contrib/bash_completion/b2 + sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2 mkdir -p "$out/etc/bash_completion.d" cp contrib/bash_completion/b2 "$out/etc/bash_completion.d/backblaze-b2"