Project

Profile

Help

Bug #6563

open

Missing py stubs in saxonche (12.5)

Added by Yannick Einsweiler about 1 month ago. Updated 4 days ago.

Status:
New
Priority:
Normal
Category:
Python Build
Start date:
2024-10-18
Due date:
% Done:

100%

Estimated time:
Applies to branch:
12
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
12.5
Fixed in version:
SaxonC Languages:
Python
SaxonC Platforms:
All
SaxonC Architecture:
x86_64

Description

SaxonC 12.5 Python wheels do not include the stubs, which are essential for IDEs to provide autocompletion, type inference, and better code assistance.

Stubs (.pyi files) are required when the library is a compiled C extension, or IDEs like PyCharm can't properly infer types, methods, or classes, making development harder due to the lack of autocomplete and reference resolution.


Related issues

Copied from SaxonC - Bug #6277: How to build saxonche 12 under Windows?ClosedO'Neil Delpratt2023-12-03

Actions
Actions #1

Updated by Yannick Einsweiler about 1 month ago

  • Copied from Bug #6277: How to build saxonche 12 under Windows? added
Actions #2

Updated by Yannick Einsweiler about 1 month ago

Luckily someone created a separate package for that saxonche-stubs (https://pypi.org/project/saxonche-stubs/#description) but it's a subset and could become outdated. Ideally, the stubs should be part of the main library distribution.

Actions #3

Updated by O'Neil Delpratt about 1 month ago

  • SaxonC Platforms All added
  • SaxonC Platforms deleted (Linux)

Thanks for creating this bug issue. Yes this is something we should do and is on our todo list.

Actions #4

Updated by Bastian Politycki 13 days ago

O'Neil Delpratt wrote in #note-3:

Thanks for creating this bug issue. Yes this is something we should do and is on our todo list.

That's great! Is there already a detailed schedule? The saxonche-stubs package is indeed not complete. So far, I have only implemented types that I needed myself. However, I have no objections to stopping the development if the type annotations are integrated directly into the Saxon-Python package.

Actions #5

Updated by Matt Patterson 12 days ago

Bastian Politycki wrote in #note-4:

That's great! Is there already a detailed schedule? The saxonche-stubs package is indeed not complete.

We can't commit to a date or release, unfortunately. I'll be taking a look at your package with interest, but the process for generating .pyi stubs programmatically from Cython sources, rather than manually, looks like it's complex and existing tooling looks tricky to use reliably.

(If you have experience with that process, I'd love to hear about it.)

Actions #6

Updated by Yannick Einsweiler 11 days ago

Matt Patterson wrote in #note-5:

We can't commit to a date or release, unfortunately. I'll be taking a look at your package with interest, but the process for generating .pyi stubs programmatically from Cython sources, rather than manually, looks like it's complex and existing tooling looks tricky to use reliably.

Just my 2 cents: using a LLM ?

Actions #7

Updated by O'Neil Delpratt 4 days ago

Official documentation for stub file can be found here: https://peps.python.org/pep-0484/#stub-files

Actions #8

Updated by O'Neil Delpratt 4 days ago

  • Assignee changed from O'Neil Delpratt to Matt Patterson

Please register to edit this issue

Also available in: Atom PDF