I randomly came upon this issue while trying to import another python module: ``` File "/usr/lib/python3.12/site-packages/flexcache/__init__.py", line 14, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources' ``` Quick fix localy is to install `setuptools`, but this issue should be fixed upstream Reproducible: Always
Thanks for reporting this. Upstream released version 0.3 a few days ago (bug 2268657), and it looks like the pkg_resources dependency. I’m investigating whether or not 0.3 is a compatible update. If not, I’ll patch 0.2, at least in stable releases. Either way, I’ll resolve this.
There is a single regression in the tests for python-pint with python-flexcache 0.3, =================================== FAILURES =================================== _________________________________ test_decimal _________________________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_decimal0') float_cache_filename = (PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_decimal0/cache_with_float/7bc71037a7276cd293bfd568ceac8b7e281b87fd....th('/tmp/pytest-of-mockbuild/pytest-0/test_decimal0/cache_with_float/4b944840b14a729a70b8d1c7bd08d2b9bf1fa39c.pickle')) def test_decimal(tmp_path, float_cache_filename): ureg = pint.UnitRegistry( cache_folder=tmp_path / "cache_with_decimal", non_int_type=decimal.Decimal ) assert ureg._diskcache assert ureg._diskcache.cache_folder == tmp_path / "cache_with_decimal" assert ureg.cache_folder == tmp_path / "cache_with_decimal" files = tuple(ureg._diskcache.cache_folder.glob("*.pickle")) assert len(files) == 3 # check that the filenames with decimal are different to the ones with float float_filenames = tuple(p.name for p in float_cache_filename) for p in files: > assert p.name not in float_filenames E AssertionError: assert '7bc71037a7276cd293bfd568ceac8b7e281b87fd.pickle' not in ('7bc71037a7276cd293bfd568ceac8b7e281b87fd.pickle', 'd24c4342b4076b314916b79a2fcd0f262d9de55d.pickle', '4b944840b14a729a70b8d1c7bd08d2b9bf1fa39c.pickle') E + where '7bc71037a7276cd293bfd568ceac8b7e281b87fd.pickle' = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_decimal0/cache_with_decimal/7bc71037a7276cd293bfd568ceac8b7e281b87fd.pickle').name pint/testsuite/test_diskcache.py:51: AssertionError so for now I will just patch in a manual dependency on setuptools, and I’ll work on figuring out the python-pint incompatibility so I can update to python-flexcache 0.3 as a long-term solution. Thanks again for reporting this!
Funny because it's the same author. Could you check with the most recent pint version as well? Hopefully the blocker on the tmt side can be resolved soon https://github.com/teemtee/tmt/pull/2741
FEDORA-2024-fce057949d (python-flexcache-0.2-7.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-fce057949d
FEDORA-2024-fce057949d (python-flexcache-0.2-7.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report.
(In reply to Cristian Le from comment #3) > Funny because it's the same author. Could you check with the most recent > pint version as well? Hopefully the blocker on the tmt side can be resolved > soon https://github.com/teemtee/tmt/pull/2741 Yes, I was going to check with v0.23 next. Note that python-pint (through 0.23) bundles flexcache upstream, and we unbundle it downstream. I’ve talked with the upstream for both packages about just making that a normal dependency, and based on the state of the master branch, it seems like that is going to happen for 0.24. So the worst-case scenario is that we just have to wait a little longer…
I just confirmed that python-flexparser is not affected; version 0.2 already uses importlib.metadata.version rather than pkg_resources, just like flexcache 0.3.
FEDORA-2024-a71f0574ca (python-flexcache-0.2-7.fc40) has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-a71f0574ca
See https://src.fedoraproject.org/rpms/python-flexcache/pull-request/1: python-flexcache 0.3 is not compatible with python-pint 0.19.2, but it is compatible with 0.23 as currently proposed in https://src.fedoraproject.org/rpms/python-pint/pull-request/10 since I backported https://github.com/hgrecco/pint/commit/88199175f5fba58cd3a82fa0fbc61d98745ec7ca as a patch to 0.23. At the moment, I’m inclined to wait and do that update along with python-pint 0.23 rather than trying to backport the necessary fix to 0.19.2.
FEDORA-2024-4b99e87fff (python-flexcache-0.2-5.fc39) has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-4b99e87fff
FEDORA-2024-f7725fe9e6 (python-flexcache-0.2-4.fc38) has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2024-f7725fe9e6
FEDORA-EPEL-2024-f0d0cdfc31 (python-flexcache-0.2-3.el9) has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-f0d0cdfc31
FEDORA-EPEL-2024-f0d0cdfc31 has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-f0d0cdfc31 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2024-a71f0574ca has been pushed to the Fedora 40 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-a71f0574ca` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-a71f0574ca See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2024-4b99e87fff has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-4b99e87fff` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-4b99e87fff See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2024-f7725fe9e6 has been pushed to the Fedora 38 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f7725fe9e6` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f7725fe9e6 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2024-f0d0cdfc31 (python-flexcache-0.2-3.el9) has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2024-f7725fe9e6 (python-flexcache-0.2-4.fc38) has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2024-4b99e87fff (python-flexcache-0.2-5.fc39) has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2024-a71f0574ca (python-flexcache-0.2-7.fc40) has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report.