f-dangel / unfoldNd

(N=1,2,3)-dimensional unfold (im2col) and fold (col2im) in PyTorch
MIT License
82 stars 6 forks source link

Port package version discovery from pkg_resources [deprecated] to importlib+distutils #37

Closed xaf-cv closed 2 months ago

xaf-cv commented 2 months ago

A quick fix for "ImportError: No module named pkg_resources".

Context: "Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions." - https://setuptools.pypa.io/en/latest/pkg_resources.html

Thank you for your work on the library!

f-dangel commented 2 months ago

Thanks for setting this up. Currently the tests are failing in Python 3.7. What is the minimum python version required to make this work? (I'm okay deprecating Python 3.7+3.8)

xaf-cv commented 2 months ago

You are welcome. The importlib.metadata has been introduced in 3.8, so only 3.7 needs to be deprecated. I have updated the corresponding definitions. GH-Actions can now pass with no issues.