Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #307254 from TomaSajt/fix-islpy-loopy

python312Packages.{islpy,loopy}: fix build, add missing deps, refactor and adopt

authored by Weijia Wang and committed by GitHub e753fb24 fb5e2a5a

+93 -46
+52 -22
pkgs/development/python-modules/islpy/default.nix
··· 1 - { lib 2 - , buildPythonPackage 3 - , fetchPypi 4 - , isl 5 - , pybind11 6 - , pytestCheckHook 7 - , pythonOlder 8 - , six 9 }: 10 11 buildPythonPackage rec { 12 pname = "islpy"; 13 version = "2023.2.5"; 14 - format = "setuptools"; 15 16 - disabled = pythonOlder "3.6"; 17 18 - src = fetchPypi { 19 - inherit pname version; 20 - sha256 = "sha256-3XQ5i682k4q7fCqdmCjMGi5UnGyASFzsiwaymr+q0Y8="; 21 }; 22 23 - postConfigure = '' 24 - substituteInPlace setup.py \ 25 - --replace "\"pytest>=2\"," "" 26 ''; 27 28 - buildInputs = [ isl pybind11 ]; 29 - propagatedBuildInputs = [ six ]; 30 31 - preCheck = "mv islpy islpy.hidden"; 32 nativeCheckInputs = [ pytestCheckHook ]; 33 pythonImportsCheck = [ "islpy" ]; 34 35 - meta = with lib; { 36 description = "Python wrapper around isl, an integer set library"; 37 homepage = "https://github.com/inducer/islpy"; 38 - license = licenses.mit; 39 - maintainers = [ ]; 40 }; 41 }
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchFromGitHub, 5 + pythonOlder, 6 + 7 + setuptools, 8 + cmake, 9 + nanobind, 10 + ninja, 11 + pcpp, 12 + scikit-build, 13 + isl, 14 + 15 + pytestCheckHook, 16 }: 17 18 buildPythonPackage rec { 19 pname = "islpy"; 20 version = "2023.2.5"; 21 + pyproject = true; 22 23 + disabled = pythonOlder "3.8"; 24 25 + src = fetchFromGitHub { 26 + owner = "inducer"; 27 + repo = "islpy"; 28 + rev = "v${version}"; 29 + hash = "sha256-0m41G5HlPrgt4rDY3Y9cKBJGHSnLg/R+IywBO1anRpQ="; 30 }; 31 32 + postPatch = '' 33 + substituteInPlace pyproject.toml \ 34 + --replace-fail "setuptools>=42,<64;python_version<'3.12'" "setuptools>=42" 35 + ''; 36 + 37 + build-system = [ 38 + setuptools 39 + cmake 40 + nanobind 41 + ninja 42 + pcpp 43 + scikit-build 44 + ]; 45 + 46 + buildInputs = [ isl ]; 47 + 48 + dontUseCmakeConfigure = true; 49 + 50 + preConfigure = '' 51 + python ./configure.py \ 52 + --no-use-shipped-isl \ 53 + --isl-inc-dir=${lib.getDev isl}/include \ 54 ''; 55 56 + # Force resolving the package from $out to make generated ext files usable by tests 57 + preCheck = '' 58 + mv islpy islpy.hidden 59 + ''; 60 61 nativeCheckInputs = [ pytestCheckHook ]; 62 + 63 pythonImportsCheck = [ "islpy" ]; 64 65 + meta = { 66 description = "Python wrapper around isl, an integer set library"; 67 homepage = "https://github.com/inducer/islpy"; 68 + license = lib.licenses.mit; 69 + maintainers = with lib.maintainers; [ tomasajt ]; 70 }; 71 }
+38 -23
pkgs/development/python-modules/loopy/default.nix
··· 1 - { lib 2 - , buildPythonPackage 3 - , codepy 4 - , cgen 5 - , colorama 6 - , fetchFromGitHub 7 - , genpy 8 - , islpy 9 - , mako 10 - , numpy 11 - , pymbolic 12 - , pyopencl 13 - , pyrsistent 14 - , pythonOlder 15 - , pytools 16 }: 17 18 buildPythonPackage rec { 19 pname = "loopy"; 20 version = "2024.1"; 21 - format = "setuptools"; 22 23 - disabled = pythonOlder "3.7"; 24 25 src = fetchFromGitHub { 26 owner = "inducer"; 27 - repo = pname; 28 rev = "refs/tags/v${version}"; 29 - hash = "sha256-R0Wry4r8Y7VKqsyrZ3odEOUy4T9di9rFQzq7BD0LG58="; 30 }; 31 32 - propagatedBuildInputs = [ 33 codepy 34 cgen 35 colorama 36 genpy 37 islpy 38 mako 39 numpy ··· 41 pyopencl 42 pyrsistent 43 pytools 44 ]; 45 46 # pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR 47 doCheck = false; 48 49 - meta = with lib; { 50 description = "A code generator for array-based code on CPUs and GPUs"; 51 homepage = "https://github.com/inducer/loopy"; 52 - license = licenses.mit; 53 - maintainers = with maintainers; [ ]; 54 }; 55 }
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + codepy, 5 + cgen, 6 + colorama, 7 + fetchFromGitHub, 8 + genpy, 9 + immutables, 10 + islpy, 11 + mako, 12 + numpy, 13 + pymbolic, 14 + pyopencl, 15 + pyrsistent, 16 + pythonOlder, 17 + pytools, 18 + setuptools, 19 + typing-extensions, 20 }: 21 22 buildPythonPackage rec { 23 pname = "loopy"; 24 version = "2024.1"; 25 + pyproject = true; 26 27 + disabled = pythonOlder "3.8"; 28 29 src = fetchFromGitHub { 30 owner = "inducer"; 31 + repo = "loopy"; 32 rev = "refs/tags/v${version}"; 33 + hash = "sha256-mU8vXEPR88QpJpzXZlZdDhMtlwIx5YpeYhXU8Vw2T9g="; 34 + fetchSubmodules = true; # submodule at `loopy/target/c/compyte` 35 }; 36 37 + build-system = [ setuptools ]; 38 + 39 + dependencies = [ 40 codepy 41 cgen 42 colorama 43 genpy 44 + immutables 45 islpy 46 mako 47 numpy ··· 49 pyopencl 50 pyrsistent 51 pytools 52 + typing-extensions 53 ]; 54 55 + postConfigure = '' 56 + export HOME=$(mktemp -d) 57 + ''; 58 + 59 + pythonImportsCheck = [ "loopy" ]; 60 + 61 # pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR 62 doCheck = false; 63 64 + meta = { 65 description = "A code generator for array-based code on CPUs and GPUs"; 66 homepage = "https://github.com/inducer/loopy"; 67 + license = lib.licenses.mit; 68 + maintainers = with lib.maintainers; [ tomasajt ]; 69 }; 70 }
+3 -1
pkgs/top-level/python-packages.nix
··· 5917 5918 isbnlib = callPackage ../development/python-modules/isbnlib { }; 5919 5920 - islpy = callPackage ../development/python-modules/islpy { }; 5921 5922 iso3166 = callPackage ../development/python-modules/iso3166 { }; 5923
··· 5917 5918 isbnlib = callPackage ../development/python-modules/isbnlib { }; 5919 5920 + islpy = callPackage ../development/python-modules/islpy { 5921 + isl = pkgs.isl_0_24; 5922 + }; 5923 5924 iso3166 = callPackage ../development/python-modules/iso3166 { }; 5925