pw_env_setup: Pin Python package versions

Add a file to pass to the '--constraint' option of 'pip'. This allows
setup.cfg files to only set actual requirements on dependencies but
ensures the actual version retrieved for a given commit is always the
same.

Added a new command 'pw python-packages'. 'pw python-packages list'
writes the list of versions of installed packages to a file.
'pw python-packages diff' compares the list of installed packages to the
constraint file. If there are new packages or updates to package
versions 'pw python-packages diff' will fail.

Added an option to pw_env_setup, '--unpin-pip-packages'. If this is set
the constraint file defined in the top-level '.gn' file is ignored. This
should periodically be used to update versions of packages in the
constraint file.

Change-Id: I49337e029b0c5c82ac1414448d97d952d9df4dae
Bug: 459
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58280
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/.gn b/.gn
index 60ce6bd..f898dae 100644
--- a/.gn
+++ b/.gn
@@ -13,3 +13,8 @@
 # the License.
 
 buildconfig = "//BUILDCONFIG.gn"
+
+default_args = {
+  pw_build_PIP_CONSTRAINTS =
+      [ "//pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint.list" ]
+}