jaraco / pip-run

pip-run - dynamic dependency loader for Python
MIT License
137 stars 19 forks source link

Honor .pth files in target directory #29

Closed jaraco closed 6 years ago

jaraco commented 6 years ago

Currently, .pth files are only honored on Python 3.2 and earlier due to this workaround.

Python 3.3 and later are excused because the only perceived need for .pth files at the time of the implementation was to support namespace packages, packages which work fine in PEP 420 mode naturally on Python 3.3 and later.

However, I've since learned of other packages such as future-fstrings that install .pth files to enable behavior on startup.

This leads me to believe rwt should no longer exclude later Python versions from the .pth file support... although this increases the impact of the issue that all rwt invocations will now mask any existing sitecustomize.py.

jaraco commented 6 years ago

For example

rwt master $ python2.7 -m rwt future-fstrings -- test-fstrings.py
Collecting future-fstrings
  Using cached https://files.pythonhosted.org/packages/90/32/6bb42916d91cf9e548f90b95f15c5d951c691c29b97d4a7ec9385d6c1700/future_fstrings-0.4.4-py2.py3-none-any.whl
Collecting tokenize-rt; python_version < "3.6" (from future-fstrings)
  Downloading https://files.pythonhosted.org/packages/04/59/092aa671d0e19a7b14419e12c518288c563d4532ce7d42da5b3a1dffc49e/tokenize_rt-2.0.1-py2.py3-none-any.whl
Installing collected packages: tokenize-rt, future-fstrings
Successfully installed future-fstrings-0.4.4 tokenize-rt-2.0.1
This requires ['future-fstrings']
rwt master $ python3.5 -m rwt future-fstrings -- test-fstrings.py
Collecting future-fstrings
  Using cached https://files.pythonhosted.org/packages/90/32/6bb42916d91cf9e548f90b95f15c5d951c691c29b97d4a7ec9385d6c1700/future_fstrings-0.4.4-py2.py3-none-any.whl
Collecting tokenize-rt; python_version < "3.6" (from future-fstrings)
  Using cached https://files.pythonhosted.org/packages/04/59/092aa671d0e19a7b14419e12c518288c563d4532ce7d42da5b3a1dffc49e/tokenize_rt-2.0.1-py2.py3-none-any.whl
Installing collected packages: tokenize-rt, future-fstrings
Successfully installed future-fstrings-0.4.4 tokenize-rt-2.0.1
  File "test-fstrings.py", line 1
SyntaxError: encoding problem: future_fstrings