Skip to content

Commit d1ded7d

Browse files
committed
Applied suggestions from code review in jazzband#1862
1 parent 7508511 commit d1ded7d

File tree

1 file changed

+43
-28
lines changed

1 file changed

+43
-28
lines changed

README.md

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
[![jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/)
2-
[![pypi](https://img.shields.io/pypi/v/pip-tools.svg)](https://pypi.org/project/pip-tools/)
3-
[![pyversions](https://img.shields.io/pypi/pyversions/pip-tools.svg)](https://pypi.org/project/pip-tools/)
4-
[![pre-commit](https://results.pre-commit.ci/badge/github/jazzband/pip-tools/main.svg)](https://results.pre-commit.ci/latest/github/jazzband/pip-tools/main)
5-
[![buildstatus-gha](https://github.com/jazzband/pip-tools/workflows/CI/badge.svg)](https://github.com/jazzband/pip-tools/actions?query=workflow%3ACI)
6-
[![codecov](https://codecov.io/gh/jazzband/pip-tools/branch/main/graph/badge.svg)](https://codecov.io/gh/jazzband/pip-tools)
1+
[![jazzband][jazzband-image]](jazzband)
2+
[![pypi][pypi-image]](pypi)
3+
[![pyversions][pyversions-image]](pyversions)
4+
[![pre-commit][pre-commit-image]](pre-commit)
5+
[![buildstatus-gha][buildstatus-gha-image]](buildstatus-gha)
6+
[![codecov][codecov-image]](codecov)
77

88
# pip-tools = pip-compile + pip-sync
99

1010
A set of command line tools to help you keep your `pip`-based packages fresh,
1111
even when you've pinned them. You do pin them, right? (In building your Python application and its dependencies for production, you want to make sure that your builds are predictable and deterministic.)
1212

13-
[![pip-tools overview for phase II](https://github.com/jazzband/pip-tools/raw/main/img/pip-tools-overview.svg)](https://github.com/jazzband/pip-tools/raw/main/img/pip-tools-overview.svg)
13+
[![pip-tools overview for phase II][pip-tools-overview]](pip-tools-overview)
1414

1515
## Installation
1616

1717
Similar to `pip`, `pip-tools` must be installed in each of your project's
1818
[virtual environments](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments):
1919

20-
```
20+
```console
2121
$ source /path/to/venv/bin/activate
2222
(venv) $ python -m pip install pip-tools
2323
```
@@ -62,7 +62,7 @@ or [flit](https://flit.pypa.io/).
6262
Suppose you have a 'foobar' Python application that is packaged using `Setuptools`,
6363
and you want to pin it for production. You can declare the project metadata as:
6464

65-
```
65+
```toml
6666
[build-system]
6767
requires = ["setuptools", "setuptools-scm"]
6868
build-backend = "setuptools.build_meta"
@@ -82,7 +82,7 @@ want to pin it for production. You also want to pin your development tools
8282
in a separate pin file. You declare `django` as a dependency and create an
8383
optional dependency `dev` that includes `pytest`:
8484

85-
```
85+
```toml
8686
[build-system]
8787
requires = ["hatchling"]
8888
build-backend = "hatchling.build"
@@ -98,7 +98,7 @@ dev = ["pytest"]
9898

9999
You can produce your pin files as easily as:
100100

101-
```
101+
```console
102102
$ pip-compile -o requirements.txt pyproject.toml
103103
#
104104
# This file is autogenerated by pip-compile with Python 3.10
@@ -166,7 +166,7 @@ django
166166

167167
Now, run `pip-compile requirements.in`:
168168

169-
```
169+
```console
170170
$ pip-compile requirements.in
171171
#
172172
# This file is autogenerated by pip-compile with Python 3.10
@@ -199,7 +199,7 @@ To force `pip-compile` to update all packages in an existing
199199
To update a specific package to the latest or a specific version use the
200200
`--upgrade-package` or `-P` flag:
201201

202-
```
202+
```console
203203
# only update the django package
204204
$ pip-compile --upgrade-package django
205205

@@ -214,7 +214,7 @@ You can combine `--upgrade` and `--upgrade-package` in one command, to
214214
provide constraints on the allowed upgrades. For example to upgrade all
215215
packages whilst constraining requests to the latest version less than 3.0:
216216

217-
```
217+
```console
218218
$ pip-compile --upgrade --upgrade-package 'requests<3.0'
219219
```
220220

@@ -223,7 +223,7 @@ $ pip-compile --upgrade --upgrade-package 'requests<3.0'
223223
If you would like to use _Hash-Checking Mode_ available in `pip` since
224224
version 8.0, `pip-compile` offers `--generate-hashes` flag:
225225

226-
```
226+
```console
227227
$ pip-compile --generate-hashes requirements.in
228228
#
229229
# This file is autogenerated by pip-compile with Python 3.10
@@ -252,14 +252,14 @@ To output the pinned requirements in a filename other than
252252
multiple files, for example with different constraints on django to test a
253253
library with both versions using [tox](https://tox.readthedocs.io/en/latest/):
254254

255-
```
255+
```console
256256
$ pip-compile --upgrade-package 'django<1.0' --output-file requirements-django0x.txt
257257
$ pip-compile --upgrade-package 'django<2.0' --output-file requirements-django1x.txt
258258
```
259259

260260
Or to output to standard output, use `--output-file=-`:
261261

262-
```
262+
```console
263263
$ pip-compile --output-file=- > requirements.txt
264264
$ pip-compile - --output-file=- < requirements.in > requirements.txt
265265
```
@@ -269,7 +269,7 @@ $ pip-compile - --output-file=- < requirements.in > requirements.txt
269269
Any valid `pip` flags or arguments may be passed on with `pip-compile`'s
270270
`--pip-args` option, e.g.
271271

272-
```
272+
```console
273273
$ pip-compile requirements.in --pip-args "--retries 10 --timeout 30"
274274
```
275275

@@ -280,7 +280,7 @@ confusing consumers of your custom script you can override the update command
280280
generated at the top of requirements files by setting the
281281
`CUSTOM_COMPILE_COMMAND` environment variable.
282282

283-
```
283+
```console
284284
$ CUSTOM_COMPILE_COMMAND="./pipcompilewrapper" pip-compile requirements.in
285285
#
286286
# This file is autogenerated by pip-compile with Python 3.10
@@ -340,7 +340,7 @@ pytz==2023.3
340340
Now compile the dev requirements and the `requirements.txt` file is used as
341341
a constraint:
342342

343-
```
343+
```console
344344
$ pip-compile dev-requirements.in
345345
#
346346
# This file is autogenerated by pip-compile with Python 3.10
@@ -369,13 +369,13 @@ the dev environment.
369369

370370
To install requirements in production stage use:
371371

372-
```
372+
```console
373373
$ pip-sync
374374
```
375375

376376
You can install requirements in development stage by:
377377

378-
```
378+
```console
379379
$ pip-sync requirements.txt dev-requirements.txt
380380
```
381381

@@ -385,7 +385,7 @@ You might use `pip-compile` as a hook for the [pre-commit](https://github.com/pr
385385
See [pre-commit docs](https://pre-commit.com/) for instructions.
386386
Sample `.pre-commit-config.yaml`:
387387

388-
```
388+
```yaml
389389
repos:
390390
- repo: https://github.com/jazzband/pip-tools
391391
rev: 6.13.0
@@ -395,7 +395,7 @@ repos:
395395
396396
You might want to customize `pip-compile` args by configuring `args` and/or `files`, for example:
397397

398-
```
398+
```yaml
399399
repos:
400400
- repo: https://github.com/jazzband/pip-tools
401401
rev: 6.13.0
@@ -407,7 +407,7 @@ repos:
407407

408408
If you have multiple requirement files make sure you create a hook for each file.
409409

410-
```
410+
```yaml
411411
repos:
412412
- repo: https://github.com/jazzband/pip-tools
413413
rev: 6.13.0
@@ -447,7 +447,7 @@ or upgrade.
447447
**Be careful**: `pip-sync` is meant to be used only with a
448448
`requirements.txt` generated by `pip-compile`.
449449

450-
```
450+
```console
451451
$ pip-sync
452452
Uninstalling flake8-2.4.1:
453453
Successfully uninstalled flake8-2.4.1
@@ -463,7 +463,7 @@ Successfully installed click-4.1
463463
To sync multiple `*.txt` dependency lists, just pass them in via command
464464
line arguments, e.g.
465465

466-
```
466+
```console
467467
$ pip-sync dev-requirements.txt requirements.txt
468468
```
469469

@@ -472,7 +472,7 @@ Passing in empty arguments would cause it to default to `requirements.txt`.
472472
Any valid `pip install` flags or arguments may be passed with `pip-sync`'s
473473
`--pip-args` option, e.g.
474474

475-
```
475+
```console
476476
$ pip-sync requirements.txt --pip-args "--no-cache-dir --no-deps"
477477
```
478478

@@ -562,3 +562,18 @@ versions as the required `pip` versions.
562562
| 6.4.0 | 21.2 - 21.3.\* | 3.6 - 3.10 |
563563
| 6.5.0 - 6.10.0 | 21.2 - 22.3.\* | 3.7 - 3.11 |
564564
| 6.11.0+ | 22.2+ | 3.7 - 3.11 |
565+
566+
567+
[jazzband]: https://jazzband.co/
568+
[jazzband-image]: https://jazzband.co/static/img/badge.svg
569+
[pypi]: https://pypi.org/project/pip-tools/
570+
[pypi-image]: https://img.shields.io/pypi/v/pip-tools.svg
571+
[pyversions]: https://pypi.org/project/pip-tools/
572+
[pyversions-image]: https://img.shields.io/pypi/pyversions/pip-tools.svg
573+
[pre-commit]: https://results.pre-commit.ci/latest/github/jazzband/pip-tools/main
574+
[pre-commit-image]: https://results.pre-commit.ci/badge/github/jazzband/pip-tools/main.svg
575+
[buildstatus-gha]: https://github.com/jazzband/pip-tools/actions?query=workflow%3ACI
576+
[buildstatus-gha-image]: https://github.com/jazzband/pip-tools/workflows/CI/badge.svg
577+
[codecov]: https://codecov.io/gh/jazzband/pip-tools
578+
[codecov-image]: https://codecov.io/gh/jazzband/pip-tools/branch/main/graph/badge.svg
579+
[pip-tools-overview]: https://github.com/jazzband/pip-tools/raw/main/img/pip-tools-overview.svg

0 commit comments

Comments
 (0)