Issue 14270: Can't install a project in a specific directory (original) (raw)
Further changes are needed.
The new dest_dir argument is not passed down to the internal functions, so I don’t understand how this is supposed to work.
install_local_project needs a dest_dir argument too; Jonathan Fernandes started work on this at the last sprint.
The test needs to be improved to really install a module and a script for example; I started to do that and also removed the usage of dist.Distribution (which is not the kind of distribution the install module works with: it uses database.Distribution and pypi.Dist (forgot the exact name) objects — yes, this is confusing as hell) but then the test code did not install anything; I ran out of time. I think tests should avoid using dist.Distribution and MagicMock but stay as close to possible as real usage:
to test installing from a directory, create a temp dir with a setup.cfg file, a module and a script and call install_local_project (and other public functions that support a dir) with this dir as argument
to test installing from an archive, create files, archive them and call the public install function with the path to that file as argument
to test install_from_infos, call install_from_infos with a pypi.Something object pointing to an archive in a temp dir
That way, we could have confidence that all of this works, without explicitly using the internal functions in our tests.