nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 humanfriendly,
8 pytestCheckHook,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "capturer";
14 version = "3.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "xolox";
19 repo = "python-capturer";
20 rev = version;
21 sha256 = "0fwrxa049gzin5dck7fvwhdp1856jrn0d7mcjcjsd7ndqvhgvjj1";
22 };
23
24 patches = [
25 # https://github.com/xolox/python-capturer/pull/16
26 (fetchpatch {
27 name = "python314-compat.patch";
28 url = "https://github.com/xolox/python-capturer/commit/3d0a9a040ecaa78ce2d39ec76ff5084ee7be6653.patch";
29 hash = "sha256-NW+X6wdXMHSLswO7M7/YeIyHu+EDYTLJE/mBkqyhKUM=";
30 })
31 ];
32
33 build-system = [ setuptools ];
34
35 dependencies = [ humanfriendly ];
36
37 # hangs on darwin
38 doCheck = !stdenv.hostPlatform.isDarwin;
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 meta = {
42 description = "Easily capture stdout/stderr of the current process and subprocesses";
43 homepage = "https://github.com/xolox/python-capturer";
44 license = lib.licenses.mit;
45 maintainers = with lib.maintainers; [ eyjhb ];
46 };
47}