about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-05-11 23:06:03 +0200
committerGitHub <noreply@github.com>2024-05-11 23:06:03 +0200
commit9ba0818d53a4049fddc8fe47efac76c8b193b059 (patch)
tree181f586b6f40fbf764c42da4ffdbb850ed52675e
parent010103c926a0a9f2475f0d1ea30ba35893ca3203 (diff)
parentbdf284928135fc1d9aedc2f2fb5f44afd043dbca (diff)
Merge pull request #304881 from GaetanLepage/aesara
python311Packages.aesara: fix build
-rw-r--r--pkgs/development/python-modules/aeppl/default.nix29
-rw-r--r--pkgs/development/python-modules/aesara/default.nix24
-rw-r--r--pkgs/development/python-modules/augmax/default.nix17
3 files changed, 49 insertions, 21 deletions
diff --git a/pkgs/development/python-modules/aeppl/default.nix b/pkgs/development/python-modules/aeppl/default.nix
index 1633be12bb97a..514e585d60338 100644
--- a/pkgs/development/python-modules/aeppl/default.nix
+++ b/pkgs/development/python-modules/aeppl/default.nix
@@ -1,29 +1,34 @@
 { lib
-, aesara
 , buildPythonPackage
+, pythonOlder
 , fetchFromGitHub
-, numdifftools
+, setuptools
+, aesara
 , numpy
-, pytestCheckHook
-, pythonOlder
 , scipy
+, numdifftools
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "aeppl";
   version = "0.1.5";
-  format = "setuptools";
+  pyproject = true;
 
-  disabled = pythonOlder "3.7";
+  disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "aesara-devs";
-    repo = pname;
+    repo = "aeppl";
     rev = "refs/tags/v${version}";
     hash = "sha256-mqBbXwWJwQA2wSHuEdBeXQMfTIcgwYEjpq8AVmOjmHM=";
   };
 
-  propagatedBuildInputs = [
+  build-system = [
+    setuptools
+  ];
+
+  dependencies = [
     aesara
     numpy
     scipy
@@ -47,6 +52,14 @@ buildPythonPackage rec {
     "test_initial_values"
   ];
 
+  pytestFlagsArray = [
+    # `numpy.distutils` is deprecated since NumPy 1.23.0, as a result of the deprecation of `distutils` itself.
+    # It will be removed for Python >= 3.12. For older Python versions it will remain present.
+    "-Wignore::DeprecationWarning"
+    # Blas cannot be found, allow fallback to the numpy slower implementation
+    "-Wignore::UserWarning"
+  ];
+
   meta = with lib; {
     description = "Library for an Aesara-based PPL";
     homepage = "https://github.com/aesara-devs/aeppl";
diff --git a/pkgs/development/python-modules/aesara/default.nix b/pkgs/development/python-modules/aesara/default.nix
index 589799c1b848f..edf3f989ecbc1 100644
--- a/pkgs/development/python-modules/aesara/default.nix
+++ b/pkgs/development/python-modules/aesara/default.nix
@@ -16,6 +16,7 @@
 , numba-scipy
 , numpy
 , pytestCheckHook
+, pythonAtLeast
 , pythonOlder
 , scipy
 , typing-extensions
@@ -24,9 +25,10 @@
 buildPythonPackage rec {
   pname = "aesara";
   version = "2.9.3";
-  format = "pyproject";
+  pyproject = true;
 
-  disabled = pythonOlder "3.8";
+  # Python 3.12 is not supported: https://github.com/aesara-devs/aesara/issues/1520
+  disabled = pythonOlder "3.8" || pythonAtLeast "3.12";
 
   src = fetchFromGitHub {
     owner = "aesara-devs";
@@ -35,13 +37,13 @@ buildPythonPackage rec {
     hash = "sha256-aO0+O7Ts9phsV4ghunNolxfAruGBbC+tHjVkmFedcCI=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
     cython
     hatch-vcs
     hatchling
   ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     cons
     etuples
     filelock
@@ -62,7 +64,8 @@ buildPythonPackage rec {
 
   postPatch = ''
     substituteInPlace pyproject.toml \
-      --replace "--durations=50" ""
+      --replace-fail "--durations=50" "" \
+      --replace-fail "hatch-vcs >=0.3.0,<0.4.0" "hatch-vcs"
   '';
 
   preBuild = ''
@@ -81,12 +84,23 @@ buildPythonPackage rec {
     "tests/sparse/sandbox/"
     # JAX is not available on all platform and often broken
     "tests/link/jax/"
+
+    # 2024-04-27: The current nixpkgs numba version is too recent and incompatible with aesara 2.9.3
+    "tests/link/numba/"
   ];
 
   disabledTests = [
     # Disable all benchmark tests
     "test_scan_multiple_output"
     "test_logsumexp_benchmark"
+
+    # TypeError: exceptions must be derived from Warning, not <class 'NoneType'>
+    "test_api_deprecation_warning"
+    # AssertionError: assert ['Elemwise{Co..._i{0} 0', ...] == ['Elemwise{Co..._i{0} 0', ...]
+    # At index 3 diff: '| |Gemv{inplace} d={0: [0]} 2' != '| |CGemv{inplace} d={0: [0]} 2'
+    "test_debugprint"
+    # ValueError: too many values to unpack (expected 3)
+    "test_ExternalCOp_c_code_cache_version"
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/augmax/default.nix b/pkgs/development/python-modules/augmax/default.nix
index 2ab159cfc6f8d..879bffb8a0d0a 100644
--- a/pkgs/development/python-modules/augmax/default.nix
+++ b/pkgs/development/python-modules/augmax/default.nix
@@ -1,6 +1,6 @@
 { buildPythonPackage
 , einops
-, fetchFromGitHub
+, fetchPypi
 , jax
 , jaxlib
 , lib
@@ -10,16 +10,17 @@
 
 buildPythonPackage rec {
   pname = "augmax";
-  version = "0.3.1";
+  version = "0.3.2";
   pyproject = true;
 
   disbaled = pythonOlder "3.6";
 
-  src = fetchFromGitHub {
-    owner = "khdlr";
-    repo = "augmax";
-    rev = "refs/tags/v${version}";
-    hash = "sha256-hDNNoE7KVaH3jrXZA4A8f0UoQJPl6KHA3XwMc3Ccohk=";
+  # Using fetchPypi because the latest version was not tagged on GitHub.
+  # Switch back to fetchFromGitHub when a tag will be available
+  # https://github.com/khdlr/augmax/issues/8
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-pf1DTaHA7D+s2rqwwGYlJrJOI7fok+WOvOCtZhOOGHo=";
   };
 
   nativeBuildInputs = [
@@ -37,7 +38,7 @@ buildPythonPackage rec {
   meta = with lib; {
     description = "Efficiently Composable Data Augmentation on the GPU with Jax";
     homepage = "https://github.com/khdlr/augmax";
-    changelog = "https://github.com/khdlr/augmax/blob/${src.rev}/CHANGELOG.md";
+    changelog = "https://github.com/khdlr/augmax/blob/v${version}/CHANGELOG.md";
     license = licenses.asl20;
     maintainers = with maintainers; [ samuela ];
   };