diff options
author | Pradyun Gedam <pradyunsg@users.noreply.github.com> | 2023-02-06 17:26:46 +0000 |
---|---|---|
committer | Pradyun Gedam <pradyunsg@users.noreply.github.com> | 2023-02-06 17:34:10 +0000 |
commit | a373982a0cae47bb9f5a311b07f13b445cc97f9e (patch) | |
tree | 240ef000bdcbcf7955fdf838d67fe9c921370eb8 | |
parent | 7ff4da6e8f835867e01e36166cef4fe8a2be8b4b (diff) | |
download | pip-a373982a0cae47bb9f5a311b07f13b445cc97f9e.tar.gz |
Implement package-selection CLI in `nox -s vendoring`
This makes it easier to update/not update certain packages.
-rw-r--r-- | noxfile.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/noxfile.py b/noxfile.py index 1345c417d..5c4683b7d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ """Automation using nox. """ +import argparse import glob import os import shutil @@ -183,7 +184,13 @@ def lint(session: nox.Session) -> None: def vendoring(session: nox.Session) -> None: session.install("vendoring~=1.2.0") - if "--upgrade" not in session.posargs: + parser = argparse.ArgumentParser(prog="nox -s vendoring") + parser.add_argument("--upgrade-all", action="store_true") + parser.add_argument("--upgrade", action="append", default=[]) + parser.add_argument("--skip", action="append", default=[]) + args = parser.parse_args(session.posargs) + + if not (args.upgrade or args.upgrade_all): session.run("vendoring", "sync", "-v") return @@ -199,7 +206,9 @@ def vendoring(session: nox.Session) -> None: vendor_txt = Path("src/pip/_vendor/vendor.txt") for name, old_version in pinned_requirements(vendor_txt): - if name == "setuptools": + if name in args.skip: + continue + if args.upgrade and name not in args.upgrade: continue # update requirements.txt |