This is easy, short, and uses existing syntax and an existing module. Yes, I know technically the API isn't promised; I wouldn't object to making that API official. But PLEASE, no new syntax for doing this!>>> import pip>>> pip.main(['install', 'boltons'])Requirement already satisfied (use --upgrade to upgrade): boltons in ./anaconda/lib/python3.5/site-packages0
>>> pip.main(['install', 'nonesuch'])Collecting nonesuchCould not find a version that satisfies the requirement nonesuch (from versions: )No matching distribution found for nonesuch1
On Tue, Sep 20, 2016 at 1:40 AM Paul Moore <p.f.moore@gmail.com> wrote:On 19 September 2016 at 23:13, אלעזר <elazarg@gmail.com> wrote:
> Alternative syntax might be that of import decorators
>
> @from_pip("attrs")
> import attr
At which point you may as well just (insert disclaimer about "using
pip's internal API isn't supported" here, and glossing over the fact
that pip doesn't yet have an install function with this API) do
import pip
pip.install('attrs')
import attrPlease forgive me for my ignorance, but it doesn't work as written - what's the actual method?Elazar
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/