mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
stubsabot: Add distributions argument (#10505)
[stubsabot] Add distributions argument This allows to specify which explicitly which distributions to update. Useful for testing.
This commit is contained in:
@@ -692,8 +692,14 @@ async def main() -> None:
|
||||
default=None,
|
||||
help="Limit number of actions performed and the remainder are logged. Useful for testing",
|
||||
)
|
||||
parser.add_argument("distributions", nargs="*", help="Distributions to update, default = all")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.distributions:
|
||||
paths_to_update = [Path("stubs") / distribution for distribution in args.distributions]
|
||||
else:
|
||||
paths_to_update = list(Path("stubs").iterdir())
|
||||
|
||||
if args.action_level > ActionLevel.nothing:
|
||||
subprocess.run(["git", "update-index", "--refresh"], capture_output=True)
|
||||
diff_result = subprocess.run(["git", "diff-index", "HEAD", "--name-only"], text=True, capture_output=True)
|
||||
@@ -725,7 +731,7 @@ async def main() -> None:
|
||||
async with aiohttp.ClientSession(connector=conn) as session:
|
||||
tasks = [
|
||||
asyncio.create_task(determine_action(stubs_path, session))
|
||||
for stubs_path in Path("stubs").iterdir()
|
||||
for stubs_path in paths_to_update
|
||||
if stubs_path.name not in denylist
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user