You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Python Dependencies with GitHub Copilot CLI
Dependabot is great, but it is tedious when you have a multiple pyproject.toml files to update. Multiple updates often mean dealing with merge conflicts.
This script solves that. It uses GitHub Copilot CLI to process all dependencies and update them.
Setup
Create a directory to store the files in (ie ~/prompts/ghcli)
Copy the 2 files below into the new directory
Make the shell script executable - chmod +x ~/prompts/ghcli/bump-deps.sh
Symlink the shell script your $PATH - ln -s ~/prompts/ghcli/bump-deps-uv.sh ~/.bin/bump-deps-uv
You're all set.
Usage
Run bump-deps-uv in any project directory. GitHub Copilot CLI will update your dependencies for you.
Model Selection
I tried using Claude Haiku 4.5 and GPT mini models. It was a case of getting what you paid for. They went off the rails more often than not. Sonnet performs well with the constrained prompt.
Disclaimer
Like with all things powered by an LLM, your mileage may vary.
You need to update all the python dependencies in this project.
IMPORTANT: You are unable to redirect output or pipe commands. You must read the output of one command and invoke the next.
The shell commands you have available are:
git
sed
uv
All other shell commands are blocked.
The current version specifiers for each item must be maintained. If the current version is using strict versions (ie ==), this must retained. If it is at least (ie >=) then you must retain this constraint. If it is a range, then you must only increase the minimum version. If the new version increases the minimum equal to or higher than the top end of the constraint change it to an at least specification. If a compatible release clause is used, bump the version but maintain the specifier (ie ~=).
Ignore the contents of any .venv or venv directories.
To complete this task perform the following steps:
Locate any directory that contains a pyproject.toml file.
Change into the first directory you find
Run uv pip list --outdated
Identify all outdated direct dependencies. Ignore any transitive dependencies.
Update the pyproject.toml file with the latest versions
Run uv sync --upgrade to install the new versions
Run git status to check if there are any changes. If there are no changes, jump to step 11 below.
If this is first set of changes create a branch called bump-deps
Commit the changes using the following message format "Update dependencies\n\n -> \n..." The packages must be listed in alphabetical order
Make sure you committed the changes as per step 9 before moving on. If there are changes for this directory, there must be a git commit for it.
If there are more directories with pyproject.toml files, change into the next directory and go to step 3 above
If there are no more directories, output "Finished processing updates in: " and exit
This file contains hidden or 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