On 9/3/20 2:47 AM, Charles Machalow wrote: > I may be in the minority, but sometimes it seems like having to spin up a > venv, etc. to run a small script could be a little bit much. > > What if we have something like this POC I wrote: > https://pypi.org/project/pyensure/ > > We could have a switch or python interpreter argument to have packages get > auto-installed (to a temp directory) in the event that we don't have it > installed in the current environment. > > One of the beauties of this is that it doesn't pollute the current > environment, since packages are installed to a temp directory (which is then > added to sys.path). > > Further optimizations (like preventing a need to redownload, import specific > package versions, or fixing imports that have a dot) could be made in a more > complete solution. > _______________________________________________
Other projects that might be relevant to this discussion: - https://github.com/PyAr/fades - https://github.com/jaraco/pip-run#script-runner In contrast to yours, both of them require users to run scripts with their own executables rather than the regular Python interpreter, but otherwise the idea is the same. fades in particular can reuse the venvs it created if it finds the installed packages are compatible with what the current execution requires. jaraco has been trying to get pip-run incorporated into pip itself ( https://github.com/pypa/pip/issues/3971 ). _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/XMQZHPJY3M5KP6SUQVG27MTCZHRF3XDJ/ Code of Conduct: http://python.org/psf/codeofconduct/