Bug 2268986 - Incompatible with python3.12
Summary: Incompatible with python3.12
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-flexcache
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Ben Beasley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-03-11 11:00 UTC by Cristian Le
Modified: 2024-03-23 00:33 UTC (History)
1 user (show)

Fixed In Version: python-flexcache-0.2-7.fc41 python-flexcache-0.2-3.el9 python-flexcache-0.2-4.fc38 python-flexcache-0.2-5.fc39 python-flexcache-0.2-7.fc40
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-03-11 12:47:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Cristian Le 2024-03-11 11:00:20 UTC
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

Comment 1 Ben Beasley 2024-03-11 12:00:20 UTC
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.

Comment 2 Ben Beasley 2024-03-11 12:14:35 UTC
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!

Comment 3 Cristian Le 2024-03-11 12:20:09 UTC
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

Comment 4 Fedora Update System 2024-03-11 12:44:42 UTC
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

Comment 5 Fedora Update System 2024-03-11 12:47:18 UTC
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.

Comment 6 Ben Beasley 2024-03-11 12:48:27 UTC
(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…

Comment 7 Ben Beasley 2024-03-11 12:55:53 UTC
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.

Comment 8 Fedora Update System 2024-03-11 13:14:30 UTC
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

Comment 9 Ben Beasley 2024-03-11 13:17:42 UTC
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.

Comment 10 Fedora Update System 2024-03-11 13:30:03 UTC
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

Comment 11 Fedora Update System 2024-03-11 14:01:09 UTC
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

Comment 12 Fedora Update System 2024-03-11 14:51:29 UTC
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

Comment 13 Fedora Update System 2024-03-12 00:24:13 UTC
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.

Comment 14 Fedora Update System 2024-03-12 02:18:50 UTC
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.

Comment 15 Fedora Update System 2024-03-12 03:01:50 UTC
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.

Comment 16 Fedora Update System 2024-03-12 03:59:26 UTC
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.

Comment 17 Fedora Update System 2024-03-20 00:34:51 UTC
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.

Comment 18 Fedora Update System 2024-03-20 01:55:37 UTC
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.

Comment 19 Fedora Update System 2024-03-20 02:03:57 UTC
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.

Comment 20 Fedora Update System 2024-03-23 00:33:41 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.