File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -421,8 +421,18 @@ def main(_args=None):
421
421
except KeyError :
422
422
pass # pdoc was not invoked while in a virtual environment
423
423
else :
424
+ from glob import glob
424
425
from distutils .sysconfig import get_python_lib
425
- 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 ))
426
436
427
437
if args .http :
428
438
template_config ['link_prefix' ] = "/"
You can’t perform that action at this time.
0 commit comments