From e3dec2e789cd81964dec8cd1ef985332dea907a3 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Mon, 21 Nov 2022 11:37:55 -0800 Subject: [PATCH 1/2] python{27,310}Packages.deprecation: constrain unittest2 to python2 --- .../python-modules/deprecation/default.nix | 16 +++++----------- .../python2-modules/deprecation/default.nix | 7 +++++++ pkgs/top-level/python2-packages.nix | 4 ++++ 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 pkgs/development/python2-modules/deprecation/default.nix diff --git a/pkgs/development/python-modules/deprecation/default.nix b/pkgs/development/python-modules/deprecation/default.nix index 0e15f2d74c612..e32e8cc5df062 100644 --- a/pkgs/development/python-modules/deprecation/default.nix +++ b/pkgs/development/python-modules/deprecation/default.nix @@ -1,10 +1,8 @@ -{ lib, buildPythonPackage, fetchPypi +{ lib +, buildPythonPackage +, fetchPypi , fetchpatch , packaging -, python -, pythonAtLeast -, pythonOlder -, unittest2 , unittestCheckHook }: @@ -17,7 +15,7 @@ buildPythonPackage rec { sha256 = "1zqqjlgmhgkpzg9ss5ki8wamxl83xn51fs6gn2a8cxsx9vkbvcvj"; }; - patches = lib.optionals (pythonAtLeast "3.10") [ + patches = [ # fixes for python 3.10 test suite (fetchpatch { url = "https://github.com/briancurtin/deprecation/pull/57/commits/e13e23068cb8d653a02a434a159e8b0b7226ffd6.patch"; @@ -28,11 +26,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ packaging ]; - # avoiding mass rebuilds for python3.9, but no longer - # needed with patch - checkInputs = [ unittestCheckHook ] ++ lib.optionals (pythonOlder "3.10") [ - unittest2 - ]; + checkInputs = [ unittestCheckHook ]; meta = with lib; { description = "A library to handle automated deprecations"; diff --git a/pkgs/development/python2-modules/deprecation/default.nix b/pkgs/development/python2-modules/deprecation/default.nix new file mode 100644 index 0000000000000..8763a066ff8ec --- /dev/null +++ b/pkgs/development/python2-modules/deprecation/default.nix @@ -0,0 +1,7 @@ +{ deprecation, unittest2 }: + +deprecation.overridePythonAttrs (oldAttrs: { + checkInputs = oldAttrs.checkInputs ++ [ + unittest2 + ]; +}) diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index 773f8d860f0a6..bab88db626651 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -27,6 +27,10 @@ with self; with super; { coverage = callPackage ../development/python2-modules/coverage { }; + deprecation = callPackage ../development/python2-modules/deprecation { + inherit deprecation; + }; + enum = callPackage ../development/python2-modules/enum { }; filelock = callPackage ../development/python2-modules/filelock { }; From 119ea0e3ce21a27420312644bc4ea7b6e00f1b5a Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Thu, 1 Dec 2022 09:15:24 -0800 Subject: [PATCH 2/2] python27Packages.deprecation: remove unittest2, break on Python 2 --- pkgs/development/python2-modules/deprecation/default.nix | 7 ------- pkgs/top-level/python2-packages.nix | 4 ---- 2 files changed, 11 deletions(-) delete mode 100644 pkgs/development/python2-modules/deprecation/default.nix diff --git a/pkgs/development/python2-modules/deprecation/default.nix b/pkgs/development/python2-modules/deprecation/default.nix deleted file mode 100644 index 8763a066ff8ec..0000000000000 --- a/pkgs/development/python2-modules/deprecation/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ deprecation, unittest2 }: - -deprecation.overridePythonAttrs (oldAttrs: { - checkInputs = oldAttrs.checkInputs ++ [ - unittest2 - ]; -}) diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index bab88db626651..773f8d860f0a6 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -27,10 +27,6 @@ with self; with super; { coverage = callPackage ../development/python2-modules/coverage { }; - deprecation = callPackage ../development/python2-modules/deprecation { - inherit deprecation; - }; - enum = callPackage ../development/python2-modules/enum { }; filelock = callPackage ../development/python2-modules/filelock { };