1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, setuptools
6, setuptools-scm
7, wheel
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "multiset";
13 version = "3.0.1";
14 format = "pyproject";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-5FZxyug4Wo5iSKmwejqDKAwtDMQxJxMFjPus3F7Jlz4=";
19 };
20
21 patches = [
22 # https://github.com/wheerd/multiset/pull/115
23 (fetchpatch {
24 name = "relax-setuptools-scm-dependency.patch";
25 url = "https://github.com/wheerd/multiset/commit/296187b07691c94b783f65504afc580a355abd96.patch";
26 hash = "sha256-vnZR1cyM/2/JfbLuVOxJuC9oMVVVploUHpbzagmo+AE=";
27 })
28 ];
29
30 postPatch = ''
31 # Drop broken version specifier
32 sed -i '/python_requires/d' setup.cfg
33 '';
34
35 nativeBuildInputs = [
36 setuptools
37 setuptools-scm
38 wheel
39 ];
40
41 pythonImportsCheck = [
42 "multiset"
43 ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 ];
48
49 meta = with lib; {
50 description = "An implementation of a multiset";
51 homepage = "https://github.com/wheerd/multiset";
52 license = licenses.mit;
53 maintainers = [ ];
54 };
55}