-
Notifications
You must be signed in to change notification settings - Fork 275
Use real parameter names in stubs #1145
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
Use real parameter names in stubs #1145
Conversation
|
Ohh my god, @jonathanberthias, how much work was this? Thank you! I'll take a look |
|
can you please add a changelog entry? |
Not that much in the end, the errors from Detailsimport sys from dataclasses import dataclassimport subprocess STUBS_FILE = "src/pyscipopt/scip.pyi" """ @DataClass def get_stubtest_errors() -> list[str]: def parse_errors(errors: list[str]): def update_stub_file(stub_file, corrections): def remove_unwanted_defaults(stub_file: str, errors: list[str]): if name == "main":
Done! Sorry for forgetting each time 😅 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1145 +/- ##
==========================================
+ Coverage 55.07% 55.11% +0.03%
==========================================
Files 24 24
Lines 5420 5438 +18
==========================================
+ Hits 2985 2997 +12
- Misses 2435 2441 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Following #1141, this PR fixes all the errors related to missing or extra function parameters in the stubs! It also fixes some messages related to
disjoint_basesincestubtestreports them when missing.Using a script, all the
*args, **kwargsparameters introduced bystubgenwere replaced with the real parameter names. Parameters with default values are also marked with a default of....This makes for a very large PR, but there shouldn't be much to check other than the output of

stubtest. To test it out, you can install the version from this branch and any Python Language Server should be able to pick up the names, and provide suggestions when filling in the arguments to a function call:For now, all the parameters and return types are annotated with
Incompletewhich is equivalent totyping.Any. We just have to replace all of those with the appropriate types - only 2010 to go!