1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 hydra-core,
11 joblib,
12
13 # test
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "hydra-joblib-launcher";
19 pyproject = true;
20
21 inherit (hydra-core) version src;
22
23 sourceRoot = "${src.name}/plugins/hydra_joblib_launcher";
24
25 # get rid of deprecated "read_version" dependency, no longer in Nixpkgs:
26 postPatch = ''
27 substituteInPlace pyproject.toml --replace-fail ', "read-version"' ""
28 substituteInPlace setup.py \
29 --replace-fail 'from read_version import read_version' "" \
30 --replace-fail 'version=read_version("hydra_plugins/hydra_joblib_launcher", "__init__.py"),' 'version="${version}",'
31 '';
32
33 build-system = [
34 setuptools
35 ];
36
37 dependencies = [
38 hydra-core
39 joblib
40 ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 ];
45
46 # tries to write to source directory otherwise:
47 pytestFlagsArray = [ "-p no:cacheprovider" ];
48
49 meta = {
50 inherit (hydra-core.meta) changelog license;
51 description = "Hydra launcher supporting parallel execution based on Joblib.Parallel";
52 homepage = "https://hydra.cc/docs/plugins/joblib_launcher";
53 maintainers = with lib.maintainers; [ bcdarwin ];
54 };
55}