cloudflare / stpyv8

Python 3 and JavaScript interoperability. Successor To PyV8 (https://github.com/flier/pyv8)
Apache License 2.0
430 stars 39 forks source link

Provide type annotations #76

Open Gobot1234 opened 1 year ago

Gobot1234 commented 1 year ago

Would you be open adding type annotations (in the form of .pyi files) to this project? I have them pretty much ready to go if you want

buffer commented 1 year ago

First of all sorry for the late reply. I am totally open to that so please feel free to share/open a PR. Thanks!

Gobot1234 commented 1 year ago

This might have to wait till I can compile a mac arm version on my machine cause I don't particularly fancy tangling with c++ right now.

buffer commented 1 year ago

No rush at all. Thanks for taking care of it. Really appreciate

devm18426 commented 12 months ago

Hi @buffer, me again.

I'd be interested in picking this up since it doesn't seem like too much work. There's one small thing to consult with you about. Type hints have improved gradually over the lifespan of Python 3. Initially supported exclusively through the typing package, then becoming slightly more native in 3.7 with the annotations future feature and finally reaching their current and most native state in 3.9 with the full inclusion of the annotations feature. Looking at setup.py it seems that this package supports a minimum Python version of 3.6, which means none of the newer type hint features. It would be nice to fully take advantage of the annotations feature with 3.9 however 3.7 could also do. I propose raising the minimum supported Python version to at least 3.9 for this reason and 2 more:

I'd love to hear your thoughts on the matter.

buffer commented 12 months ago

Hey @devm18426, glad you want to step in! Totally agree with you. There is no reason nowadays to still support Python versions 3.6, 3.7 and 3.8 so I am going to drop them soon. I will take care of updating the setup file and the workflows in the next hours.

Thanks!

UPDATE: Just dropped Python versions 3.6, 3.7 and 3.8 support