-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: Some packages couldn't be analyzed #51
fix: Some packages couldn't be analyzed #51
Conversation
…ere some packages couldn't be analyzed b/c the mypy build result could not be parsed from our side; some bug fixes and refactoring
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
+ Coverage 98.19% 98.26% +0.07%
==========================================
Files 25 25
Lines 1882 1905 +23
==========================================
+ Hits 1848 1872 +24
+ Misses 34 33 -1 ☔ View full report in Codecov by Sentry. |
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
✅ JSON | eslint-plugin-jsonc | 2 | 0 | 0 | 2.1s |
✅ JSON | jsonlint | 2 | 0 | 0.28s | |
✅ JSON | npm-package-json-lint | yes | no | 0.58s | |
prettier | 2 | 0 | 1 | 0.32s | |
✅ JSON | v8r | 2 | 0 | 6.28s | |
✅ PYTHON | black | 15 | 0 | 0 | 1.88s |
✅ PYTHON | mypy | 15 | 0 | 8.1s | |
✅ PYTHON | ruff | 15 | 0 | 0 | 0.06s |
✅ REPOSITORY | git_diff | yes | no | 0.01s |
See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true
in mega-linter.yml to validate all sources, not only the diff
@lars-reimann I didn't know how to handle type variables like |
What is the problem with those type variables? They were the only way to define classes with type parameters prior to Python 3.12 (PEP 695). So, there is no need to represent type variables directly, but only when they are used as type parameters. And there is no need to distinguish the different means to define type parameters. |
@lars-reimann So, if a type parameter is defined like this: _type_var = TypeVar("_type_var") it should not be shown in the Safe-DS stubs if its not used? And here the _type_var variable should be shown in the stubs: _type_var = TypeVar("_type_var")
def type_var_func(type_var_list: list[_type_var]) -> list[_type_var]: ... ? Also, how should the stubs for type variables look like? Like this? @PythonName("_type_var")
typeVar = "_type_var"
@Pure
@PythonName("type_var_func")
fun typeVarFunc(typeVarList: List<typeVar>) -> result1: List<typeVar> |
We treat type variables and the PEP 695 syntax identically. For the Python code you provided, the stubs would be @Pure
@PythonName("type_var_func")
fun typeVarFunc<TypeVar>(typeVarList: List<TypeVar>) -> result1: List<TypeVar> The syntax is identical to classes with type parameters: After the name you declare the type parameters and can then use them in the parameter and result list. |
…be-analyzed' into 48-currently-some-packages-cant-be-analyzed
I moved the issue regarding the TypeVars to a new issue (#63) so we can close this PR. @lars-reimann could you check this PR and close? |
I'll make room for this later today. |
tests/safeds_stubgen/stubs_generator/__snapshots__/test_generate_stubs.ambr
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve this now, so we can move forward. In the future, however, please create PRs that fix a single bug/add a single feature and add an accurate description of what you try to accomplish. Otherwise, it's not possible to determine whether a PR really works.
## [0.2.0](v0.1.0...v0.2.0) (2024-03-29) ### Features * Added generation for Safe-DS stubs files ([#33](#33)) ([ab45b45](ab45b45)) * Correct stubs for TypeVars ([#67](#67)) ([df8c5c9](df8c5c9)), closes [#63](#63) * Create stubs for public methods of inherited internal classes ([#69](#69)) ([71b38d7](71b38d7)), closes [#64](#64) * Rework import generation for stubs. ([#50](#50)) ([216e179](216e179)), closes [#38](#38) [#24](#24) [#38](#38) [#24](#24) * Safe-DS stubs also contain docstring information. ([#78](#78)) ([bdb43bd](bdb43bd)) * Stubs are created for referenced declarations in other packages ([#70](#70)) ([522f38d](522f38d)), closes [#66](#66) ### Bug Fixes * Some packages couldn't be analyzed ([#51](#51)) ([fa3d020](fa3d020)), closes [#48](#48) * Stub generation testing and fixing of miscellaneous bugs ([#76](#76)) ([97b0ab3](97b0ab3))
🎉 This PR is included in version 0.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes #48
Summary of Changes