rapidsai / dependency-file-generator

https://pypi.org/project/rapids-dependency-file-generator/
Apache License 2.0
15 stars 13 forks source link

AttributeError with Python 3.8 #56

Closed dagardner-nv closed 8 months ago

dagardner-nv commented 9 months ago

I get an AttributeError with Python 3.8, but not with 3.10.

Repro:

conda create -n rdfg_test python=3.8
conda activate rdfg_test
pip install rapids-dependency-file-generator
rapids-dependency-file-generator --help

Error:

Traceback (most recent call last):
  File "/home/dagardner/work/conda/envs/rdfg_test/bin/rapids-dependency-file-generator", line 5, in <module>
    from rapids_dependency_file_generator.cli import main
  File "/home/dagardner/work/conda/envs/rdfg_test/lib/python3.8/site-packages/rapids_dependency_file_generator/cli.py", line 12, in <module>
    from .rapids_dependency_file_validator import validate_dependencies
  File "/home/dagardner/work/conda/envs/rdfg_test/lib/python3.8/site-packages/rapids_dependency_file_generator/rapids_dependency_file_validator.py", line 12, in <module>
    importlib.resources.files(__package__).joinpath("schema.json").read_bytes()
AttributeError: module 'importlib.resources' has no attribute 'files'
vyasr commented 9 months ago

Our pyproject.toml should probably be updated to specify that we require Python 3.9. The function in question was introduced in Python 3.9. Is Python 3.8 support important to you (i.e. is it particularly valuable for us to find a way to rewrite that code to support Python 3.8)? FWIW RAPIDS now requires 3.9 which is probably why none of the devs are seeing this issue.

dagardner-nv commented 9 months ago

@vyasr Python 3.8 isn't important to me, I mostly ran into this issue by accident as 3.8 is the default Python version my OS uses.

Once I realized it was working in 3.10 but not 3.8 I went back to check the minimum version on pypi and noticed 3.8 was listed as the minimum.

vyasr commented 8 months ago

Cool. I've opened a PR to update the minimum required version. Thanks for the ping!

ajschmidt8 commented 8 months ago

:tada: This issue has been resolved in version 1.7.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: