Skip to content

Commit

Permalink
fix: Include default group when starting from an empty lockfile
Browse files Browse the repository at this point in the history
Fix #2050

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Jun 25, 2023
1 parent 1e1c01f commit 81f7fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pdm/cli/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def do_add(
group = selection.one()
tracked_names: set[str] = set()
requirements: dict[str, Requirement] = {}
lock_groups = [] if project.lockfile.empty() else project.lockfile.groups
lock_groups = ["default"] if project.lockfile.empty() else project.lockfile.groups
if lock_groups is not None and group not in lock_groups:
project.core.ui.echo(f"Adding group [success]{group}[/] to lockfile", err=True, style="info")
lock_groups.append(group)
Expand Down

0 comments on commit 81f7fc4

Please sign in to comment.