Skip to content

Conversation

@ryanking13
Copy link
Member

Drops typer dependency

cc: @evenharder

Copy link

@evenharder evenharder left a comment

Choose a reason for hiding this comment

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

Thank you for your constructive work! I have also previously tried to convert it in my local, and the results are fairly similar. There are some minor comments I want to address.

base_path,
wheel_url,
):
"""Add a set of package wheels to an existing pyodide-lock.json and

Choose a reason for hiding this comment

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

Arguments are not printed by default in click. If we were to provide consistency, we can explicitly add argument info in the docstring by appending

    \b
    Arguments:
        WHEELS: List of paths to wheel files. (required)

or something similar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. Thanks for the pointer!

@click.option(
"--base-path",
type=click.Path(path_type=Path),
default=None,

Choose a reason for hiding this comment

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

Is None accepted as click.Path? As typer version worked well, it will do so, but I am slightly concerned about its behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it does. I believe click will not change the None to something else, and it should be fine then.

assert "needs-one-opt" in example_lock_spec.packages
assert example_lock_spec.packages["needs-one-opt"].file_name.startswith(
"http://www.nowhere.org/dist/nEEds"
"http://www.nowhere.org/dist/needs"

Choose a reason for hiding this comment

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

I wonder why it was written with nEEds in the first place, it should have been intentional?

Copy link
Contributor

Choose a reason for hiding this comment

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

probably to test name canonicalization

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure why the original test was written with nEEds and why it passed. The filename should be canonicalized I gueess.

@bollwyvl
Copy link
Contributor

Love removing deps, but why not go all the way and use argparse from stdlib? It isn't that bad for simple tasks like this, and one could use a little pydantic model for defaults, validation, documentation, e.g. Config(**vars((parser.parse_args())).

@ryanking13
Copy link
Member Author

Love removing deps, but why not go all the way and use argparse from stdlib? It isn't that bad for simple tasks like this, and one could use a little pydantic model for defaults, validation, documentation, e.g. Config(**vars((parser.parse_args())).

Well, we would like to integrate different tools in a single pyodide entrypoint umbrella, which is not easy to achieve with click.

@ryanking13
Copy link
Member Author

@evenharder

Thank you for your constructive work! I have also previously tried to convert it in my local, and the results are fairly similar. There are some minor comments I want to address.

Thanks. I hope my work didn't conflict with yours. I was trying to improve our build system and wanted to push this forward. If you are working on other packages, please let me know.

@ryanking13 ryanking13 merged commit aca3fe6 into pyodide:main Jan 2, 2026
3 checks passed
@ryanking13 ryanking13 deleted the remove-typer branch January 2, 2026 06:30
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.

3 participants