Skip to content

Commit dcf0028

Browse files
committed
📝 Add pip secure installs
1 parent 7a519bf commit dcf0028

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/libs/install.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,28 @@ or
141141
142142
(.venv) $ python -m pip install "pandas>=2"
143143
144+
However, ``pip`` does not usually carry out any checks to protect against
145+
tampering and allows arbitrary code from the distributions to be executed. You
146+
can, however, use ``pip`` in a way that ensures more secure installation
147+
mechanisms:
148+
149+
``--require-hashes``
150+
enables hash verification mode.
151+
152+
This ensures that hashes have been provided in the requirements file. It is
153+
also a convenient way to create a list of hashes yourself, as it displays
154+
the hashes of the downloaded packages. However, only the preferred archive
155+
is downloaded for each package, so you may still need to add hashes for
156+
alternative archives using :samp:`pip hash {PACKAGE_NAME}` – for example, if
157+
different operating system variants are available.
158+
159+
``--only-binary :all:``
160+
prevents source code from being provided.
161+
162+
.. seealso::
163+
* `Secure installs <https://pip.pypa.io/en/stable/topics/secure-installs/>`_
164+
* `pip hash <https://pip.pypa.io/en/stable/cli/pip_hash/>`_
165+
144166
Proxy server
145167
~~~~~~~~~~~~
146168

0 commit comments

Comments
 (0)