fix deprecated pkg_resources
pkg_resources is deprecated.
Replace pkg_resources with importlib.resources, which available on python>=3.10.
https://setuptools.pypa.io/en/latest/pkg_resources.html
@trim21 Many tests failed. Any idea what we can do to fix them?
@trim21 Many tests failed. Any idea what we can do to fix them?
I'm looking into it.
this works fine in my project but doesn't work in hpy testing, not sure why. looks like generated py file is imported in a very strange way.
this works fine in my project but doesn't work in hpy testing, not sure why. looks like generated py file is imported in a very strange way.
Many of the errors seem to come from import hpymod; print(hpymod.__doc__) which doesn't seem that strange.
this works fine in my project but doesn't work in hpy testing, not sure why. looks like generated py file is imported in a very strange way.
Many of the errors seem to come from
import hpymod; print(hpymod.__doc__)which doesn't seem that strange.
some tests just import package with python -m mod so the assumption of __package__ is not empty failed.
Just fixed
should works fine
ci is still broken, I'll fix this.
should works fine now, just test in my repo
Couldn't you just use the backport on Python < 3.10?
Couldn't you just use the backport on Python < 3.10?
In that way developers(hpy users) will need to add extra pypi requiremenets to make it work, right?
In that way developers(hpy users) will need to add extra pypi requiremenets to make it work, right?
However pkg_resources (which is provided by setuptools) has already been an extra requirement. We can't assume setuptools is installed everywhere.
Yeah, this is just swapping one requirement for another, and you should even make it conditionally installed only on Python < 3.10.
In that way developers(hpy users) will need to add extra pypi requiremenets to make it work, right?
However pkg_resources (which is provided by setuptools) has already been an extra requirement. We can't assume setuptools is installed everywhere.
make sense
I'm not very familiar with hpy itself, where should I add importlib_resources requirements to make tests pass?
I'm not very familiar with hpy itself, where should I add
importlib_resourcesrequirements to make tests pass?
Presumably in setup.py where it has a requirement on setuptools?
I do not have the time to complete this, feel free to cherry-pick.