From 4806ec5e97e3803ea0ad6c94ef13410efdb570c2 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 28 Apr 2024 09:19:29 +0200 Subject: [PATCH 1/4] python311Packages.aesara: disable failing tests --- .../python-modules/aesara/default.nix | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/aesara/default.nix b/pkgs/development/python-modules/aesara/default.nix index 589799c1b848..85de2a67591b 100644 --- a/pkgs/development/python-modules/aesara/default.nix +++ b/pkgs/development/python-modules/aesara/default.nix @@ -24,7 +24,7 @@ buildPythonPackage rec { pname = "aesara"; version = "2.9.3"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -35,13 +35,13 @@ buildPythonPackage rec { hash = "sha256-aO0+O7Ts9phsV4ghunNolxfAruGBbC+tHjVkmFedcCI="; }; - nativeBuildInputs = [ + build-system = [ cython hatch-vcs hatchling ]; - propagatedBuildInputs = [ + dependencies = [ cons etuples filelock @@ -62,7 +62,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 +82,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 + "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; { From 86df058f63513cb890f4c555923c31db91fb4a22 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 11 May 2024 14:17:46 +0200 Subject: [PATCH 2/4] python311Packages.aesara: mark as unsupported on python 3.12 --- pkgs/development/python-modules/aesara/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/aesara/default.nix b/pkgs/development/python-modules/aesara/default.nix index 85de2a67591b..edf3f989ecbc 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 @@ -26,7 +27,8 @@ buildPythonPackage rec { version = "2.9.3"; 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"; From 1917011ee8cdad96cba724d6cced97a05177dc78 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 11 May 2024 14:22:38 +0200 Subject: [PATCH 3/4] python311Packages.augmax: 0.3.1 -> 0.3.2 --- .../python-modules/augmax/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/augmax/default.nix b/pkgs/development/python-modules/augmax/default.nix index 2ab159cfc6f8..879bffb8a0d0 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 ]; }; From bdf284928135fc1d9aedc2f2fb5f44afd043dbca Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 11 May 2024 14:50:28 +0200 Subject: [PATCH 4/4] python311Packages.aeppl: fix build --- .../python-modules/aeppl/default.nix | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/aeppl/default.nix b/pkgs/development/python-modules/aeppl/default.nix index 1633be12bb97..514e585d6033 100644 --- a/pkgs/development/python-modules/aeppl/default.nix +++ b/pkgs/development/python-modules/aeppl/default.nix @@ -1,29 +1,34 @@ { lib -, aesara , buildPythonPackage -, fetchFromGitHub -, numdifftools -, numpy -, pytestCheckHook , pythonOlder +, fetchFromGitHub +, setuptools +, aesara +, numpy , 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";