Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_baseline_stubs.py script does not add default values #10126

Closed
Avasam opened this issue May 1, 2023 · 4 comments · Fixed by #10127
Closed

create_baseline_stubs.py script does not add default values #10126

Avasam opened this issue May 1, 2023 · 4 comments · Fixed by #10127

Comments

@Avasam
Copy link
Collaborator

Avasam commented May 1, 2023

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.

@AlexWaygood
Copy link
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

@Avasam
Copy link
Collaborator Author

Avasam commented May 1, 2023

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?

@JelleZijlstra
Copy link
Member

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

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

@Avasam
Copy link
Collaborator Author

Avasam commented May 1, 2023

Awesome.
On it!

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 a pull request may close this issue.

3 participants