summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2022-01-14 14:32:12 +0100
committerGitHub <noreply@github.com>2022-01-14 14:32:12 +0100
commita9e4765357279a4a627d484bcafe22e18ad2dbb1 (patch)
treea7b4b36e0442b0de94dcf98a83084d889aceebb6 /pkgs
parent5f5ffabdb7000bac48124e05be3908ecb814d790 (diff)
parent7ce72f00e69cfb4a0727889f6775c2c78bb9ef4b (diff)
downloadnixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar.gz
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar.bz2
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar.lz
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar.xz
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.tar.zst
nixpkgs-a9e4765357279a4a627d484bcafe22e18ad2dbb1.zip
Merge pull request #154999 from fabaff/fix-attrdict
python3Packages.attrdict: refactor for Python 3.10
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/attrdict/default.nix43
-rw-r--r--pkgs/development/python-modules/wavedrom/default.nix25
2 files changed, 55 insertions, 13 deletions
diff --git a/pkgs/development/python-modules/attrdict/default.nix b/pkgs/development/python-modules/attrdict/default.nix
index cb87b9027f0..3a9834ec865 100644
--- a/pkgs/development/python-modules/attrdict/default.nix
+++ b/pkgs/development/python-modules/attrdict/default.nix
@@ -1,19 +1,56 @@
-{ lib, buildPythonPackage, fetchPypi, coverage, nose, six }:
+{ lib
+, buildPythonPackage
+, fetchPypi
+, coverage
+, pythonOlder
+, nose
+, pytestCheckHook
+, six
+}:
 
 buildPythonPackage rec {
   pname = "attrdict";
   version = "2.0.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "35c90698b55c683946091177177a9e9c0713a0860f0e049febd72649ccd77b70";
+    hash = "sha256-NckGmLVcaDlGCRF3F3qenAcToIYPDgSf69cmSczXe3A=";
   };
 
-  propagatedBuildInputs = [ coverage nose six ];
+  propagatedBuildInputs = [
+    six
+  ];
+
+  checkInputs = [
+    coverage
+    nose
+  ];
+
+  postPatch = ''
+    substituteInPlace attrdict/merge.py \
+      --replace "from collections" "from collections.abc"
+    substituteInPlace attrdict/mapping.py \
+      --replace "from collections" "from collections.abc"
+    substituteInPlace attrdict/default.py \
+      --replace "from collections" "from collections.abc"
+    substituteInPlace attrdict/mixins.py \
+      --replace "from collections" "from collections.abc"
+  '';
+
+  # Tests are not shipped and source is not tagged
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "attrdict"
+  ];
 
   meta = with lib; {
     description = "A dict with attribute-style access";
     homepage = "https://github.com/bcj/AttrDict";
     license = licenses.mit;
+    maintainers = with maintainers; [ ];
   };
 }
diff --git a/pkgs/development/python-modules/wavedrom/default.nix b/pkgs/development/python-modules/wavedrom/default.nix
index 90682936310..d8db35fbdae 100644
--- a/pkgs/development/python-modules/wavedrom/default.nix
+++ b/pkgs/development/python-modules/wavedrom/default.nix
@@ -1,8 +1,8 @@
 { lib
-, buildPythonPackage
-, fetchPypi
 , attrdict
+, buildPythonPackage
 , cairosvg
+, fetchPypi
 , pillow
 , pytestCheckHook
 , setuptools-scm
@@ -14,9 +14,11 @@
 buildPythonPackage rec {
   pname = "wavedrom";
   version = "2.0.3.post2";
+  format = "setuptools";
+
   src = fetchPypi {
     inherit pname version;
-    sha256 = "239b3435ff116b09007d5517eed755fc8591891b7271a1cd40db9e400c02448d";
+    hash = "sha256-I5s0Nf8RawkAfVUX7tdV/IWRiRtycaHNQNueQAwCRI0=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
@@ -32,22 +34,25 @@ buildPythonPackage rec {
   ];
 
   checkInputs = [
+    cairosvg
+    pillow
     pytestCheckHook
     xmldiff
-    pillow
-    cairosvg
   ];
 
   disabledTests = [
-    "test_upstream"  # requires to clone a full git repository
+    # Requires to clone a full git repository
+    "test_upstream"
   ];
 
-  pythonImportsCheck = [ "wavedrom" ];
+  pythonImportsCheck = [
+    "wavedrom"
+  ];
 
-  meta = {
+  meta = with lib; {
     description = "WaveDrom compatible Python command line";
     homepage = "https://github.com/wallento/wavedrompy";
-    license = lib.licenses.mit;
-    maintainers = with lib.maintainers; [ airwoodix ];
+    license = licenses.mit;
+    maintainers = with maintainers; [ airwoodix ];
   };
 }