Decouple translation and package iteration (kill pex.obtainer)
Review Request #785 - Created July 29, 2014 and submitted
|Brian Wickman (Twitter)|
|jsirois, kwlzn, patricklaw|
This gets rid of the Obtainer and is based off https://rbcommons.com/s/twitter/r/778/. This makes resolve() take a few more options but simplifies the caching story -- there is really just one place to specify a cache path. Did a run of isort + killing unused imports, hence a couple drive-by files being touched.
tox + pex inception: python setup.py sdist && \ pex -v --repo=dist/ -r wheel -r requests -r pex==0.8.0-rc0 -e pex.bin.pex:main -o dist/pex.pex && \ dist/pex.pex -v --repo=dist/ -r wheel -r requests -r pex==0.8.0-rc0 -e pex.bin.pex:main -o dist/pex.pex.pex && \ rm -rf ~/.pex && \ dist/pex.pex.pex -v --repo=dist/ -r wheel -r requests -r pex==0.8.0-rc0 -e pex.bin.pex:main -o dist/pex.pex.pex.pex
lgtm minus issues raised. Super excited to see improvements to the resolution machinery.
What happens if you're copying across devices but the file already exists? Is the exception guaranteed to be EEXIST (which would be fine)? Otherwise, if it could be EXDEV, you don't respect the overwrite parameter in that case.
We're very much interested in an alternate implementation where if the requirement is not exact, but it's _satisfiable_ by something in the cache, we also short circuit, regardless of ttl. I assume it will probably look like another implementation rather than more parameters, but it's worth keeping in mind. Is an infinite ttl equivalent to this?