FS#38213 - [python2-pyopencl] Missing dependency

Attached to Project: Community Packages
Opened by Sylvain Laurent (Magicking) - Saturday, 21 December 2013, 11:31 GMT
Last edited by Jelle van der Waa (jelly) - Saturday, 15 February 2014, 13:13 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
python2-setuptools is more than a make dependency

Additional info:
Relevant stack trace using AUR package poclbm-git without python2-setuptools:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/poclbm/OpenCLMiner.py", line 162, in mining_thread
self.load_kernel()
File "/opt/poclbm/OpenCLMiner.py", line 328, in load_kernel
self.program = cl.Program(self.context, [self.device], [binary.read()]).build(self.defines)
File "/usr/lib/python2.7/site-packages/pyopencl/__init__.py", line 141, in build
options = options + ["-I", _find_pyopencl_include_path()]
File "/usr/lib/python2.7/site-packages/pyopencl/__init__.py", line 722, in _find_pyopencl_include_path
from pkg_resources import Requirement, resource_filename
ImportError: No module named pkg_resources

Steps to reproduce:
Remove python2-setuptools
Make a use of _find_pyopencl_include_path() which contains « from pkg_resources import Requirement, resource_filename » where pkg_resources is provided by python2-setuptools.
This task depends upon

Closed by  Jelle van der Waa (jelly)
Saturday, 15 February 2014, 13:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in -3
Comment by Jelle van der Waa (jelly) - Sunday, 22 December 2013, 10:15 GMT
I think I'll rather let the tools which use py-opencl as dep should add python2-setuptools as makedepend since it doesn't seem like a runtime dep.
Comment by Sylvain Laurent (Magicking) - Monday, 23 December 2013, 22:33 GMT
It's a runtime dep, since _find_pyopencl_include_path which is *always* called by the build function rely on pkg_resources which is provided by python2-setuptools.

See transcript below with following python code (bar.py):
import pyopencl as cl
cl.Program(cl.create_some_context(), '__kernel void foo(){}').build()

With python2-setuptools installed:
$> python2 bar.py; echo $?
0
Without python2-setuptools installed:
$> sudo pacman -R --noconfirm python2-setuptools && python2 bar.py; echo $?
checking dependencies...

Packages (1): python2-setuptools-2.0.1-1

Total Removed Size: 1.99 MiB

:: Do you want to remove these packages? [Y/n]
(1/1) removing python2-setuptools [########################################] 100%
Traceback (most recent call last):
File "bar.py", line 2, in <module>
prg = cl.Program(cl.create_some_context(), '__kernel void foo(void){}').build()
File "/usr/lib/python2.7/site-packages/pyopencl/__init__.py", line 141, in build
options = options + ["-I", _find_pyopencl_include_path()]
File "/usr/lib/python2.7/site-packages/pyopencl/__init__.py", line 722, in _find_pyopencl_include_path
from pkg_resources import Requirement, resource_filename
ImportError: No module named pkg_resources
1
Comment by Felix Yan (felixonmars) - Thursday, 06 February 2014, 04:07 GMT
Confirmed that the missing dependency on python2-setuptools even causes the first demo on pyopencl doc [1] to crash.

Same issue applies for the python 3 version, python-pyopencl.

[1] http://documen.tician.de/pyopencl/

Loading...