pulumi/sdk/python
Anton Tayanovskyy d6db21dd55
Avoid repeatedly invoking `pip show` in Python lang host (#7831)
* Avoid repeatedly invoking `pip show` in Python lang host

The Python language host invokes `pip show` for each Pulumi package in a
project at startup. But `pip show` is quite slow in large projects: it
takes 2+ seconds per invocation in a project at @MaterializeInc.

`pip show` is invoked to compute the installed location of each plugin
package. But it turns out `pip list` takes a `-v` flag that can supply
this information in one shot, avoiding the need to ever invoke `pip
show`.

This patch shaves about 20s off our boot time for `pulumi up`.

(There's probably a separate bug in Pip that causes `pip show` to be so
slow, because `pip list` is an order of magnitude faster and does a lot
more work, but I didn't bother tracking that down.)

* Test and fix issue with parsing non-JSON trailer returned by pip

* Fix issues found by Go lint

* CHANGELOG entry

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
2021-08-25 11:40:58 -04:00
..
cmd Avoid repeatedly invoking `pip show` in Python lang host (#7831) 2021-08-25 11:40:58 -04:00
dist Fix windows build 2020-12-07 15:58:30 -08:00
lib Satisfy Python lint: factor out URN parsing in Python and other fixes (#7821) 2021-08-24 09:57:51 -04:00
stubs Fix bug in semver usage by enabling typechecking (#6833) 2021-04-21 15:48:57 -04:00
.gitignore add .venv/ to python .gitignore to ignore when using PIPENV_VENV_IN_PROJECT=1 2019-06-19 12:43:04 -07:00
.pylintrc Support remote components in Python (#5375) 2020-09-30 14:09:20 -07:00
Makefile Attempt to avoid triple-building projects in the solution (#7638) 2021-07-28 20:31:11 -04:00
Pipfile Re-introduce the fix for 7734 and mitigate CI hangs (#7746) 2021-08-13 11:07:13 -04:00
mypy.ini Fix bug in semver usage by enabling typechecking (#6833) 2021-04-21 15:48:57 -04:00
python.go Avoid double-quailfying venv folder path (#6599) 2021-03-24 15:51:46 -04:00
python_test.go Update pip/setuptools/wheel in virtual environment (#5042) 2020-07-23 13:33:09 -07:00
shim_unix.go Add copyright notice 2020-12-07 14:17:45 -08:00
shim_windows.go Add copyright notice 2020-12-07 14:17:45 -08:00