Fix Windows setup dependency bug

The hook raises an AttributeError exception on Windows because
of recent changes in the pbr project. This fix solves the issue.

This is adapted from https://review.openstack.org/#/c/42170/

Since ryu didn't depend on pyudev, I think it no longer needs
a removal here.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Wei-Li Tang 2014-01-05 20:20:13 +08:00 committed by FUJITA Tomonori
parent ffc1f82554
commit 1753c1e8d9

View File

@ -40,10 +40,9 @@ def setup_hook(config):
"""Filter config parsed from a setup.cfg to inject our defaults."""
metadata = config['metadata']
if sys.platform == 'win32':
requires = metadata.get('requires_dist', list()).split('\n')
requires = metadata.get('requires_dist', '').split('\n')
requires.append('pywin32')
requires.append('wmi')
requires.remove('pyudev')
metadata['requires_dist'] = "\n".join(requires)
config['metadata'] = metadata