mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-27 13:28:51 +07:00
* nox pip-compile: allow passing --no-upgrade flag
This allows running `nox -e pip-compile -- --no-upgrade` to make sure
that the requirements.txt files are in sync with the .in files but not
updating any other transitive dependency.
* README: make "## Updating dependencies" more concise
Co-authored-by: Don Naro <dnaro@redhat.com>
---------
(cherry picked from commit e952dd4365)
Co-authored-by: Maxwell G <maxwell@gtmx.me>
Co-authored-by: Don Naro <dnaro@redhat.com>
This commit is contained in:
@@ -123,6 +123,12 @@ Use the following `nox` session to update the dependency lock files in `tests/`.
|
||||
nox -e pip-compile
|
||||
```
|
||||
|
||||
To synchronize dependency lock files with base requirements files without changing transitive dependencies, use the `--no-upgrade` flag:
|
||||
|
||||
``` bash
|
||||
nox -e pip-compile -- --no-upgrade
|
||||
```
|
||||
|
||||
> This session requires Python 3.10.
|
||||
|
||||
If you do not have Python 3.10 installed, you can use root-less podman with a Python 3.10 image as follows:
|
||||
|
||||
@@ -96,7 +96,7 @@ def pip_compile(session: nox.Session, req: str):
|
||||
# Use --upgrade by default unless a user passes -P.
|
||||
args = list(session.posargs)
|
||||
if not any(
|
||||
arg.startswith("-P") or arg.startswith("--upgrade-package") for arg in args
|
||||
arg.startswith(("-P", "--upgrade-package", "--no-upgrade")) for arg in args
|
||||
):
|
||||
args.append("--upgrade")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user