Skip to content

create_baseline_stubs.py script does not add default values #10126

Closed

Description

@Avasam

As title says. Now that typeshed prefers having default values, it would make sense if the create_baseline_stubs.py script added them.
Maybe that would be stubgen's job?
For now I'm running https://github.com/JelleZijlstra/stubdefaulter manually as I am moving stubs out of https://github.com/microsoft/python-type-stubs, but I don't think that's even documented/mentioned in the contributing guidelines.

Activity

  1. AlexWaygood commented on May 1, 2023

    @AlexWaygood
    Member

    Yeah, really this should be added to stubgen, but in the meantime, I wouldn't be opposed to adding a stubdefaulter step to create_baseline_stubs.py

  2. Avasam commented on May 1, 2023

    @Avasam
    SponsorCollaboratorAuthor

    Given that stubdefaulter is only avaiable from github, it won't be cached by pip. Meaning if I add it to requirements-tests.txt, it'll cause extra unnecessary downloads for the CI.
    Do you think it's a better idea to catch it as part of the create stub script? If not installed, stop the script and tell the user to install stubdefaulter? (python -m pip install git+https://github.com/JelleZijlstra/stubdefaulter.git#egg=stubdefaulter). It would be added to the initial pip install doc too.

    Or ask @JelleZijlstra to publish the tool on PyPI. But if usage in create_baseline_stubs.py is meant to be "temporary" (you know how these things go sometimes :P ) until added to stubgen idk if worth it.

    Thoughts?

  3. JelleZijlstra commented on May 1, 2023

    @JelleZijlstra
    Member

    https://pypi.org/project/stubdefaulter/0.1.0/

    Oops, I missed the description. I guess that's for 0.2.0 :)

  4. Avasam commented on May 1, 2023

    @Avasam
    SponsorCollaboratorAuthor

    Awesome.
    On it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions