-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1214 from twm/bumps
Bump test dependencies
- Loading branch information
Showing
5 changed files
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/python3 | ||
# Copyright © 2023 Tom Most <[email protected]> | ||
# Copyright © 2023, 2024 Tom Most <[email protected]> | ||
|
||
import argparse | ||
import asyncio | ||
|
@@ -10,7 +10,7 @@ | |
repo_root = Path(__file__).parent.parent | ||
|
||
_parser = argparse.ArgumentParser() | ||
_parser.add_argument("-P", "--upgrade-package", dest="packages", nargs="*") | ||
_parser.add_argument("packages", nargs="*") | ||
|
||
|
||
async def _run(args: Sequence[str]) -> None: | ||
|
@@ -36,7 +36,7 @@ def _requirements() -> list[tuple[str, str]]: | |
if i == -1: | ||
continue | ||
|
||
yield line[:i], line[line.index("==") + 2 :] | ||
yield line[:i], line[line.index("==") + 2 : -1] | ||
|
||
|
||
def _list_packages() -> list[str]: | ||
|
@@ -51,15 +51,15 @@ async def _main(packages: list[str]) -> None: | |
if not packages: | ||
packages = _list_packages() | ||
|
||
for package in sorted(set(packages)): | ||
for package in packages: | ||
print(f"Attempting bump of {package}") | ||
await _run(["tox", "-e", "deps", "--", "--upgrade-package", package]) | ||
proc = await asyncio.create_subprocess_exec("git", "diff", "--exit-code") | ||
await proc.wait() | ||
if proc.returncode == 0: | ||
continue | ||
versions = _list_versions(package) | ||
msg = f"{package} {' '.join(versions)}" | ||
versions = _list_versions(package.lower()) | ||
msg = f"{package} {', '.join(versions)}" | ||
print(msg) | ||
await _run(["git", "commit", "-am", msg]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters