On 29.02.2016 17:00, Wolfgang Maier wrote:
I just discovered a way that lets you do just that, but before using it for my own code I'd like to know whether you would consider it a weird hack that will probably not work in the future or something reasonable that could be used in production code? Here's the trick:
write a temporary distutils setup.cfg file in the current working directory with the content:
[install] install-lib=abspath/to/target_dir
then run pip from that directory like so:
pip install packagexy --prefix abspath/to/target_dir
Of note, combining a local setup.cfg file and --prefix like this isn't documented and to me it wasn't even clear whether the file would be expected in the current working directory that pip gets run in or in the downloaded package.
Answering my own question: its a messy hack that will not work from a virtualenv because distutils will ignore the local cfg file then.