From 3342953dff1c713b88dc1697f0c01bff776ba3d6 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sat, 25 May 2019 14:56:14 +0200 Subject: [PATCH 1/2] python.pkgs.annoy: init at 1.15.2 --- .../python-modules/annoy/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/python-modules/annoy/default.nix diff --git a/pkgs/development/python-modules/annoy/default.nix b/pkgs/development/python-modules/annoy/default.nix new file mode 100644 index 00000000000..ce7d9940bf2 --- /dev/null +++ b/pkgs/development/python-modules/annoy/default.nix @@ -0,0 +1,26 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, nose +}: + +buildPythonPackage rec { + version = "1.15.2"; + pname = "annoy"; + + src = fetchPypi { + inherit pname version; + sha256 = "1i5bkf8mwd1pyrbhfwncir2r8yq8s9qz5j13vv2qz92n9g57sr3m"; + }; + + checkInputs = [ + nose + ]; + + meta = with stdenv.lib; { + description = "Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk"; + homepage = https://github.com/spotify/annoy; + license = licenses.asl20; + maintainers = with maintainers; [ timokau ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ce5f76ecce4..c42accf8241 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5274,6 +5274,8 @@ in { sigtools = callPackage ../development/python-modules/sigtools { }; + annoy = callPackage ../development/python-modules/annoy { }; + clize = callPackage ../development/python-modules/clize { }; zerobin = callPackage ../development/python-modules/zerobin { }; From 700e8bc64c1756cf9e34d75f1491269e5ebbc116 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sat, 25 May 2019 14:56:33 +0200 Subject: [PATCH 2/2] python.pkgs.rl-coach: init at 0.12.0 --- .../python-modules/rl-coach/default.nix | 98 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 100 insertions(+) create mode 100644 pkgs/development/python-modules/rl-coach/default.nix diff --git a/pkgs/development/python-modules/rl-coach/default.nix b/pkgs/development/python-modules/rl-coach/default.nix new file mode 100644 index 00000000000..0dd5d58fc8c --- /dev/null +++ b/pkgs/development/python-modules/rl-coach/default.nix @@ -0,0 +1,98 @@ +{ stdenv +, lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, tensorflow +, annoy +, pillow +, matplotlib +, numpy +, pandas +, pygame +, pyopengl +, scipy +, scikitimage +, gym +, bokeh +, kubernetes +, redis +, minio +, pytest +, psutil +}: + +buildPythonPackage rec { + version = "0.12.0"; + pname = "rl-coach"; + + src = fetchPypi { + inherit pname version; + sha256 = "0kfm699rsy63726hpz3fyppl7zbl0fzf0vk2kkfgg718mcjxmdnh"; + }; + + propagatedBuildInputs = [ + tensorflow + annoy + pillow + matplotlib + numpy + pandas + pygame + pyopengl + scipy + scikitimage + gym + bokeh + kubernetes + redis + minio + psutil + ]; + + checkInputs = [ + pytest + ]; + + # run only some tests that do not need any optional dependencies + # available tests: https://github.com/NervanaSystems/coach/tree/master/rl_coach/tests + testsToRun = [ + # test only the tensorflow backend (not mxnet) + "architectures/tensorflow_components" + "agents" + "exploration_policies" + "filters" + "memories" + "utils" + ]; + checkPhase = let + fullTestPaths = map (testfile: "rl_coach/tests/${testfile}") testsToRun; + escapedPaths = map lib.escapeShellArg fullTestPaths; + pytestArgs = builtins.concatStringsSep " " escapedPaths; + in + '' + pytest ${pytestArgs} + ''; + + postPatch = '' + # pinned to 8.0.1 for unknown reason, at least basic functionallity seems to work without it + # https://github.com/NervanaSystems/coach/pull/149#issuecomment-495915804 + sed -i '/kubernetes/d' requirements.txt + + # this is just an "intel-optimized" version of tensorflow, e.g. an implementation detail + sed -i 's/intel-tensorflow/tensorflow/g' setup.py + + # backports of python3 features not needed + # https://github.com/NervanaSystems/coach/issues/324 + sed -i '/futures/d' requirements.txt + ''; + + disabled = pythonOlder "3.5"; # minimum required version + + meta = with stdenv.lib; { + description = "Enables easy experimentation with state of the art Reinforcement Learning algorithms"; + homepage = "https://nervanasystems.github.io/coach/"; + license = licenses.asl20; + maintainers = with maintainers; [ timokau ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c42accf8241..9337da095b7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5278,6 +5278,8 @@ in { clize = callPackage ../development/python-modules/clize { }; + rl-coach = callPackage ../development/python-modules/rl-coach { }; + zerobin = callPackage ../development/python-modules/zerobin { }; tensorflow-estimator = callPackage ../development/python-modules/tensorflow-estimator { };