fix: Stub generation testing and fixing of miscellaneous bugs#76
fix: Stub generation testing and fixing of miscellaneous bugs#76lars-reimann merged 84 commits intomainfrom
Conversation
# Conflicts: # tests/safeds_stubgen/stubs_generator/test_generate_stubs.py
# Conflicts: # src/safeds_stubgen/stubs_generator/_generate_stubs.py # tests/safeds_stubgen/stubs_generator/test_generate_stubs.py
…t be found if they were "hidden" behind an if-statement
…tubs, now we take the full path from the first __init__.py file occurrence, since this is the way python does it, too
…st commit and removed it now
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #76 +/- ##
==========================================
+ Coverage 98.82% 99.21% +0.39%
==========================================
Files 25 25
Lines 2120 2176 +56
==========================================
+ Hits 2095 2159 +64
+ Misses 25 17 -8 ☔ View full report in Codecov by Sentry. |
…tubs-testing-and-fixing
|
@lars-reimann Nevermind, your request regarding the package names still does not work according to your requirements. I thought that, for example, a module |
|
But I'd say we close this PR first anyway, since the file changes are, once again, too much for a "quick" review. |
…tubs-testing-and-fixing
|
So, after todays meeting there seemed to be a problem with these stubs. How would the stubs for the from data.modules import ClassA as AliasA
class ClassB:
...
alias_b = ClassB
class AliasingModuleClassC():
typed_alias: alias_b
infer_alias = alias_b()
typed_alias_2: AliasA
infer_alias_2 = AliasA |
Ask yourself how you can import a class/global function from a library into your Python code. There might be multiple ways to do so, if they get reexported in
Then use that as the Safe-DS package name (after conversion to name convention). Example: # pack/_test.py
class MyClass# pack/__init__.py
from ._test import MyClass# Client code
from pack._test import MyClass # Legal, but not OK, since internal module
from pack import MyClass # OKResulting Safe-DS code: package pack
class MyClass() |
We cannot represent the type of |
…eing used, based on the __init__.py files
...snapshots__/test_generate_stubs/TestStubFileGeneration.test_stub_creation[_module_3].sdsstub
Outdated
Show resolved
Hide resolved
…tubs-testing-and-fixing
…ts at the start of the package
…tubs-testing-and-fixing
## [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 📦🚀 |
Summary of Changes
This PR contains the generated stub files from the Library project and is for testing those and fixing bugs, if they are found.
Exception__init__.pyfiles."