Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude pyproject.toml from dependency version bumps #186

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/dep-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
description: "Whitespace-delimited list of directories containing pyproject.toml and tox.ini files; defaults to repo's base directory."
default: ""
type: string
filenames:
description: "Whitespace-delimited list of filenames to evaluate for dependency version bumps; defaults to only tox.ini."
default: "tox.ini"
type: string
create-changenote:
description: "Defaults 'true' to create a misc changenote in the './changes' directory."
default: true
Expand Down Expand Up @@ -83,10 +87,10 @@ jobs:
working-directory: "repo"
run: |
if [ "${{ inputs.subdirectory }}" == "" ]; then
python ../beeware-.github/scripts/bump_versions.py
python ../beeware-.github/scripts/bump_versions.py --filenames ${{ inputs.filenames }}
else
for SUBDIR in ${{ inputs.subdirectory }}; do
python ../beeware-.github/scripts/bump_versions.py ${SUBDIR}
python ../beeware-.github/scripts/bump_versions.py ${SUBDIR} --filenames ${{ inputs.filenames }}
done
fi

Expand Down
16 changes: 14 additions & 2 deletions scripts/bump_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def parse_args():
"defaults to current directory"
),
)
parser.add_argument(
"--filenames",
default="",
nargs="+",
choices=["tox.ini", "pyproject.toml"],
help=(
"One or more filenames to evaluate. "
"All supported files are evaluated if not specified."
),
)

args = parser.parse_args()
print(f"\nEvaluating {args.subdirectory}")
Expand Down Expand Up @@ -196,8 +206,10 @@ def main():
ret_code = 0
try:
args = parse_args()
update_pyproject_toml(base_dir=args.subdirectory)
update_tox_ini(base_dir=args.subdirectory)
if not args.filenames or "pyproject.toml" in args.filenames:
update_pyproject_toml(base_dir=args.subdirectory)
if not args.filenames or "tox.ini" in args.filenames:
update_tox_ini(base_dir=args.subdirectory)
except BumpVersionError as e:
print(e.msg)
ret_code = e.error_no
Expand Down
Loading