Merge pull request #154999 from fabaff/fix-attrdict

python3Packages.attrdict: refactor for Python 3.10
This commit is contained in:
Fabian Affolter 2022-01-14 14:32:12 +01:00 committed by GitHub
commit a9e4765357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 13 deletions

View File

@ -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; [ ];
};
}

View File

@ -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 ];
};
}