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

Include a Python stub file for the interrogatedb module #4

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

WMOkiishi
Copy link
Contributor

These changes add a Python stub file for the interrogatedb module, allowing type-checkers and other code analysis tools to know what's contained within it. The stub will have to be manually updated whenever the module is changed, but this happens infrequently enough that it shouldn't be too much of an additional burden.

@rdb
Copy link
Member

rdb commented Sep 19, 2024

Did you create the stub file manually? Is the idea that we manually update this every time we update the API? Or can we auto-generate it using a script?

It's called interrogatedb/__init__.pyi, but interrogatedb is not a package, is that not misleading? Should it not just be interrogatedb.pyi?

@WMOkiishi
Copy link
Contributor Author

Yes, the idea was to manually update the stub. Would auto-generating it require hooking into the interface-making system? I didn't see any database files generated like they are for Panda3D proper.

The file structure is perhaps slightly misleading, but I don't see a configuration option for scikit-build to include a top-level file in a wheel.

@rdb
Copy link
Member

rdb commented Sep 19, 2024

Manual is fine for now, I suppose.

If it can't be copied directly from the source directory by scikit-build, perhaps it can just be copied alongside the .pyd/.so into the site-packages dir via CMake?

@WMOkiishi
Copy link
Contributor Author

Yup, using CMake works.

I agree that automating the generation of the stub file would be preferable and worth looking into in the future.

@rdb rdb merged commit ba177cf into panda3d:main Oct 29, 2024
3 checks passed
@WMOkiishi WMOkiishi deleted the python-stub branch November 11, 2024 01:01
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 this pull request may close these issues.

2 participants