1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch2
5, poetry-core
6}:
7
8buildPythonPackage rec {
9 pname = "memory-tempfile";
10 version = "2.2.3";
11 pyproject = true;
12
13 src = fetchFromGitHub {
14 owner = "mbello";
15 repo = "memory-tempfile";
16 rev = "v${version}";
17 hash = "sha256-4fz2CLkZdy2e1GwGw/afG54LkUVJ4cza70jcbX3rVlQ=";
18 };
19
20 patches = [
21 (fetchpatch2 {
22 # Migrate to poetry-core build backend
23 # https://github.com/mbello/memory-tempfile/pull/13
24 name = "poetry-core.patch";
25 url = "https://github.com/mbello/memory-tempfile/commit/938a3a3abf01756b1629eca6c69e970021bbc7c0.patch";
26 hash = "sha256-q3027MwKXtX09MH7T2UrX19BImK1FJo+YxADfxcdTME=";
27 })
28 ];
29
30 build-system = [ poetry-core ];
31
32 doCheck = false; # constrained selection of memory backed filesystems due to build sandbox
33
34 pythonImportsCheck = [ "memory_tempfile" ];
35
36 meta = with lib; {
37 description = "Create temporary files and temporary dirs in memory-based filesystems on Linux";
38 homepage = "https://github.com/mbello/memory-tempfile";
39 license = licenses.mit;
40 maintainers = with maintainers; [ hexa ];
41 };
42}