python3Packages.cattrs: 1.1.2 -> 1.7.0

This commit is contained in:
Fabian Affolter 2021-07-04 00:02:07 +02:00
parent f69aae0bcb
commit cb1c6efd08

View File

@ -1,27 +1,70 @@
{ lib
, attrs
, bson
, buildPythonPackage
, fetchFromGitHub
, hypothesis
, immutables
, msgpack
, poetry-core
, pytestCheckHook
, pyyaml
, tomlkit
, ujson
}:
buildPythonPackage rec {
pname = "cattrs";
version = "1.1.2";
version = "1.7.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "Tinche";
repo = pname;
rev = "v${version}";
sha256 = "083d5mi6x7qcl26wlvwwn7gsp5chxlxkh4rp3a41w8cfwwr3h6l8";
sha256 = "sha256-7F4S4IeApbULXhkEZ0oab3Y7sk20Ag2fCYxsyi4WbWw=";
};
propagatedBuildInputs = [ attrs ];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
attrs
];
checkInputs = [
bson
hypothesis
immutables
msgpack
pytestCheckHook
pyyaml
tomlkit
ujson
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warmup-iterations=5 --benchmark-group-by=fullname" ""
substituteInPlace pyproject.toml \
--replace 'orjson = "^3.5.2"' ""
substituteInPlace tests/test_preconf.py \
--replace "from orjson import dumps as orjson_dumps" "" \
--replace "from orjson import loads as orjson_loads" ""
'';
disabledTestPaths = [
# Don't run benchmarking tests
"bench/test_attrs_collections.py"
"bench/test_attrs_nested.py"
"bench/test_attrs_primitives.py"
"bench/test_primitives.py"
];
disabledTests = [
# orjson is not available as it requires Rust nightly features to compile its requirements
"test_orjson"
];
pythonImportsCheck = [ "cattr" ];