Skip to content

fix(cli): Migrate CLI to typer >=0.26#2080

Merged
Pijukatel merged 2 commits into
apify:masterfrom
Mantisus:bump-typer
Jul 20, 2026
Merged

fix(cli): Migrate CLI to typer >=0.26#2080
Pijukatel merged 2 commits into
apify:masterfrom
Mantisus:bump-typer

Conversation

@Mantisus

Copy link
Copy Markdown
Collaborator

Description

  • Cli has been updated for better compatibility with typer and no longer uses direct calls to click

Issues

@Mantisus Mantisus changed the title fix{cli}: Migrate CLI to typer >=0.26 fix(cli): Migrate CLI to typer >=0.26 Jul 19, 2026
@Mantisus

Copy link
Copy Markdown
Collaborator Author

After the update, crawlee create --help displays the correct information

image

An error caused by an incorrect input is displayed correctly

image

@Mantisus
Mantisus requested review from Pijukatel and vdusek and removed request for vdusek July 19, 2026 11:38
@Mantisus Mantisus self-assigned this Jul 19, 2026
@vdusek
vdusek requested a review from Copilot July 20, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates crawlee’s CLI implementation to be compatible with typer >= 0.26 by removing direct usage of external click types (notably click.Choice) and relying on Typer’s own choice handling, allowing the typer<0.26 pin to be dropped (per #2063).

Changes:

  • Refactored create command parameters to use typing.Annotated + Literal-based choice typing instead of click.Choice.
  • Relaxed the cli extra dependency constraint to typer>=0.26.0.
  • Re-locked dependencies, updating uv.lock to a newer Typer version.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/crawlee/_cli.py Removes external click.Choice usage and switches CLI option typing to Typer-friendly annotations.
pyproject.toml Drops the typer<0.26 pin for the cli extra.
uv.lock Updates the resolved Typer version and dependency metadata after re-locking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/crawlee/_cli.py
Comment on lines +39 to +42
else:
CrawlerType = Literal[tuple(crawler_choices)]
HttpClientType = Literal[tuple(http_client_choices)]
PackageManagerType = Literal[tuple(package_manager_choices)]

@vdusek vdusek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pijukatel

Copy link
Copy Markdown
Collaborator

Looks good, lets just verify that E2E tests are ok: https://github.com/apify/crawlee-python/actions/runs/29748094500

@Pijukatel
Pijukatel merged commit c864b96 into apify:master Jul 20, 2026
124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate CLI to typer >=0.26 and drop the typer<0.26 pin

5 participants