xmlsec / python-xmlsec

Python bindings for the XML Security Library.
MIT License
95 stars 99 forks source link

Missing `template` in stubs (pyi) #247

Closed tdivis closed 1 year ago

tdivis commented 1 year ago

As I upgraded to a newer version of python-xmlsec, mypy in my project started to report errors:

error: Module has no attribute "template"  [attr-defined]

My code is working and looks like:

import xmlsec
...
xmlsec.template.add_x509_data(key_info)

I figured it's since ceaea9c as the line from xmlsec import constants, template, tree was removed from src/xmlsec/__init__.pyi and only constants and tree was returned in different forms of import, but template seems to be forgotten.

tdivis commented 1 year ago

So how should we fix this? How are the stubs (re)generated? I didn't find any documentation about this. Is this automatic process or some manual work? Or should I simply create Pull Request wit added import of template?

tdivis commented 1 year ago

I simply added it to the stub, please let me know if this is OK or I should use different approach.