Skip to content

Commit

Permalink
fix(python): uvupgrade script supports dependency-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
natelandau committed Jan 19, 2025
1 parent 77b0bb1 commit 868a168
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dotfiles/bin/executable_uvupgrade
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ def main() -> None:
uv("remove", package)
uv("add", package, extra)

dev_dependencies: list[str] = pyproject["tool"]["uv"]["dev-dependencies"]
if "uv" in pyproject["tool"] and "dev-dependencies" in pyproject["tool"]["uv"]:
dev_dependencies: list[str] = pyproject["tool"]["uv"]["dev-dependencies"]
elif "dev" in pyproject["dependency-groups"]:
dev_dependencies = pyproject["dependency-groups"]["dev"]
else:
dev_dependencies = []

package_pattern = r"^([a-zA-Z0-9\-]+)(?:\[([\w,\s-]+)\])?"
for dependency in dev_dependencies:
package_match = match(package_pattern, dependency)
Expand Down
1 change: 1 addition & 0 deletions dotfiles/dot_config/dotfile_source/000-xdg.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export RUSTUP_HOME="${XDG_DATA_HOME}"/rustup
export DOTNET_CLI_HOME="${XDG_DATA_HOME}"/dotnet
alias wget="wget --hsts-file='${XDG_DATA_HOME}/wget-hsts'"
export LESSHISTFILE="${XDG_STATE_HOME}"/less/history
export GNUPGHOME="${XDG_DATA_HOME}"/gnupg

0 comments on commit 868a168

Please sign in to comment.