diff --git a/pkgs/development/python-modules/pyopencl/default.nix b/pkgs/development/python-modules/pyopencl/default.nix index 8a233014155f..03549ea2977d 100644 --- a/pkgs/development/python-modules/pyopencl/default.nix +++ b/pkgs/development/python-modules/pyopencl/default.nix @@ -13,7 +13,9 @@ , platformdirs , pybind11 , pytest +, pytestCheckHook , pytools +, setuptools , six }: @@ -22,9 +24,17 @@ let if stdenv.isDarwin then [ mesa_drivers.dev ] else [ ocl-icd ]; in buildPythonPackage rec { pname = "pyopencl"; - version = "2022.3.1"; + version = "2023.1"; + + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-2d5gcnKRmlB6nCTD3+7q/nLAX3zWyeN7IRno7jxTqJE="; + }; + + nativeBuildInputs = [ setuptools ]; - nativeCheckInputs = [ pytest ]; buildInputs = [ opencl-headers pybind11 ] ++ os-specific-buildInputs; propagatedBuildInputs = [ @@ -38,15 +48,7 @@ in buildPythonPackage rec { six ]; - src = fetchPypi { - inherit pname version; - hash = "sha256-Sj2w/mG1zclSZ1Jt7r1xp+HXlWlNSw/idh8GMLzKNiE="; - }; - - # py.test is not needed during runtime, so remove it from `install_requires` - postPatch = '' - substituteInPlace setup.py --replace "pytest>=2" "" - ''; + nativeCheckInputs = [ pytestCheckHook ]; preBuild = '' export HOME=$(mktemp -d) @@ -55,6 +57,8 @@ in buildPythonPackage rec { # gcc: error: pygpu_language_opencl.cpp: No such file or directory doCheck = false; + pythonImportsCheck = [ "pyopencl" ]; + meta = with lib; { description = "Python wrapper for OpenCL"; homepage = "https://github.com/pyopencl/pyopencl";