Hi everyone,
A new major version of flit and flit-core was recently released [1]. Flit documentation previously recommended that packages pin flit-core to `<4` in pyproject.toml metadata, which many projects did. There are 152 packages in rawhide that BuildRequire 'python3dist(flit-core)'. About 80% of those pin '<4'.
Note that, according to the flit changelog,
This version contains breaking changes, but most projects which are
already using the [project] table for metadata shouldn’t be affected, and can simply change the flit_core <4 constraint to <5.
so for many packages, the required changes would just be changing one character ("4" to "5") in pyproject.toml (or patching the dependencies using the %pyproject_patch_dependency macro as described below), but for other packages that use `[tool.flit.metadata]`, the required changes would be more involved.
How should we handle this? A couple potential options:
1. Mass add `%pyproject_patch_dependency flit-core:drop_upper` to all affected packages where possible. This is the most quick-n-dirty solution, but it doesn't contribute anything back to upstream projects. This solution also wouldn't work for packages that need to be ported away from `[tool.flit.metadata]`. We would need to figure out how many tool.flit.metadata users there still are and handle them separately. 2. Start an effort to patch package dependency constraints in pyproject.toml to allow both v3 and v4 and port [tool.flit.metadata] usage where applicable. Send the patches to upstreams. Then, upgrade python-flit-core to v4. 3. Update python-flit-core to v4 first, add a deprecated() v3 compat package, and then slowly on patching flit-core users and eventually removing the compat package.
Any thoughts about these ideas or other things that I missed? It would be nice to get this figured out before F46 branching so we don't get stuck with an old flit in EL 11.
All the best, Maxwell
On 13. 08. 26 22:14, Maxwell G wrote:
- Update python-flit-core to v4 first, add a deprecated() v3 compat
package, and then slowly on patching flit-core users and eventually removing the compat package.
I think this is the safest plan. I can drive the adoption in ELN package set and co-maintain the compat package.
https://src.fedoraproject.org/rpms/python-flit-core/pull-request/21
On 19. 08. 26 23:56, Miro Hrončok wrote:
On 13. 08. 26 22:14, Maxwell G wrote:
- Update python-flit-core to v4 first, add a deprecated() v3 compat
package, and then slowly on patching flit-core users and eventually removing the compat package.
I think this is the safest plan. I can drive the adoption in ELN package set and co-maintain the compat package.
https://src.fedoraproject.org/rpms/python-flit-core/pull-request/21
Heads up: flit-core has been updated to version 4.
There is a deprecated() compat package python3-flit-core3 for packages that still need version < 4.
Migrating everything to flit-core 4+ will eventually be necessary.
For many packages, this is as simple as unpinning an upper bound of a dependency specification:
%pyproject_patch_dependency flit_core:set_upper:5
See e.g. https://src.fedoraproject.org/rpms/python-installer/pull-request/6
Others might need more changes to pyproject.toml, see e.g.
https://github.com/pexpect/ptyprocess/pull/84 (upstream) https://src.fedoraproject.org/rpms/python-ptyprocess/pull-request/4
python-devel@lists.fedoraproject.org