2018-11-26 20:21:05 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-07-13 10:20:00 +01:00
|
|
|
, fetchpatch
|
2018-11-26 20:21:05 +00:00
|
|
|
, fetchPypi
|
|
|
|
, hopcroftkarp
|
|
|
|
, multiset
|
2019-07-13 10:20:00 +01:00
|
|
|
, pytest
|
2018-11-26 20:21:05 +00:00
|
|
|
, pytestrunner
|
|
|
|
, hypothesis
|
|
|
|
, setuptools_scm
|
2018-11-27 16:52:21 +00:00
|
|
|
, isPy27
|
2018-11-26 20:21:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "matchpy";
|
2019-06-08 15:23:27 +01:00
|
|
|
version = "0.5.1";
|
2018-11-27 16:52:21 +00:00
|
|
|
disabled = isPy27;
|
2018-11-26 20:21:05 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-06-08 15:23:27 +01:00
|
|
|
sha256 = "1vvf1cd9kw5z1mzvypc9f030nd18lgvvjc8j56b1s9b7dyslli2r";
|
2018-11-26 20:21:05 +00:00
|
|
|
};
|
|
|
|
|
2019-07-13 10:20:00 +01:00
|
|
|
patches = [
|
|
|
|
# Fix tests for pytest 4. Remove with the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/HPAC/matchpy/commit/b405a2717a7793d58c47b2e2197d9d00c06fb13c.patch";
|
|
|
|
includes = [ "tests/conftest.py" ];
|
|
|
|
sha256 = "1b6gqf2vy9qxg384nqr9k8il335afhbdmlyx4vhd8r8rqpv7gax9";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-06-08 15:23:27 +01:00
|
|
|
postPatch = ''
|
2019-07-13 10:20:00 +01:00
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "hypothesis>=3.6,<4.0" "hypothesis" \
|
|
|
|
--replace "pytest>=3.0,<4.0" "pytest"
|
2019-06-08 15:23:27 +01:00
|
|
|
'';
|
|
|
|
|
2018-11-26 20:21:05 +00:00
|
|
|
buildInputs = [ setuptools_scm pytestrunner ];
|
2019-07-13 10:20:00 +01:00
|
|
|
checkInputs = [ pytest hypothesis ];
|
2018-11-26 20:21:05 +00:00
|
|
|
propagatedBuildInputs = [ hopcroftkarp multiset ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A library for pattern matching on symbolic expressions";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/HPAC/matchpy";
|
2018-11-26 20:21:05 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|