Skip to content

Commit 2f5feef

Browse files
committedApr 16, 2025
lock: add documentation
1 parent 50e85e3 commit 2f5feef

File tree

5 files changed

+87
-5
lines changed

5 files changed

+87
-5
lines changed
 

‎docs/html/cli/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ pip_freeze
2323
pip_check
2424
```
2525

26+
```{toctree}
27+
:maxdepth: 1
28+
:caption: Resolving dependencies
29+
30+
pip_lock
31+
```
32+
2633
```{toctree}
2734
:maxdepth: 1
2835
:caption: Handling Distribution Files

‎docs/html/cli/pip_lock.rst

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
.. _`pip lock`:
3+
4+
========
5+
pip lock
6+
========
7+
8+
9+
10+
Usage
11+
=====
12+
13+
.. tab:: Unix/macOS
14+
15+
.. pip-command-usage:: lock "python -m pip"
16+
17+
.. tab:: Windows
18+
19+
.. pip-command-usage:: lock "py -m pip"
20+
21+
22+
Description
23+
===========
24+
25+
.. pip-command-description:: lock
26+
27+
Options
28+
=======
29+
30+
.. pip-command-options:: lock
31+
32+
.. pip-index-options:: lock
33+
34+
35+
Examples
36+
========
37+
38+
#. Emit a ``pylock.toml`` for the the project in the current directory
39+
40+
.. tab:: Unix/macOS
41+
42+
.. code-block:: shell
43+
44+
python -m pip lock -e .
45+
46+
.. tab:: Windows
47+
48+
.. code-block:: shell
49+
50+
py -m pip lock -e .

‎docs/man/commands/lock.rst

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:orphan:
2+
3+
========
4+
pip-lock
5+
========
6+
7+
Description
8+
***********
9+
10+
.. pip-command-description:: lock
11+
12+
Usage
13+
*****
14+
15+
.. pip-command-usage:: lock
16+
17+
Options
18+
*******
19+
20+
.. pip-command-options:: lock

‎docs/man/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pip-uninstall(1)
3434
pip-freeze(1)
3535
Output installed packages in requirements format.
3636

37+
pip-lock(1)
38+
Generate a lock file for requirements and their dependencies.
39+
3740
pip-list(1)
3841
List installed packages.
3942

‎src/pip/_internal/commands/lock.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@
2626

2727
class LockCommand(RequirementCommand):
2828
"""
29-
Lock packages from:
29+
EXPERIMENTAL - Lock packages and their dependencies from:
3030
3131
- PyPI (and other indexes) using requirement specifiers.
3232
- VCS project urls.
3333
- Local project directories.
3434
- Local or remote source archives.
3535
36-
pip also supports locking from "requirements files", which provide
37-
an easy way to specify a whole environment to be installed.
36+
pip also supports locking from "requirements files", which provide an easy
37+
way to specify a whole environment to be installed.
38+
39+
The generated lock file is only guaranteed to be valid for the current
40+
python version and platform.
3841
"""
3942

4043
usage = """
44+
%prog [options] [-e] <local project path> ...
4145
%prog [options] <requirement specifier> [package-index-options] ...
4246
%prog [options] -r <requirements file> [package-index-options] ...
43-
%prog [options] [-e] <vcs project url> ...
44-
%prog [options] [-e] <local project path> ...
4547
%prog [options] <archive url/path> ..."""
4648

4749
def add_options(self) -> None:

0 commit comments

Comments
 (0)
Please sign in to comment.