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

.pyi files for pya module #1915

Open
EugeneZelenko opened this issue Oct 30, 2024 · 4 comments
Open

.pyi files for pya module #1915

EugeneZelenko opened this issue Oct 30, 2024 · 4 comments

Comments

@EugeneZelenko
Copy link
Contributor

Hi, Matthias!

It'll be great to have Python interface files for pya module (for both KLayout and Qt bindings). It'll help to enforce type validation with MyPy.

Sure, it would be huge task.

@sebastian-goeldi
Copy link
Contributor

They already exist, but I think only for the python standalone module. Not sure how much work it would be to have them available in the GUI version

@klayoutmatthias
Copy link
Collaborator

The main problem is where to install them. The built in pya module does not have an installation space. It is just there, because this modules is bootstrap-loaded when KLayout initializes the interpreter.

Maybe there is a way to "borrow" them for PyCharm?

Matthias

@sebastian-goeldi
Copy link
Contributor

@klayoutmatthias I believe you can make a stub only package and just include it in the library folder. I believe it then should be called pya-stubs and any python typechecker should be able to pick it up. I once did this manually for klayout when it didn't have automatic type files for the standalone yet.

I'd be happy to help if there are problems or even just test it.

@klayoutmatthias
Copy link
Collaborator

Okay, that sounds easy. I will try if I can create such a module.

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

No branches or pull requests

3 participants