Skip to content

Commit

Permalink
Use explicit argument names
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Nov 15, 2024
1 parent 24a996c commit 60d1c55
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .github/scripts/update-version-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
sed -i "/\[stable\]/{n;s/version=.*/version=$1/}" eachdist.ini
sed -i "/\[prerelease\]/{n;s/version=.*/version=$2/}" eachdist.ini

./scripts/eachdist.py update_patch_versions --versions $1,$2,$3,$4
./scripts/eachdist.py update_patch_versions \
--stable_version=$1 \
--unstable_version=$2 \
--stable_version_prev=$3 \
--unstable_version_prev=$4

18 changes: 10 additions & 8 deletions scripts/eachdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def setup_instparser(instparser):
patchreleaseparser.add_argument("--stable_version_prev", required=True)
patchreleaseparser.add_argument("--unstable_version_prev", required=True)


fmtparser = subparsers.add_parser(
"format",
help="Formats all source code with black and isort.",
Expand Down Expand Up @@ -675,20 +674,23 @@ def patch_release_args(args):
targets = list(find_targets_unordered(rootpath))
cfg = ConfigParser()
cfg.read(str(find_projectroot() / "eachdist.ini"))
versions = args.versions.split(",")
# stable
mcfg = cfg["stable"]
packages = mcfg["packages"].split()
print(f"update stable packages to {versions[0]}")
update_patch_dependencies(targets, versions[0], versions[2], packages)
update_version_files(targets, versions[0], packages)
print(f"update stable packages to {args.stable_version}")
update_patch_dependencies(
targets, args.stable_version, args.stable_version_prev, packages
)
update_version_files(targets, args.stable_version, packages)

# prerelease
mcfg = cfg["prerelease"]
packages = mcfg["packages"].split()
print(f"update prerelease packages to {versions[1]}")
update_patch_dependencies(targets, versions[1], versions[3], packages)
update_version_files(targets, versions[1], packages)
print(f"update prerelease packages to {args.unstable_version}")
update_patch_dependencies(
targets, args.unstable_version, args.unstable_version_prev, packages
)
update_version_files(targets, args.unstable_version, packages)


def test_args(args):
Expand Down

0 comments on commit 60d1c55

Please sign in to comment.