We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ace3f8 commit cd84fb3Copy full SHA for cd84fb3
pdoc/cli.py
@@ -421,8 +421,18 @@ def main(_args=None):
421
except KeyError:
422
pass # pdoc was not invoked while in a virtual environment
423
else:
424
+ from glob import glob
425
from distutils.sysconfig import get_python_lib
- sys.path.append(get_python_lib(prefix=venv_dir))
426
+ libdir = get_python_lib(prefix=venv_dir)
427
+ sys.path.append(libdir)
428
+ # Resolve egg-links from `setup.py develop` or `pip install -e`
429
+ # XXX: Welcome a more canonical approach
430
+ for pth in glob(path.join(libdir, '*.egg-link')):
431
+ try:
432
+ with open(pth) as f:
433
+ sys.path.append(path.join(libdir, f.readline().rstrip()))
434
+ except IOError:
435
+ warn('Invalid egg-link in venv: {!r}'.format(pth))
436
437
if args.http:
438
template_config['link_prefix'] = "/"
0 commit comments