Bug 13741

Summary: python-twisted declares PyHamcrest>=1.9.0 in requirements.txt but it is not in RDEPENDS (not even needed?)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Gianluigi Tiesi <sherpya>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Undecided CC: meta.mr.watcher, meta.watcher, sherpya, tvgamblin
Version: 3.0.1   
Target Milestone: ---   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Gianluigi Tiesi 2020-01-20 17:58:39 UTC
Twisted-19.7.0 declares in requires.txt:

PyHamcrest>=1.9.0

the dependency is not added in the recipe, but looks like it's only needed for conch tests, unfortunately twisted calls pkg_resources that parses package requirements at runtime:

Traceback (most recent call last):
  File "/usr/bin/twistd", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3250, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3263, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'PyHamcrest>=1.9.0' distribution was not found and is required by Twisted
Comment 1 Trevor Gamblin 2020-01-25 19:56:36 UTC
Hi Gianluigi,

It looks like there are a few modules that /usr/bin/twistd looks for but won't find in the current configuration. I'm currently looking at a patch to fix this. In the meantime, you could add the following packages to your build manually via local.conf to see if it solves the issue for you:

python-pyhamcrest
python-debugger
python-unixadmin
Comment 2 Gianluigi Tiesi 2020-01-29 14:39:22 UTC
unfortunately there is no python3-pyhamcrest so I had to patch twisted package
Comment 3 Trevor Gamblin 2020-01-29 14:43:11 UTC
Right. I actually have submitted patches for the zeus branch, but in the meantime you may have to make manual additions if you are using python3.
Comment 4 Gianluigi Tiesi 2020-01-29 14:44:16 UTC
nevermind, it's not a big deal, I've made a small patch for twisted and it works, I'll removed it when it will be merged
Comment 5 Trevor Gamblin 2020-01-29 14:45:53 UTC
Sounds good. I'll close this then if you have a workaround for now.
Comment 6 Trevor Gamblin 2020-01-29 21:29:19 UTC
Reporter has a workaround, and patches have been submitted to fix the dependencies for master and zeus.