Skip to content

Commit

Permalink
Fix usage when soliciting a path.Path, which typer doesn't support.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 28, 2024
1 parent 225fac0 commit 20c4e30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion jaraco/develop/add-project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

import operator
import subprocess
from typing_extensions import Annotated

import path
import typer

import jaraco.text
from jaraco.ui.main import main
Expand All @@ -19,7 +21,10 @@ def add_newlines(lines):


@main
def run(name: str, target: path.Path = path.Path()):
def run(
name: str,
target: Annotated[path.Path, typer.Option(parser=path.Path)] = path.Path(),
):
repo, path = git.projects_repo()
project = git.Project.parse(name)
with git.temp_checkout(repo, quiet=True):
Expand Down
5 changes: 4 additions & 1 deletion jaraco/develop/checkout-all.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import functools
from typing_extensions import Annotated

import path
import typer
from more_itertools import consume


from jaraco.ui.main import main

from . import git


@main
def run(target: path.Path = path.Path()):
def run(target: Annotated[path.Path, typer.Argument(parser=path.Path)] = path.Path()):
checkout = functools.partial(git.checkout_missing, root=target)
consume(map(checkout, git.projects()))
1 change: 1 addition & 0 deletions newsfragments/+dc04d32d.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix usage when soliciting a path.Path, which typer doesn't support.

0 comments on commit 20c4e30

Please sign in to comment.