File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
"""Automation using nox.
2
2
"""
3
3
4
+ import argparse
4
5
import glob
5
6
import os
6
7
import shutil
@@ -183,7 +184,13 @@ def lint(session: nox.Session) -> None:
183
184
def vendoring (session : nox .Session ) -> None :
184
185
session .install ("vendoring~=1.2.0" )
185
186
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 ):
187
194
session .run ("vendoring" , "sync" , "-v" )
188
195
return
189
196
@@ -199,7 +206,9 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
199
206
200
207
vendor_txt = Path ("src/pip/_vendor/vendor.txt" )
201
208
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 :
203
212
continue
204
213
205
214
# update requirements.txt
You can’t perform that action at this time.
0 commit comments