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