@@ -0,0 +1,42 @@
1+{ lib, buildPythonPackage, fetchPypi, fetchpatch, pkg-config, fuse3, trio, pytestCheckHook, pytest-trio, which }:
2+
3+buildPythonPackage rec {
4+ pname = "pyfuse3";
5+ version = "3.1.1";
6+
7+ src = fetchPypi {
8+ inherit pname version;
9+ sha256 = "9feb42a8639dc4815522ee6af6f7221552cfd2df1c7a7e9df96767be65e18667";
10+ };
11+
12+ patches = [
13+ # Fixes tests with pytest 6, to be removed in next stable version
14+ (fetchpatch {
15+ url = "https://github.com/libfuse/pyfuse3/commit/0070eddfc33fc2fba8eb4fe9353a2d2fa1ae575b.patch";
16+ sha256 = "0lb4x1j31ihs3qkn61x41k2vqwcjl2fp1c2qx2jg9br6yqhjmg3b";
17+ })
18+ ];
19+
20+ nativeBuildInputs = [ pkg-config ];
21+
22+ buildInputs = [ fuse3 ];
23+
24+ propagatedBuildInputs = [ trio ];
25+
26+ checkInputs = [
27+ pytestCheckHook
28+ pytest-trio
29+ which
30+ fuse3
31+ ];
32+
33+ # Checks if a /usr/bin directory exists, can't work on NixOS
34+ disabledTests = [ "test_listdir" ];
35+
36+ meta = with lib; {
37+ description = "Python 3 bindings for libfuse 3 with async I/O support";
38+ homepage = "https://github.com/libfuse/pyfuse3";
39+ license = licenses.gpl2;
40+ maintainers = with maintainers; [ nyanloutre ];
41+ };
42+}