From b54fce7225095849356fab203d7bd66eb3eb703a Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Tue, 10 Jan 2023 16:15:18 -0500 Subject: [PATCH 1/2] python310Packages.pytensor: init at 2.9.1 --- .../python-modules/pytensor/default.nix | 95 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 97 insertions(+) create mode 100644 pkgs/development/python-modules/pytensor/default.nix diff --git a/pkgs/development/python-modules/pytensor/default.nix b/pkgs/development/python-modules/pytensor/default.nix new file mode 100644 index 000000000000..aed37ab14229 --- /dev/null +++ b/pkgs/development/python-modules/pytensor/default.nix @@ -0,0 +1,95 @@ +{ stdenv +, lib +, buildPythonPackage +, cons +, cython +, etuples +, fetchFromGitHub +, filelock +, jax +, jaxlib +, logical-unification +, minikanren +, numba +, numba-scipy +, numpy +, pytestCheckHook +, pythonOlder +, scipy +, typing-extensions +}: + +buildPythonPackage rec { + pname = "pytensor"; + version = "2.9.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pymc-devs"; + repo = pname; + rev = "refs/tags/rel-${version}"; + hash = "sha256-vuZHiDbGg55lXr9BwPT66Hy8RUe/RfYVaV57i/YlBwg="; + }; + + nativeBuildInputs = [ + cython + ]; + + propagatedBuildInputs = [ + cons + etuples + filelock + logical-unification + minikanren + numpy + scipy + typing-extensions + ]; + + checkInputs = [ + jax + jaxlib + numba + numba-scipy + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--durations=50" "" + ''; + + preBuild = '' + export HOME=$(mktemp -d) + ''; + + pythonImportsCheck = [ + "pytensor" + ]; + + disabledTests = [ + # benchmarks (require pytest-benchmark): + "test_elemwise_speed" + "test_logsumexp_benchmark" + "test_scan_multiple_output" + ]; + + disabledTestPaths = [ + # Don't run the most compute-intense tests + "tests/scan/" + "tests/tensor/" + "tests/sandbox/" + "tests/sparse/sandbox/" + ]; + + meta = with lib; { + description = "Python library to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays"; + homepage = "https://github.com/pymc-devs/pytensor"; + changelog = "https://github.com/pymc-devs/pytensor/releases"; + license = licenses.bsd3; + maintainers = with maintainers; [ bcdarwin ]; + broken = (stdenv.isLinux && stdenv.isAarch64); + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8ce5080662a8..3b4cbdf42a31 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8900,6 +8900,8 @@ self: super: with self; { pytenable = callPackage ../development/python-modules/pytenable { }; + pytensor = callPackage ../development/python-modules/pytensor { }; + pytelegrambotapi = callPackage ../development/python-modules/pyTelegramBotAPI { }; pytesseract = callPackage ../development/python-modules/pytesseract { }; From 089f0dd9e2218d0cffef6d9f703ded331482d749 Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Tue, 10 Jan 2023 16:20:30 -0500 Subject: [PATCH 2/2] python310Packages.pymc: 5.0.1 -> 5.0.2; unbreak --- .../python-modules/pymc/default.nix | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/pymc/default.nix b/pkgs/development/python-modules/pymc/default.nix index 8603eeabdee1..1f528d9ab715 100644 --- a/pkgs/development/python-modules/pymc/default.nix +++ b/pkgs/development/python-modules/pymc/default.nix @@ -1,6 +1,4 @@ { lib -, aeppl -, aesara , arviz , buildPythonPackage , cachetools @@ -8,38 +6,33 @@ , fastprogress , fetchFromGitHub , numpy +, pytensor , pythonOlder -, pythonRelaxDepsHook , scipy , typing-extensions }: buildPythonPackage rec { pname = "pymc"; - version = "5.0.1"; + version = "5.0.2"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "pymc-devs"; - repo = "pymc"; + repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-uWvzWbZyRRE8L9X9+azmN+1JYahwwNSYCk2fQ/C8Yi0="; + hash = "sha256-ffNWSSzoRLFmYzN9sm5Z1j6WtEoFzGkCQxpBC0NlpRc="; }; - nativeBuildInputs = [ - pythonRelaxDepsHook - ]; - propagatedBuildInputs = [ - aeppl - aesara arviz cachetools cloudpickle fastprogress numpy + pytensor scipy typing-extensions ]; @@ -49,11 +42,6 @@ buildPythonPackage rec { --replace ', "pytest-cov"' "" ''; - pythonRelaxDeps = [ - "aesara" - "aeppl" - ]; - # The test suite is computationally intensive and test failures are not # indicative for package usability hence tests are disabled by default. doCheck = false;