Bug 2402682 - reuse (>=6.0.0) pulls in python3-magic which conflicts with python3-file-magic
Summary: reuse (>=6.0.0) pulls in python3-magic which conflicts with python3-file-magic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: reuse
Version: 43
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jan Staněk
QA Contact: Fedora Extras Quality Assurance
URL: https://bodhi.fedoraproject.org/updat...
Whiteboard:
: 2406255 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-09 08:44 UTC by Nils Philippsen
Modified: 2025-10-30 04:34 UTC (History)
3 users (show)

Fixed In Version: reuse-6.1.2-2.fc42 reuse-6.1.2-3.fc43 reuse-6.1.2-3.fc42
Clone Of:
Environment:
Last Closed: 2025-10-19 02:38:04 UTC
Type: ---
Embargoed:
jstanek: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-2490 0 None None None 2025-10-10 10:30:42 UTC

Description Nils Philippsen 2025-10-09 08:44:07 UTC
Version 6.0.0 introduced a (mandatory, but also optional(*)) dependency on the `python-magic` module (in `python3-magic`), which breaks updating from older versions (or installing if another package depending on `python3-file-magic` is present).

(*): Upstream documents that it’s not really mandatory, but that package maintainers should patch it out if they don’t want to depend on it, d’uh: https://github.com/fsfe/reuse-tool/blob/293cb557eeb37de9493a0fbfcbf6c54768644222/pyproject.toml#L66

Reproducible: Always

Steps to Reproduce:
1. Have reuse (<6.0.0) and python3-file-magic installed
2. `dnf update`
Actual Results:
--- 8< ---
root@gibbon:~# dnf -C update
Updating and loading repositories:
Repositories loaded.
Problem: package reuse-6.1.2-1.fc43.noarch from updates-testing requires python3.14dist(python-magic) >= 0.4.12, but none of the providers can be installed
  - installed package python3-file-magic-5.46-8.fc43.noarch conflicts with python3-magic provided by python3-magic-0.4.27-15.fc43.noarch from updates-testing
  - installed package python3-file-magic-5.46-8.fc43.noarch conflicts with python3-magic provided by python3-magic-0.4.27-15.fc43.noarch from fedora
  - cannot install the best update candidate for package reuse-5.0.2-9.fc43.noarch
  - cannot install the best update candidate for package python3-file-magic-5.46-8.fc43.noarch

Package                                                               Arch            Version                                                                Repository                                   Size
Skipping packages with conflicts:
 python3-magic                                                        noarch          0.4.27-15.fc43                                                         updates-testing                          68.1 KiB
 python3-magic                                                        noarch          0.4.27-15.fc43                                                         fedora                                   68.1 KiB
Skipping packages with broken dependencies:
 reuse                                                                noarch          6.1.2-1.fc43                                                           updates-testing                           2.7 MiB

Nothing to do.
root@gibbon:~#
--- >8 ---

Expected Results:
Updating works

Comment 1 Jan Staněk 2025-10-10 10:30:09 UTC
This is indeed unfortunate. It also took me on a bit of a rabbit hole hunt of what the `python3-file-magic` package actually is – because there is an orphaned python3-file-magic (https://src.fedoraproject.org/rpms/python3-file-magic/) SRPM; only later I realized the python3-file-magic are actually python bindings from the file package. TIL.

The question is what to do with that. The most clean solution would probably be to teach reuse to be able to utilize the system bindings if available; from the https://github.com/ahupp/python-magic/blob/master/COMPAT.md, it looks that they should be compatible enough, but the reuse code would need massaging to only use the compat API. The quick'n'dirty solution would be to fall back to one of the other detection mechanism (charset-normalizer).

Given that maintaining reuse is not the main job I have, I'm going to switch to charset-normalizer for the time being (or for good) and call this hopefully fixed. Nevertheless, if you want to be even more helpful, raising this issue upstream (or even opening a PR) may help us to switch back to the apparently faster libmagic-based encoding detection.

Comment 2 Fedora Update System 2025-10-10 11:48:03 UTC
FEDORA-2025-a4093addcb (reuse-6.1.2-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-a4093addcb

Comment 3 Fedora Update System 2025-10-10 11:48:11 UTC
FEDORA-2025-6828ad5790 (reuse-6.1.2-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-6828ad5790

Comment 4 Fedora Update System 2025-10-11 01:22:53 UTC
FEDORA-2025-a4093addcb has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-a4093addcb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-a4093addcb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2025-10-11 01:43:50 UTC
FEDORA-2025-6828ad5790 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-6828ad5790`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-6828ad5790

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Jan Staněk 2025-10-14 13:43:46 UTC
As per feedback on https://bodhi.fedoraproject.org/updates/FEDORA-2025-a4093addcb#comment-4385328, just removing the dependency does not solve the issue. The problem seems to be that as long as python3-file-magic is installed on the system, reuse detects a python module named `python-magic`, assumes it is the one from `python3-magic` and tries to use it as such, leading to further errors. Looks like we will need to patch the code to somehow resolve that.

Comment 7 Fedora Update System 2025-10-19 02:38:04 UTC
FEDORA-2025-6828ad5790 (reuse-6.1.2-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2025-10-21 09:22:29 UTC
FEDORA-2025-cee53fc856 (reuse-6.1.2-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-cee53fc856

Comment 9 Fedora Update System 2025-10-21 09:22:32 UTC
FEDORA-2025-43524419d3 (reuse-6.1.2-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-43524419d3

Comment 10 Fedora Update System 2025-10-22 01:08:11 UTC
FEDORA-2025-43524419d3 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-43524419d3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-43524419d3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2025-10-22 02:27:17 UTC
FEDORA-2025-cee53fc856 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-cee53fc856`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-cee53fc856

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Jan Staněk 2025-10-29 13:14:42 UTC
*** Bug 2406255 has been marked as a duplicate of this bug. ***

Comment 13 Fedora Update System 2025-10-30 04:30:33 UTC
FEDORA-2025-cee53fc856 (reuse-6.1.2-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2025-10-30 04:34:38 UTC
FEDORA-2025-43524419d3 (reuse-6.1.2-3.fc42) has been pushed to the Fedora 42 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.