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

Wrong package name and Python module created #117

Closed
lars-reimann opened this issue Apr 25, 2024 · 2 comments
Closed

Wrong package name and Python module created #117

lars-reimann opened this issue Apr 25, 2024 · 2 comments
Assignees
Labels
bug 🪲 Something isn't working duplicate This issue or pull request already exists

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 25, 2024

Describe the bug

The package names and @PythonModule annotations of the created stubs are wrong. For example, the stub for the Image class of Safe-DS starts with

@PythonModule("safeds.data.image.containers._image")
package safeds.data.image.containers.Image

It should instead be

@PythonModule("safeds.data.image.containers")
package safeds.data.image.containers

and since the package name and @PythonModule are then identical, it can be shortened to just

package safeds.data.image.containers

To Reproduce

  1. Create stubs for Safe-DS (adjust the source path): safe-ds-stubgen -o "out" -nc -s "../library/src" --docstyle NUMPYDOC -v
  2. Open out/safeds/data/image/containers/_image/image.sdsstub

Expected behavior

  1. The class name should not be part of the package name.
  2. For internal modules, no stubs should be created, i.e. the @PythonModule should never include parts that begin with an underscore. In this case, the class Image is reexported, so naturally stubs should still be created, but under a different package/Python module.

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann
Copy link
Member Author

In data__api.json, all entries of reexported_by are also empty.

@lars-reimann lars-reimann added the duplicate This issue or pull request already exists label May 2, 2024
@lars-reimann
Copy link
Member Author

Works when using an absolute path for the -s argument, making this a duplicate of #125.

@lars-reimann lars-reimann closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
@github-project-automation github-project-automation bot moved this from Backlog to ✔️ Done in Library Analysis May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working duplicate This issue or pull request already exists
Projects
Status: ✔️ Done
Development

No branches or pull requests

2 participants