hbldh / pybankid

BankID Relying Party client for Python
https://pybankid.readthedocs.io
MIT License
48 stars 19 forks source link

Use builtin importlib.resources. #66

Closed pelme closed 6 months ago

pelme commented 6 months ago

Supporting Python >=3.9 does not require using the backport.

Also, use joinpath() to simplify the retrival of the path+return pathlib.Path instead of str.

hbldh commented 6 months ago

I had intended to keep compatibility to 3.7, but only test on >=3.9. This breaks that. But it is better to avoid that dependency, so lets go with this.

pelme commented 6 months ago

Thanks! Hopefully most people have moved past 3.7 now :)

cthart commented 6 months ago

This doesn't just break on Python 3.7 but also breaks with AttributeError: module 'importlib.resources' has no attribute 'files' on Python 3.8.10 which we're still using extensively on Ubuntu 20.04. Any chance you can revert this change?

hbldh commented 6 months ago

Yes. In that case I will look at a modification that enables use of 3.7 and forward.

pelme commented 6 months ago

Since 3.8 was not part of CI i did not think it was supported.

It is probably possible to avoid the error by using importlib.resources.path instead. That would avoid having to pull in the extra dependency while still supporting Python >=3.7.

cthart commented 6 months ago

It's a bit of a catch-22 situation as importlib.resources.path is deprecated as of 3.11, while the suggested replacement as_file was new in 3.9

cthart commented 6 months ago

See also issue #69

hbldh commented 6 months ago

This should now be solved and is released in newly published version 1.2.0 on PyPI.