lol

python312Packages.bsuite: refactor

- use nixfmt

+116 -108
+116 -108
pkgs/development/python-modules/bsuite/default.nix
··· 1 - { lib 2 - , fetchPypi 3 - , buildPythonPackage 4 - , fetchpatch 5 - , frozendict 6 - , termcolor 7 - , matplotlib 8 - , gym 9 - , pandas 10 - , scipy 11 - , absl-py 12 - , dm-env 13 - , plotnine 14 - , scikit-image 15 - , dm-tree 16 - , patsy 17 - , tensorflow-probability 18 - , dm-haiku 19 - , statsmodels 20 - , mizani 21 - , trfl 22 - , optax 23 - , pytestCheckHook 24 - , dm-sonnet 25 - , rlax 26 - , distrax 1 + { 2 + lib, 3 + absl-py, 4 + buildPythonPackage, 5 + distrax, 6 + dm-env, 7 + dm-haiku, 8 + dm-sonnet, 9 + dm-tree, 10 + fetchpatch, 11 + fetchPypi, 12 + frozendict, 13 + gym, 14 + matplotlib, 15 + mizani, 16 + optax, 17 + pandas, 18 + patsy, 19 + plotnine, 20 + pytestCheckHook, 21 + pythonOlder, 22 + rlax, 23 + scikit-image, 24 + scipy, 25 + setuptools, 26 + statsmodels, 27 + tensorflow-probability, 28 + termcolor, 29 + trfl, 27 30 }: 28 31 29 - let bsuite = buildPythonPackage rec { 30 - pname = "bsuite"; 31 - version = "0.3.5"; 32 - format = "setuptools"; 32 + let 33 + bsuite = buildPythonPackage rec { 34 + pname = "bsuite"; 35 + version = "0.3.5"; 36 + pyproject = true; 33 37 34 - src = fetchPypi { 35 - inherit pname version; 36 - hash = "sha256-ak9McvXl7Nz5toUaPaRaJek9lurxiQiIW209GnZEjX0="; 37 - }; 38 + disabled = pythonOlder "3.7"; 38 39 39 - patches = [ 40 - # Convert np.int -> np.int32 since np.int is deprecated, https://github.com/google-deepmind/bsuite/pull/48 41 - (fetchpatch { 42 - url = "https://github.com/google-deepmind/bsuite/pull/48/commits/f8d81b2f1c27ef2c8c71ae286001ed879ea306ab.patch"; 43 - hash = "sha256-FXtvVS+U8brulq8Z27+yWIimB+kigGiUOIv1SHb1TA8="; 44 - }) 45 - # Replace imp with importlib, https://github.com/google-deepmind/bsuite/pull/50 46 - (fetchpatch { 47 - name = "replace-imp.patch"; 48 - url = "https://github.com/google-deepmind/bsuite/commit/d08b63655c7efa5b5bb0f35e825e17549d23e812.patch"; 49 - hash = "sha256-V5p/6edNXTpEckuSuxJ/mvfJng5yE/pfeMoYbvlNpEo="; 50 - }) 51 - ]; 40 + src = fetchPypi { 41 + inherit pname version; 42 + hash = "sha256-ak9McvXl7Nz5toUaPaRaJek9lurxiQiIW209GnZEjX0="; 43 + }; 52 44 53 - propagatedBuildInputs = [ 54 - absl-py 55 - dm-env 56 - dm-tree 57 - frozendict 58 - gym 59 - matplotlib 60 - mizani 61 - pandas 62 - patsy 63 - plotnine 64 - scikit-image 65 - scipy 66 - statsmodels 67 - termcolor 68 - ]; 45 + patches = [ 46 + # Convert np.int -> np.int32 since np.int is deprecated, https://github.com/google-deepmind/bsuite/pull/48 47 + (fetchpatch { 48 + url = "https://github.com/google-deepmind/bsuite/pull/48/commits/f8d81b2f1c27ef2c8c71ae286001ed879ea306ab.patch"; 49 + hash = "sha256-FXtvVS+U8brulq8Z27+yWIimB+kigGiUOIv1SHb1TA8="; 50 + }) 51 + # Replace imp with importlib, https://github.com/google-deepmind/bsuite/pull/50 52 + (fetchpatch { 53 + name = "replace-imp.patch"; 54 + url = "https://github.com/google-deepmind/bsuite/commit/d08b63655c7efa5b5bb0f35e825e17549d23e812.patch"; 55 + hash = "sha256-V5p/6edNXTpEckuSuxJ/mvfJng5yE/pfeMoYbvlNpEo="; 56 + }) 57 + ]; 69 58 70 - nativeCheckInputs = [ 71 - distrax 72 - dm-haiku 73 - dm-sonnet 74 - optax 75 - pytestCheckHook 76 - rlax 77 - tensorflow-probability 78 - trfl 79 - ]; 59 + build-system = [ setuptools ]; 80 60 81 - pythonImportsCheck = [ 82 - "bsuite" 83 - ]; 61 + dependencies = [ 62 + absl-py 63 + dm-env 64 + dm-tree 65 + frozendict 66 + gym 67 + matplotlib 68 + mizani 69 + pandas 70 + patsy 71 + plotnine 72 + scikit-image 73 + scipy 74 + statsmodels 75 + termcolor 76 + ]; 84 77 85 - disabledTests = [ 86 - # Tests require network connection 87 - "test_run9" 88 - "test_longer_action_sequence" 89 - "test_reset" 90 - "test_step_after_reset" 91 - "test_step_on_fresh_environment" 92 - "test_longer_action_sequence" 93 - "test_reset" 94 - "test_step_after_reset" 95 - "test_step_on_fresh_environment" 96 - "test_longer_action_sequence" 97 - "test_reset" 98 - "test_step_after_reset" 99 - "test_step_on_fresh_environment" 100 - "test_logger" 101 - "test_episode_truncation" 102 - ]; 78 + nativeCheckInputs = [ 79 + distrax 80 + dm-haiku 81 + dm-sonnet 82 + optax 83 + pytestCheckHook 84 + rlax 85 + tensorflow-probability 86 + trfl 87 + ]; 103 88 104 - # escape infinite recursion with rlax 105 - doCheck = false; 89 + pythonImportsCheck = [ "bsuite" ]; 106 90 107 - passthru.tests = { 108 - check = bsuite.overridePythonAttrs (_: { doCheck = true; }); 109 - }; 91 + disabledTests = [ 92 + # Tests require network connection 93 + "test_run9" 94 + "test_longer_action_sequence" 95 + "test_reset" 96 + "test_step_after_reset" 97 + "test_step_on_fresh_environment" 98 + "test_longer_action_sequence" 99 + "test_reset" 100 + "test_step_after_reset" 101 + "test_step_on_fresh_environment" 102 + "test_longer_action_sequence" 103 + "test_reset" 104 + "test_step_after_reset" 105 + "test_step_on_fresh_environment" 106 + "test_logger" 107 + "test_episode_truncation" 108 + ]; 110 109 111 - meta = with lib; { 112 - description = '' 113 - Core RL Behaviour Suite. A collection of reinforcement learning 114 - experiments 115 - ''; 116 - homepage = "https://github.com/deepmind/bsuite"; 117 - license = licenses.asl20; 118 - maintainers = with maintainers; [ onny ]; 110 + # Escape infinite recursion with rlax 111 + doCheck = false; 112 + 113 + passthru.tests = { 114 + check = bsuite.overridePythonAttrs (_: { 115 + doCheck = true; 116 + }); 117 + }; 118 + 119 + meta = with lib; { 120 + description = "Collection of experiments that investigate core capabilities of a reinforcement learning (RL) agent"; 121 + homepage = "https://github.com/deepmind/bsuite"; 122 + changelog = "https://github.com/google-deepmind/bsuite/releases/tag/${version}"; 123 + license = licenses.asl20; 124 + maintainers = with maintainers; [ onny ]; 125 + }; 119 126 }; 120 - }; in bsuite 127 + in 128 + bsuite