2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-01-13 20:06:32 +00:00
|
|
|
, pythonOlder
|
2024-04-21 15:54:59 +00:00
|
|
|
, pythonAtLeast
|
2023-02-22 10:55:15 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch2
|
2023-02-22 10:55:15 +00:00
|
|
|
, setuptools
|
2021-06-04 09:07:49 +00:00
|
|
|
, setuptools-scm
|
2023-02-22 10:55:15 +00:00
|
|
|
, wheel
|
2021-02-19 19:06:45 +00:00
|
|
|
, py
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytest
|
2021-02-19 19:06:45 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-forked";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "1.6.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pytest-dev";
|
|
|
|
repo = "pytest-forked";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-owkGwF5WQ17/CXwTsIYJ2AgktekRB4qhtsDxR0LCI/k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch2 {
|
|
|
|
# https://github.com/pytest-dev/pytest-forked/actions
|
|
|
|
name = "pytest8-compat.patch";
|
|
|
|
url = "https://github.com/pytest-dev/pytest-forked/commit/b2742322d39ebda97d5170922520f3bb9c73f614.patch";
|
|
|
|
hash = "sha256-tTRW0p3tOotQMtjjJ6RUKdynsAnKRz0RAV8gAUHiNNA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
wheel
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
py
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests = if (pythonAtLeast "3.12" && stdenv.isDarwin && stdenv.isx86_64) then [
|
|
|
|
# non reproducible test failure on hydra, works on community builder
|
|
|
|
# https://hydra.nixos.org/build/252537267
|
|
|
|
"test_xfail"
|
|
|
|
] else null;
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://github.com/pytest-dev/pytest-forked/blob/${src.rev}/CHANGELOG.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Run tests in isolated forked subprocesses";
|
|
|
|
homepage = "https://github.com/pytest-dev/pytest-forked";
|
|
|
|
license = lib.licenses.mit;
|
2021-02-19 19:06:45 +00:00
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|