Additional checks for module type determination.

Review Request #4131 — Created Aug. 2, 2016 and submitted

wisechengyi
pants
pants-reviews
benjyw, kwlzn, molsen, stuhood, zundel

We hit the issue where os module is misidentified as 3rdparty because:
build-support//pants_dev_deps.venv/lib/python2.7/os.pyc is not on the path
<system path to python>/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/

But really build-support//pants_dev_deps.venv/lib/python2.7/os.py is symlinked to
<system path to python>/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py

Therefore, this change adds additional checks for type determination.

Manual tested os is identified correctly as stdlib.

https://travis-ci.org/pantsbuild/pants/builds/149334090

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
  1. 
      
  2. How about:
    
    Sometimes .py files are symlinked to the real python files, such as the case of virtual environments.  However when the .pyc files are created they are created in the virtual env directory rather than the path in cls.STANDARD_LIB_PATH.
    1. corrected. much better. thanks!

  3. It looks like .endswith can be removed here.
  4. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Change Summary:

a37ce0d7f0bc7b0db7e4ace4c7061cf2e4d5ae80

Loading...