Skip to content

Commit 8b7955d

Browse files
authored
Merge pull request #11782 from pradyunsg/better-vendoring
2 parents 5a9efde + a373982 commit 8b7955d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

noxfile.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Automation using nox.
22
"""
33

4+
import argparse
45
import glob
56
import os
67
import shutil
@@ -183,7 +184,13 @@ def lint(session: nox.Session) -> None:
183184
def vendoring(session: nox.Session) -> None:
184185
session.install("vendoring~=1.2.0")
185186

186-
if "--upgrade" not in session.posargs:
187+
parser = argparse.ArgumentParser(prog="nox -s vendoring")
188+
parser.add_argument("--upgrade-all", action="store_true")
189+
parser.add_argument("--upgrade", action="append", default=[])
190+
parser.add_argument("--skip", action="append", default=[])
191+
args = parser.parse_args(session.posargs)
192+
193+
if not (args.upgrade or args.upgrade_all):
187194
session.run("vendoring", "sync", "-v")
188195
return
189196

@@ -199,7 +206,9 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
199206

200207
vendor_txt = Path("src/pip/_vendor/vendor.txt")
201208
for name, old_version in pinned_requirements(vendor_txt):
202-
if name == "setuptools":
209+
if name in args.skip:
210+
continue
211+
if args.upgrade and name not in args.upgrade:
203212
continue
204213

205214
# update requirements.txt

0 commit comments

Comments
 (0)