nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 pytestCheckHook,
7 procps,
8 stdenv,
9}:
10
11buildPythonPackage rec {
12 pname = "setproctitle";
13 version = "1.3.7";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "dvarrazzo";
18 repo = "py-setproctitle";
19 tag = "version-${version}";
20 hash = "sha256-dfOdtfOXRAoCQLW307+YMsFIWRv4CupbKUxckev1oUw=";
21 };
22
23 build-system = [ setuptools ];
24
25 nativeCheckInputs = [
26 pytestCheckHook
27 procps
28 ];
29
30 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
31 # Setting the process title fails on macOS in the Nix builder environment (regardless of sandboxing)
32 "test_setproctitle_darwin"
33 # *** multi-threaded process forked ***; crashed on child side of fork pre-exec. fork without exec is unsafe.
34 "test_fork_segfault"
35 "test_thread_fork_segfault"
36 ];
37
38 pythonImportsCheck = [ "setproctitle" ];
39
40 meta = {
41 description = "Allows a process to change its title (as displayed by system tools such as ps and top)";
42 homepage = "https://github.com/dvarrazzo/py-setproctitle";
43 changelog = "https://github.com/dvarrazzo/py-setproctitle/blob/${src.tag}/HISTORY.rst";
44 license = lib.licenses.bsd3;
45 maintainers = with lib.maintainers; [ exi ];
46 };
47}