-
Notifications
You must be signed in to change notification settings - Fork 21
fix: make pythonlings update prefer the current workspace #42
Copy link
Copy link
Closed
Labels
area: cliCommand-line interface behaviorCommand-line interface behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026good first issueGood for newcomersGood for newcomerssize: SSmall, focused contributionSmall, focused contribution
Description
Activity
Metadata
Metadata
Assignees
Labels
area: cliCommand-line interface behaviorCommand-line interface behaviorbugSomething isn't workingSomething isn't workingdev sprintPythonlings Community Dev Sprint August 2026Pythonlings Community Dev Sprint August 2026good first issueGood for newcomersGood for newcomerssize: SSmall, focused contributionSmall, focused contribution
Motivation
A learner who runs
pythonlings updatefrom an initialized workspace reasonably expects that workspace to update. Today the subcommand default targets the home workspace first, which is surprising and can point at a missing directory.Current evidence
pythonlings/cli.pygivesupdate --patha default ofdefault_workspace_root().update_workspace()correctly rejects a target withoutinfo.toml, but the CLI target-selection precedence is not aligned with user expectation.Exact scope
Resolve update targets in this order: explicit
update --path, global--root, current working directory when it is a workspace, then the default home workspace.updatemust never create a missing workspace.Acceptance checklist
pythonlings update --path PATHupdatesPATHregardless of the working directory or global root.pythonlings --root PATH updateupdates that root when no--pathis supplied.pythonlings updateinside a workspace updates the current workspace.pythonlings updateoutside a workspace falls back to the default home workspace.Explicit exclusions
Do not change init behavior, add implicit workspace creation to update, modify update copy semantics, or alter the
PYTHONLINGS_HOMEcontract.Likely files
pythonlings/cli.pypythonlings/core/workspace.pytests/integration/test_cli_workspace.pyVerification
Also exercise each precedence branch in a temporary directory and verify a missing target remains absent.
Sprint coordination
See the sprint Discussion. This issue is unassigned and is not a reservation.