From be2268ee874fabf2b96613cfaea104776f1f1d3d Mon Sep 17 00:00:00 2001 From: Devesh Kumar Singh Date: Sat, 28 Mar 2020 16:45:25 +0530 Subject: [PATCH] Clarify use of freeze in pip in program example --- docs/html/user_guide.rst | 6 ++++-- news/7008.doc | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 news/7008.doc diff --git a/docs/html/user_guide.rst b/docs/html/user_guide.rst index ae8b295bc7e..b9ea48580b3 100644 --- a/docs/html/user_guide.rst +++ b/docs/html/user_guide.rst @@ -814,8 +814,8 @@ This is easily done using the standard ``subprocess`` module:: subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package']) -If you want to process the output further, use one of the other APIs in the -module:: +If you want to process the output further, use one of the other APIs in the module. +We are using `freeze`_ here which outputs installed packages in requirements format.:: reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) @@ -832,3 +832,5 @@ of ability. Some examples that you could consider include: * ``distlib`` - Packaging and distribution utilities (including functions for interacting with PyPI). + +.. _freeze: https://pip.pypa.io/en/latest/reference/pip_freeze/ diff --git a/news/7008.doc b/news/7008.doc new file mode 100644 index 00000000000..0ecd15d2ca6 --- /dev/null +++ b/news/7008.doc @@ -0,0 +1 @@ +Clarify the usage of freeze command in the example of Using pip in your program