2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
hopcroftkarp,
|
|
|
|
multiset,
|
|
|
|
pytestCheckHook,
|
|
|
|
hypothesis,
|
|
|
|
setuptools-scm,
|
|
|
|
isPy27,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
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
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
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
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/HPAC/matchpy/pull/77
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-versioneer-py312.patch";
|
|
|
|
url = "https://github.com/HPAC/matchpy/commit/965d7c39689b9f2473a78ed06b83f2be701e234d.patch";
|
|
|
|
hash = "sha256-xXADCSIhq1ARny2twzrhR1J8LkMFWFl6tmGxrM8RvkU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hopcroftkarp
|
|
|
|
multiset
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "matchpy" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library for pattern matching on symbolic expressions";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/HPAC/matchpy";
|
|
|
|
license = licenses.mit;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|