@classmethod<EOL><INDENT>def _build_from_requirements(cls, req_spec):<DEDENT>
<EOL>ws = cls([])<EOL>reqs = parse_requirements(req_spec)<EOL>dists = ws.resolve(reqs, Environment())<EOL>for dist in dists:<EOL><INDENT>ws.add(dist)<EOL><DEDENT>for entry in sys.path:<EOL><INDENT>if entry not in ws.entries:<EOL><INDENT>ws.add_entry(entry)<EOL><DEDENT><DEDENT>sys.path[:] = ws.entries<EOL>return ws<EOL>
Build a working set from a requirement spec. Rewrites sys.path.