2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, hopcroftkarp
|
|
|
|
, multiset
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, hypothesis
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
, isPy27
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "matchpy";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.5.5"; # Don't upgrade to 4.3.1, this tag is very old
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "HPAC";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-n5rXIjqVQZzEbfIZVQiGLh2PR1DHAJ9gumcrbvwnasA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
sed -i '/pytest-runner/d' setup.cfg
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace setup.cfg \
|
2022-04-27 09:35:20 +00:00
|
|
|
--replace "multiset>=2.0,<3.0" "multiset"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hopcroftkarp
|
|
|
|
multiset
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"matchpy"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A library for pattern matching on symbolic expressions";
|
|
|
|
homepage = "https://github.com/HPAC/matchpy";
|
|
|
|
license = licenses.mit;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|