From Fedora Project Wiki
 
(40 intermediate revisions by 2 users not shown)
Line 2: Line 2:


= Deprecate python-toml =
= Deprecate python-toml =
{{Change_Proposal_Banner}}


== Summary ==
== Summary ==
<!-- A sentence or two summarizing what this change is and what it will do. This information is used for the overall changeset summary page for each release. Note that motivation for the change should be in the Benefit to Fedora section below, and this part should answer the question "What?" rather than "Why?". -->
<!-- A sentence or two summarizing what this change is and what it will do. This information is used for the overall changeset summary page for each release. Note that motivation for the change should be in the Benefit to Fedora section below, and this part should answer the question "What?" rather than "Why?". -->


The {{package|python-toml}} ({{package|python3-toml}}) package will be [https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/ deprecated] in [[Releases/38|Fedora 38]]. The [https://pypi.org/project/toml/ upstream package is considered dead] and Python 3.11 contains [https://peps.python.org/pep-0680/ a toml-reading library in the standard library]. Existing Fedora packages depend on {{package|python3-toml}}, so we cannot remove it yet. Packagers are encouraged to work with upstream to switch to [https://peps.python.org/pep-0680/ tomllib]/[https://pypi.org/project/tomli/ tomli] for reading toml or [https://pypi.org/project/tomli/ tomli-w] for writing it. But {{package|python-toml}} remains available until it is a leaf package, it will be removed then (possibly not yet in Fedora 38).
The {{package|python-toml}} (`python3-toml`) package will be [https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/ deprecated] in [[Releases/38|Fedora 38]]. The [https://pypi.org/project/toml/ upstream toml package] is considered unmaintained (see [[#Detailed_Description|description]]) and Python 3.11 contains [https://peps.python.org/pep-0680/ a TOML-reading library in the standard library]. Existing Fedora packages depend on {{package|python-toml}}, so we cannot remove it yet. Packagers are encouraged to work with upstreams to switch to [https://peps.python.org/pep-0680/ tomllib]/[https://pypi.org/project/tomli/ tomli] for reading toml or [https://pypi.org/project/tomli/ tomli-w] for writing it. But {{package|python-toml}} remains available until it is a leaf package, it will be removed then (possibly not yet in Fedora 38).


== Owner ==
== Owner ==
Line 23: Line 21:


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
[[Category:ChangeAcceptedF38]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
Line 41: Line 39:
ON_QA -> change is fully code complete
ON_QA -> change is fully code complete
-->
-->
* FESCo issue: <will be assigned by the Wrangler>
* [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/A2IPHXETVWOCWJUJBHKUZO2WODZXIYVT/ devel thread]
* Tracker bug: <will be assigned by the Wrangler>
* FESCo issue: [https://pagure.io/fesco/issue/2879 #2879]
* Release notes tracker: <will be assigned by the Wrangler>
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=2137375 #2137375]
* Release notes tracker: [https://pagure.io/fedora-docs/release-notes/issue/891 #891]


== Detailed Description ==
== Detailed Description ==
Line 49: Line 48:
The {{package|python-toml}} package is [https://pypi.org/project/toml/ unmaintained upstream]. It does not support the latest TOML standard and no longer releases newer versions.
The {{package|python-toml}} package is [https://pypi.org/project/toml/ unmaintained upstream]. It does not support the latest TOML standard and no longer releases newer versions.


We'd like to drop it from Fedora, but several packages still require it. Before we attempt to remove the package, we need to stop new packages to (Build)Require {{package|python3-toml}}, hence we want to have it [https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/ deprecated].
We'd like to drop it from Fedora, but several packages still require it. Before we attempt to remove the package, we need to stop new packages to (Build)Require `python3-toml`, hence we want to have it [https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/ deprecated]. No new packages that require it may be added to Fedora and existing packages may not gain new dependencies on it. Requiring it only `if python3 < 3.11` or similar is allowed because python3 on Fedora 38 is 3.11.


Packagers are encouraged to switch to an alternative toml library with upstream involvement. Downstream-only patches to switch are not encouraged. Change owners recommend the following alternatives:
Packagers are encouraged to switch to an alternative TOML library with upstream involvement. Downstream-only patches to switch are not encouraged. Change owners recommend the following alternatives:


* Use the [https://docs.python.org/3.11/library/tomllib.html tomllib] module from the standard library to read TOML with Python 3.11+.
* Use the [https://docs.python.org/3.11/library/tomllib.html tomllib] module from the standard library to read TOML with Python 3.11+.
* Use the {{package|python-tomli}} package to read TOML with an older version of Python. The tomllib module has started as tomli and they share the same API except for the module name.
* Use the {{package|python-tomli}} package to read TOML with an older version of Python. The `tomllib` module has started as `tomli` and they share the same API except for the module name.
* Use the {{package|python-tomli-w}} package to write TOML.
* Use the {{package|python-tomli-w}} package to write TOML.


Note that <code>repoquery</code> gives many packages that BuildRequire {{package|python3-toml}}:
Note that <code>repoquery</code> gives many packages depending on `python3-toml`:


  $ repoquery --repo=rawhide{,-source} --whatrequires python3-toml | wc -l
  $ repoquery --repo=rawhide{,-source} --whatrequires python3-toml | wc -l
Line 69: Line 68:
The change owners don't know how to [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/3YA5AVHIM65FRSTLLISY5Y7KNGOS4KYA/ easily filter them out], but when filtered the hard way, this remains:
The change owners don't know how to [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/3YA5AVHIM65FRSTLLISY5Y7KNGOS4KYA/ easily filter them out], but when filtered the hard way, this remains:


  $ for pkg in $(repoquery --repo=rawhide{,-source} --whatrequires python3-toml); do repoquery -q --repo=rawhide{,-source} --requires $pkg | grep -Fv '(python3dist(toml) if python3-devel < 3.11)' | grep -Eq '\btoml\b' && echo $pkg; done
(Results from 2022-10-05, may contain false positives.)
PyDrive2-0:1.14.0-2.fc37.src
 
  $ for pkg in $(repoquery --repo=rawhide{,-source} --whatrequires python3-toml); do repoquery -q --repo=rawhide{,-source} --requires $pkg | grep -Fv '(python3dist(toml) if python3-devel < 3.11)' | grep -Eq '(\(|-)toml\b' && echo $pkg; done
  academic-admin-0:0.5.1-10.fc37.noarch
  academic-admin-0:0.5.1-10.fc37.noarch
  academic-admin-0:0.5.1-10.fc37.src
  academic-admin-0:0.5.1-10.fc37.src
ansible-lint-1:6.7.0-1.fc38.src
  bandit-0:1.7.4-3.fc37.src
  bandit-0:1.7.4-3.fc37.src
  bst-external-0:0.29.0-1.fc38.src
  bst-external-0:0.29.0-1.fc38.src
  cvc4-0:1.8-12.fc37.src
  cvc4-0:1.8-12.fc37.src
fedfind-0:5.0.0-4.fc37.src
  fedora-license-data-0:1.5-1.fc38.src
  fedora-license-data-0:1.4-1.fc38.src
  fedora-messaging-0:3.1.0-5.fc38.src
  fedora-messaging-0:3.1.0-5.fc38.src
  gi-docgen-0:2022.1-7.fc38.noarch
  gi-docgen-0:2022.1-7.fc38.noarch
  gi-docgen-0:2022.1-7.fc38.src
  gi-docgen-0:2022.1-7.fc38.src
hatch-0:1.5.0-4.fc38.src
ini2toml-0:0.10-3.fc37.src
  jrnl-0:3.0-3.fc37.src
  jrnl-0:3.0-3.fc37.src
liquidctl-0:1.10.0-2.fc37.src
  micropipenv-0:1.4.2-1.fc37.noarch
  micropipenv-0:1.4.2-1.fc37.noarch
ocrmypdf-0:13.7.0-1.fc38.src
  pre-commit-0:2.20.0-2.fc37.noarch
  pre-commit-0:2.20.0-2.fc37.noarch
  pre-commit-0:2.20.0-2.fc37.src
  pre-commit-0:2.20.0-2.fc37.src
  pylint-0:2.14.4-3.fc37.src
  pylint-0:2.14.4-3.fc37.src
pytest-0:7.1.3-1.fc38.src
python-PyMunin3-0:3.0.1-1.fc38.src
python-SALib-0:1.4.5-4.fc37.src
python-amply-0:0.1.5-6.fc37.src
  python-anyconfig-0:0.13.0-3.fc37.src
  python-anyconfig-0:0.13.0-3.fc37.src
python-anyio-0:3.5.0-4.fc37.src
  python-anymarkup-0:0.8.1-10.fc37.src
  python-anymarkup-0:0.8.1-10.fc37.src
  python-anymarkup-core-0:0.8.1-9.fc37.src
  python-anymarkup-core-0:0.8.1-9.fc37.src
Line 102: Line 91:
  python-asttokens-0:2.0.8-1.fc38.src
  python-asttokens-0:2.0.8-1.fc38.src
  python-autopep8-0:1.6.0-5.fc37.src
  python-autopep8-0:1.6.0-5.fc37.src
python-black-0:22.8.0-1.fc38.src
  python-botocore-0:1.27.86-1.fc38.src
  python-botocore-0:1.27.84-1.fc38.src
python-boutdata-0:0.1.9-1.fc38.src
python-boututils-0:0.1.9-2.fc38.src
  python-box-0:6.0.2-1.fc38.src
  python-box-0:6.0.2-1.fc38.src
  python-build-0:0.8.0-4.fc37.src
  python-build-0:0.8.0-4.fc37.src
  python-check-manifest-0:0.48-3.fc37.src
  python-check-manifest-0:0.48-3.fc37.src
python-cmake-build-extension-0:0.5.1-4.fc37.src
python-configupdater-0:3.1-3.fc37.src
python-cppy-0:1.2.1-2.fc37.src
python-cssutils-0:2.4.2-2.fc37.src
  python-deepdiff-0:5.8.2-2.fc37.src
  python-deepdiff-0:5.8.2-2.fc37.src
  python-devicely-0:1.1.1-3.fc37.src
  python-devicely-0:1.1.1-3.fc37.src
python-django-auth-ldap-0:4.1.0-3.fc37.src
  python-elpy-0:1.34.0-8.fc37.src
  python-elpy-0:1.34.0-8.fc37.src
python-enrich-0:1.2.7-5.fc38.src
python-executing-0:1.1.0-1.fc38.src
  python-exoscale-0:0.7.1-4.fc37.src
  python-exoscale-0:0.7.1-4.fc37.src
  python-fasjson-client-0:1.0.7-5.fc38.src
  python-fasjson-client-0:1.0.7-5.fc38.src
  python-fireflyalgorithm-0:0.3.2-2.fc37.src
  python-fireflyalgorithm-0:0.3.2-2.fc37.src
python-flask-compress-0:1.13-2.fc38.src
python-humanize-0:3.13.1-5.fc37.src
python-importlib-metadata-0:4.12.0-2.fc37.src
  python-interrogate-0:1.5.0-4.fc37.src
  python-interrogate-0:1.5.0-4.fc37.src
python-jaraco-classes-0:3.2.3-1.fc38.src
python-jaraco-envs-0:2.4.0-1.fc38.src
python-jaraco-functools-0:3.5.2-1.fc38.src
python-jaraco-packaging-0:9.1.1-1.fc38.src
python-jaraco-path-0:3.3.1-6.fc37.src
  python-jsonpickle-0:2.2.0-4.fc37.src
  python-jsonpickle-0:2.2.0-4.fc37.src
python-keyring-0:23.9.3-1.fc38.src
python-keyrings-alt-0:4.1.2-1.fc38.src
python-kiwisolver-0:1.4.4-1.fc37.src
  python-lsp-black-0:1.2.0-3.fc37.src
  python-lsp-black-0:1.2.0-3.fc37.src
python-lsp-server-0:1.4.1-3.fc37.src
  python-matrix-nio-0:0.19.0-6.fc38.src
  python-matrix-nio-0:0.19.0-6.fc38.src
python-molecule-0:4.0.1-3.fc38.src
python-molecule-docker-0:2.1.0-1.fc38.src
  python-molecule-podman-0:1.0.1-4.fc37.src
  python-molecule-podman-0:1.0.1-4.fc37.src
python-nest-asyncio-0:1.5.5-3.fc37.src
  python-neurom-0:3.1.0-5.fc37.src
  python-neurom-0:3.1.0-5.fc37.src
  python-niaaml-0:1.1.11-1.fc38.src
  python-niaaml-0:1.1.11-1.fc38.src
Line 147: Line 111:
  python-niaclass-0:0.1.2-8.fc37.src
  python-niaclass-0:0.1.2-8.fc37.src
  python-nikola-0:8.2.2-4.fc37.src
  python-nikola-0:8.2.2-4.fc37.src
python-path-0:16.5.0-1.fc38.src
  python-pendulum-0:2.1.2-8.fc37.src
  python-pendulum-0:2.1.2-8.fc37.src
python-pikepdf-0:5.6.1-1.fc38.src
python-pint-0:0.16.1-8.fc37.src
  python-podman-3:4.2.0-7.fc38.src
  python-podman-3:4.2.0-7.fc38.src
python-portend-0:3.1.0-7.fc37.src
python-pure-eval-0:0.2.2-3.fc37.src
  python-pyedflib-0:0.1.30-2.fc37.src
  python-pyedflib-0:0.1.30-2.fc37.src
python-pymssql-0:2.2.5-3.fc37.src
  python-pyqt-feedback-flow-0:0.1.6-3.fc37.src
  python-pyqt-feedback-flow-0:0.1.6-3.fc37.src
python-pyscaffold-0:4.2.1-5.fc38.src
python-pytest-asyncio-0:0.19.0-1.fc37.src
python-pytest-localserver-0:0.7.0-1.fc38.src
python-pytest-services-0:2.2.1-4.fc37.src
  python-rich-0:12.6.0-1.fc38.src
  python-rich-0:12.6.0-1.fc38.src
  python-rst-linker-0:2.3.1-1.fc38.src
  python-rst-linker-0:2.3.1-1.fc38.src
python-shtab-0:1.5.5-3.fc37.src
  python-sklearn-nature-inspired-algorithms-0:0.9.0-3.fc37.src
  python-sklearn-nature-inspired-algorithms-0:0.9.0-3.fc37.src
python-sphinx_ansible_theme-0:0.9.1-3.fc37.src
  python-sport-activities-features-0:0.3.6-1.fc38.src
  python-sport-activities-features-0:0.3.6-1.fc38.src
python-stack-data-0:0.5.1-1.fc38.src
  python-stochastic-0:0.7.0-2.fc37.src
  python-stochastic-0:0.7.0-2.fc37.src
python-streamlink-0:5.0.1-1.fc38.src
python-subprocess-tee-0:0.3.5-5.fc37.src
python-tenacity-0:8.0.1-6.fc37.src
python-tinycss2-0:1.1.1-4.fc37.src
  python-toml-adapt-0:0.2.7-3.fc37.src
  python-toml-adapt-0:0.2.7-3.fc37.src
python-tqdm-0:4.64.1-1.fc38.src
python-twine-0:4.0.1-2.fc37.src
python-typeguard-0:2.13.3-5.fc38.src
python-ujson-0:5.5.0-1.fc38.src
  python-usort-0:0.6.3-7.fc37.src
  python-usort-0:0.6.3-7.fc37.src
  python-vulture-0:2.6-1.fc38.src
  python-vulture-0:2.6-1.fc38.src
python-xarray-0:2022.3.0-3.fc38.src
python-xbout-0:0.3.3-1.fc38.src
python-xmlsec-0:1.3.12-3.fc37.src
python-zipp-0:3.8.1-2.fc37.src
  python3-anymarkup-0:0.8.1-10.fc37.noarch
  python3-anymarkup-0:0.8.1-10.fc37.noarch
  python3-autopep8-0:1.6.0-5.fc37.noarch
  python3-autopep8-0:1.6.0-5.fc37.noarch
Line 200: Line 139:
  python3-usort-0:0.6.3-7.fc37.noarch
  python3-usort-0:0.6.3-7.fc37.noarch
  python3-vulture-0:2.6-1.fc38.noarch
  python3-vulture-0:2.6-1.fc38.noarch
rapidyaml-0:0.4.1-6.fc38.src
  rpmlint-0:2.2.0-7.fc38.noarch
  rpmlint-0:2.2.0-7.fc38.noarch
  rpmlint-0:2.2.0-7.fc38.src
  rpmlint-0:2.2.0-7.fc38.src
Line 208: Line 146:
  trac-tracnav-plugin-0:4.3-7.fc37.src
  trac-tracnav-plugin-0:4.3-7.fc37.src


That's 117 components:
=== List of components still (Build)Requiring python3-toml ===


* {{package|academic-admin}}
* {{package|academic-admin}}
* {{package|ansible-lint}}
* {{package|bandit}}
* {{package|bandit}}
* {{package|bst-external}}
* {{package|bst-external}}
* {{package|cvc4}}
* {{package|cvc4}}
* {{package|fedfind}}
* {{package|fedora-license-data}} (false positive, dependency conditional on python3 < 3.11)
* {{package|fedora-license-data}}
* {{package|fedora-messaging}} ([https://github.com/fedora-infra/fedora-messaging/pull/274 upstream fix])
* {{package|fedora-messaging}}
* {{package|gi-docgen}} ([https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/168 merged upstream PR])
* {{package|gi-docgen}}
* {{package|hatch}}
* {{package|ini2toml}}
* {{package|jrnl}}
* {{package|jrnl}}
* {{package|liquidctl}}
* {{package|micropipenv}} (already fixed in the meantime)
* {{package|micropipenv}} (already fixed in the meantime)
* {{package|ocrmypdf}}
* {{package|pre-commit}}
* {{package|pre-commit}}
* {{package|PyDrive2}}
* {{package|pylint}}
* {{package|pylint}}
* {{package|pytest}}
* {{package|python-amply}}
* {{package|python-anyconfig}}
* {{package|python-anyconfig}}
* {{package|python-anyio}}
* {{package|python-anymarkup}}
* {{package|python-anymarkup}}
* {{package|python-anymarkup-core}}
* {{package|python-anymarkup-core}}
Line 237: Line 165:
* {{package|python-asttokens}}
* {{package|python-asttokens}}
* {{package|python-autopep8}}
* {{package|python-autopep8}}
* {{package|python-black}}
* {{package|python-botocore}}
* {{package|python-botocore}}
* {{package|python-boutdata}}
* {{package|python-boututils}}
* {{package|python-box}}
* {{package|python-box}}
* {{package|python-build}}
* {{package|python-build}}
* {{package|python-cmake-build-extension}}
* {{package|python-configupdater}}
* {{package|python-cppy}}
* {{package|python-cssutils}}
* {{package|python-deepdiff}}
* {{package|python-deepdiff}}
* {{package|python-devicely}}
* {{package|python-devicely}}
* {{package|python-django-auth-ldap}}
* {{package|python-elpy}}
* {{package|python-elpy}}
* {{package|python-enrich}}
* {{package|python-executing}}
* {{package|python-exoscale}}
* {{package|python-exoscale}}
* {{package|python-fasjson-client}}
* {{package|python-fasjson-client}}
* {{package|python-fireflyalgorithm}}
* {{package|python-fireflyalgorithm}}
* {{package|python-flask-compress}}
* {{package|python-humanize}}
* {{package|python-check-manifest}}
* {{package|python-check-manifest}}
* {{package|python-importlib-metadata}}
* {{package|python-interrogate}}
* {{package|python-interrogate}}
* {{package|python-jaraco-classes}}
* {{package|python-jaraco-functools}} (superfluous, [https://src.fedoraproject.org/rpms/python-jaraco-functools/pull-request/5 fixed])
* {{package|python-jaraco-envs}}
* {{package|python-jaraco-functools}}
* {{package|python-jaraco-packaging}}
* {{package|python-jaraco-path}}
* {{package|python-jinja2-cli}}
* {{package|python-jinja2-cli}}
* {{package|python-jsonpickle}}
* {{package|python-jsonpickle}}
* {{package|python-keyring}}
* {{package|python-keyrings-alt}}
* {{package|python-kiwisolver}}
* {{package|python-lsp-black}}
* {{package|python-lsp-black}}
* {{package|python-lsp-server}}
* {{package|python-matrix-nio}}
* {{package|python-matrix-nio}}
* {{package|python-molecule}}
* {{package|python-molecule-docker}}
* {{package|python-molecule-podman}}
* {{package|python-molecule-podman}}
* {{package|python-nest-asyncio}}
* {{package|python-neurom}}
* {{package|python-neurom}}
* {{package|python-niaaml}}
* {{package|python-niaaml}}
Line 283: Line 187:
* {{package|python-niaclass}}
* {{package|python-niaclass}}
* {{package|python-nikola}}
* {{package|python-nikola}}
* {{package|python-path}}
* {{package|python-pendulum}}
* {{package|python-pendulum}}
* {{package|python-pikepdf}}
* {{package|python-pint}}
* {{package|python-podman}}
* {{package|python-podman}}
* {{package|python-portend}}
* {{package|python-pure-eval}}
* {{package|python-pyedflib}}
* {{package|python-pyedflib}}
* {{package|python-pymssql}}
* {{package|python-PyMunin3}}
* {{package|python-pyqt-feedback-flow}}
* {{package|python-pyqt-feedback-flow}}
* {{package|python-pyscaffold}}
* {{package|python-rich}} (superfluous, [https://src.fedoraproject.org/rpms/python-rich/pull-request/11 proposed fix])
* {{package|python-pytest-asyncio}}
* {{package|python-pytest-localserver}}
* {{package|python-pytest-services}}
* {{package|python-rich}}
* {{package|python-rst-linker}}
* {{package|python-rst-linker}}
* {{package|python-SALib}}
* {{package|python-shtab}}
* {{package|python-sklearn-nature-inspired-algorithms}}
* {{package|python-sklearn-nature-inspired-algorithms}}
* {{package|python-sphinx_ansible_theme}}
* {{package|python-sport-activities-features}}
* {{package|python-sport-activities-features}}
* {{package|python-stack-data}}
* {{package|python-stochastic}}
* {{package|python-stochastic}}
* {{package|python-streamlink}}
* {{package|python-subprocess-tee}}
* {{package|python-tenacity}}
* {{package|python-tinycss2}}
* {{package|python-toml-adapt}}
* {{package|python-toml-adapt}}
* {{package|python-tqdm}}
* {{package|python-twine}}
* {{package|python-typeguard}}
* {{package|python-ujson}}
* {{package|python-usort}}
* {{package|python-usort}}
* {{package|python-vulture}}
* {{package|python-vulture}}
* {{package|python-xarray}}
* {{package|python-xbout}}
* {{package|python-xmlsec}}
* {{package|python-zipp}}
* {{package|rapidyaml}}
* {{package|rpmlint}} (already fixed in the meantime)
* {{package|rpmlint}} (already fixed in the meantime)
* {{package|sip6}}
* {{package|sip6}}
Line 329: Line 205:


Once all dependencies are removed, we plan to retire {{package|python-toml}}, whether it will be in Fedora 38 (unlikely) or later.
Once all dependencies are removed, we plan to retire {{package|python-toml}}, whether it will be in Fedora 38 (unlikely) or later.
=== Migrating to tomllib ===
{{admon/important|Migrating to `tomllib`-only is only possible if the code will be run on Python 3.11 or newer. See the [[#Migrating_to_tomllib_on_Python_3.11+_and_falling_back_to_tomli]] section for a more portable solution.}}
* Remove any `toml` requirements from upstream metadata.
* Change all `toml` imports to `tomllib` imports.
* Change all references of `TomlDecodeError` to `TOMLDecodeError`.
* Open files in binary mode, if passing file objects to `tomllib.load()`.
=== Migrating to tomli ===
{{admon/important|Migrating to `tomli`-only leaves an unnecessary dependency on a 3rd party library which is now essentially a backport of a standard library module. See the [[#Migrating_to_tomllib_on_Python_3.11+_and_falling_back_to_tomli]] section for a more sustainable solution.}}
* Change any `toml` requirements in upstream metadata to `tomli`.
* Change all `toml` imports to `tomli` imports.
* Change all references of `TomlDecodeError` to `TOMLDecodeError`.
* Open files in binary mode, if passing file objects to `tomli.load()`.
=== Migrating to tomllib on Python 3.11+ and falling back to tomli ===
* Change any `toml` requirements in upstream metadata to `tomli;python_version<"3.11"`.
* Change all `toml` imports to `sys.version_info`-conditional or `try: except ImportError:` `tomli`/`tomllib` imports.
* Change all references of `TomlDecodeError` to `TOMLDecodeError`.
* Open files in binary mode, if passing file objects to `tomllib.load()`.
Example of importing:
try:
    import tomllib
except ImportError:
    import tomli as tomllib
Or:
if sys.version_info < (3, 11):
    import tomli as tomllib
else:
    import tomllib
Upstream examples: https://github.com/fedora-infra/fedora-messaging/pull/274 or https://github.com/pytest-dev/pytest/pull/9741
A more complex example that also falls back to `toml` on Python 2.7 or 3.6: https://github.com/tox-dev/tox/pull/2463
A more complex example that supports `pytoml`, `toml`, `tomli` and `tomllib`: https://github.com/thoth-station/micropipenv/pull/241
=== Migrating to tomli-w ===
* Change any `toml` requirements in upstream metadata to `tomli-w`.
* Change all `toml` imports to `tomli_w` imports.
* Open files in binary mode, if passing file objects to `tomli_w.dump()`.
A more complex example that migrates to `tomli`, `tomllib` and `tomli-w`: https://github.com/rpm-software-management/rpmlint/pull/905


== Feedback ==
== Feedback ==
Line 361: Line 290:
     https://fedoraproject.org/wiki/Changes/perl5.26 (major upgrade to a popular software stack, visible to users of that stack)
     https://fedoraproject.org/wiki/Changes/perl5.26 (major upgrade to a popular software stack, visible to users of that stack)
-->
-->
An upstream dead package will not be depended upon by new packages.


== Scope ==
== Scope ==
* Proposal owners:
* Proposal owners: Deprecate `python3-toml`. Work with packagers and upstream developers to remove the dependency. Monitor the remaining dependent packages and eventually retire {{package|python-toml}} (unlikely in Fedora 38).
<!-- What work do the feature owners have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
<!-- What work do the feature owners have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->


* Other developers: <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Other developers: No action needed. Don't add new dependencies on `python3-toml`. <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->


* Release engineering: [https://pagure.io/releng/issues #Releng issue number] <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Release engineering: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- Does this feature require coordination with release engineering (e.g. changes to installer image generation or update package delivery)?  Is a mass rebuild required?  include a link to the releng issue.  
<!-- Does this feature require coordination with release engineering (e.g. changes to installer image generation or update package delivery)?  Is a mass rebuild required?  include a link to the releng issue.  
The issue is required to be filed prior to feature submission, to ensure that someone is on board to do any process development work and testing and that all changes make it into the pipeline; a bullet point in a change is not sufficient communication -->
The issue is required to be filed prior to feature submission, to ensure that someone is on board to do any process development work and testing and that all changes make it into the pipeline; a bullet point in a change is not sufficient communication -->
Line 380: Line 310:


* Alignment with Objectives:  
* Alignment with Objectives:  
<!-- Does your proposal align with the current Fedora Objectives: https://docs.fedoraproject.org/en-US/project/objectives/ ? It's okay if it doesn't, but it's something to consider -->


== Upgrade/compatibility impact ==
== Upgrade/compatibility impact ==
<!-- What happens to systems that have had a previous versions of Fedora installed and are updated to the version containing this change? Will anything require manual configuration or data migration? Will any existing functionality be no longer supported? -->
<!-- What happens to systems that have had a previous version of Fedora installed and are updated to the version containing this change? Will anything require manual configuration or data migration? Will any existing functionality be no longer supported? -->


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 
The package will remain available. Only new packages cannot depend on it.
Once retired, we don't plan to provide <code>python3-toml</code> from `python3-libs` or `python3-tomli`, because it cannot work as a drop-in replacement (the Python module has a different name and slightly different API). The package will eventually be obsoleted by {{package|fedora-obsolete-packages}} once retired, but that is unlikely to happen soon.


== How To Test ==
== How To Test ==
Line 404: Line 334:


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 
$ repoquery --repo=rawhide --provides python3-toml
...
deprecated()
...


== User Experience ==
== User Experience ==
Line 417: Line 350:
  - Green has been scientifically proven to be the most relaxing color. The move to a default background color of green with green text will result in Fedora users being the most relaxed users of any operating system.
  - Green has been scientifically proven to be the most relaxing color. The move to a default background color of green with green text will result in Fedora users being the most relaxed users of any operating system.
-->
-->
No changes.


== Dependencies ==
== Dependencies ==
Line 422: Line 356:


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 
N/A (not a System Wide Change)


== Contingency Plan ==
== Contingency Plan ==


<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "Revert the shipped configuration".  Or it might not (e.g. rebuilding a number of dependent packages).  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "Revert the shipped configuration".  Or it might not (e.g. rebuilding a number of dependent packages).  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
* Contingency mechanism: (What to do?  Who will do it?) N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Contingency mechanism: revert the deprecation <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- When is the last time the contingency mechanism can be put in place?  This will typically be the beta freeze. -->
<!-- When is the last time the contingency mechanism can be put in place?  This will typically be the beta freeze. -->
* Contingency deadline: N/A (not a System Wide Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Contingency deadline: Final Freeze <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- Does finishing this feature block the release, or can we ship with the feature in incomplete state? -->
<!-- Does finishing this feature block the release, or can we ship with the feature in incomplete state? -->
* Blocks release? N/A (not a System Wide Change), Yes/No <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Blocks release? No <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 


== Documentation ==
== Documentation ==

Latest revision as of 18:10, 29 December 2022


Deprecate python-toml

Summary

The Package-x-generic-16.pngpython-toml (python3-toml) package will be deprecated in Fedora 38. The upstream toml package is considered unmaintained (see description) and Python 3.11 contains a TOML-reading library in the standard library. Existing Fedora packages depend on Package-x-generic-16.pngpython-toml, so we cannot remove it yet. Packagers are encouraged to work with upstreams to switch to tomllib/tomli for reading toml or tomli-w for writing it. But Package-x-generic-16.pngpython-toml remains available until it is a leaf package, it will be removed then (possibly not yet in Fedora 38).

Owner

Current status

Detailed Description

The Package-x-generic-16.pngpython-toml package is unmaintained upstream. It does not support the latest TOML standard and no longer releases newer versions.

We'd like to drop it from Fedora, but several packages still require it. Before we attempt to remove the package, we need to stop new packages to (Build)Require python3-toml, hence we want to have it deprecated. No new packages that require it may be added to Fedora and existing packages may not gain new dependencies on it. Requiring it only if python3 < 3.11 or similar is allowed because python3 on Fedora 38 is 3.11.

Packagers are encouraged to switch to an alternative TOML library with upstream involvement. Downstream-only patches to switch are not encouraged. Change owners recommend the following alternatives:

  • Use the tomllib module from the standard library to read TOML with Python 3.11+.
  • Use the Package-x-generic-16.pngpython-tomli package to read TOML with an older version of Python. The tomllib module has started as tomli and they share the same API except for the module name.
  • Use the Package-x-generic-16.pngpython-tomli-w package to write TOML.

Note that repoquery gives many packages depending on python3-toml:

$ repoquery --repo=rawhide{,-source} --whatrequires python3-toml | wc -l
443

This is because many packages BuildRequire (python3dist(toml) if python3-devel < 3.11) due to Package-x-generic-16.pngpyproject-rpm-macros.

$ repoquery --repo=rawhide{,-source} --whatrequires '(python3dist(toml) if python3-devel < 3.11)' | wc -l
413

The change owners don't know how to easily filter them out, but when filtered the hard way, this remains:

(Results from 2022-10-05, may contain false positives.)

$ for pkg in $(repoquery --repo=rawhide{,-source} --whatrequires python3-toml); do repoquery -q --repo=rawhide{,-source} --requires $pkg | grep -Fv '(python3dist(toml) if python3-devel < 3.11)' | grep -Eq '(\(|-)toml\b' && echo $pkg; done
academic-admin-0:0.5.1-10.fc37.noarch
academic-admin-0:0.5.1-10.fc37.src
bandit-0:1.7.4-3.fc37.src
bst-external-0:0.29.0-1.fc38.src
cvc4-0:1.8-12.fc37.src
fedora-license-data-0:1.5-1.fc38.src
fedora-messaging-0:3.1.0-5.fc38.src
gi-docgen-0:2022.1-7.fc38.noarch
gi-docgen-0:2022.1-7.fc38.src
jrnl-0:3.0-3.fc37.src
micropipenv-0:1.4.2-1.fc37.noarch
pre-commit-0:2.20.0-2.fc37.noarch
pre-commit-0:2.20.0-2.fc37.src
pylint-0:2.14.4-3.fc37.src
python-anyconfig-0:0.13.0-3.fc37.src
python-anymarkup-0:0.8.1-10.fc37.src
python-anymarkup-core-0:0.8.1-9.fc37.src
python-ast-monitor-0:0.2.1-1.fc38.src
python-asttokens-0:2.0.8-1.fc38.src
python-autopep8-0:1.6.0-5.fc37.src
python-botocore-0:1.27.86-1.fc38.src
python-box-0:6.0.2-1.fc38.src
python-build-0:0.8.0-4.fc37.src
python-check-manifest-0:0.48-3.fc37.src
python-deepdiff-0:5.8.2-2.fc37.src
python-devicely-0:1.1.1-3.fc37.src
python-elpy-0:1.34.0-8.fc37.src
python-exoscale-0:0.7.1-4.fc37.src
python-fasjson-client-0:1.0.7-5.fc38.src
python-fireflyalgorithm-0:0.3.2-2.fc37.src
python-interrogate-0:1.5.0-4.fc37.src
python-jsonpickle-0:2.2.0-4.fc37.src
python-lsp-black-0:1.2.0-3.fc37.src
python-matrix-nio-0:0.19.0-6.fc38.src
python-molecule-podman-0:1.0.1-4.fc37.src
python-neurom-0:3.1.0-5.fc37.src
python-niaaml-0:1.1.11-1.fc38.src
python-niaarm-0:0.2.1-2.fc38.src
python-niaclass-0:0.1.2-8.fc37.src
python-nikola-0:8.2.2-4.fc37.src
python-pendulum-0:2.1.2-8.fc37.src
python-podman-3:4.2.0-7.fc38.src
python-pyedflib-0:0.1.30-2.fc37.src
python-pyqt-feedback-flow-0:0.1.6-3.fc37.src
python-rich-0:12.6.0-1.fc38.src
python-rst-linker-0:2.3.1-1.fc38.src
python-sklearn-nature-inspired-algorithms-0:0.9.0-3.fc37.src
python-sport-activities-features-0:0.3.6-1.fc38.src
python-stochastic-0:0.7.0-2.fc37.src
python-toml-adapt-0:0.2.7-3.fc37.src
python-usort-0:0.6.3-7.fc37.src
python-vulture-0:2.6-1.fc38.src
python3-anymarkup-0:0.8.1-10.fc37.noarch
python3-autopep8-0:1.6.0-5.fc37.noarch
python3-box-0:6.0.2-1.fc38.noarch
python3-exoscale-0:0.7.1-4.fc37.noarch
python3-fasjson-client-0:1.0.7-5.fc38.noarch
python3-fedora-messaging-0:3.1.0-5.fc38.noarch
python3-interrogate-0:1.5.0-4.fc37.noarch
python3-jaraco-functools-0:3.5.2-1.fc38.noarch
python3-jinja2-cli-0:0.8.2-3.fc37.noarch
python3-lsp-black-0:1.2.0-3.fc37.noarch
python3-nikola-0:8.2.2-4.fc37.noarch
python3-podman-3:4.2.0-7.fc38.noarch
python3-sklearn-nature-inspired-algorithms-0:0.9.0-3.fc37.noarch
python3-toml-adapt-0:0.2.7-3.fc37.noarch
python3-usort-0:0.6.3-7.fc37.noarch
python3-vulture-0:2.6-1.fc38.noarch
rpmlint-0:2.2.0-7.fc38.noarch
rpmlint-0:2.2.0-7.fc38.src
sip6-0:6.6.2-2.fc37.src
sip6-0:6.6.2-2.fc37.x86_64
teampulls-0:0.2.2-10.fc37.noarch
trac-tracnav-plugin-0:4.3-7.fc37.src

List of components still (Build)Requiring python3-toml

Once all dependencies are removed, we plan to retire Package-x-generic-16.pngpython-toml, whether it will be in Fedora 38 (unlikely) or later.

Migrating to tomllib

Important.png
Migrating to tomllib-only is only possible if the code will be run on Python 3.11 or newer. See the #Migrating_to_tomllib_on_Python_3.11+_and_falling_back_to_tomli section for a more portable solution.
  • Remove any toml requirements from upstream metadata.
  • Change all toml imports to tomllib imports.
  • Change all references of TomlDecodeError to TOMLDecodeError.
  • Open files in binary mode, if passing file objects to tomllib.load().

Migrating to tomli

Important.png
Migrating to tomli-only leaves an unnecessary dependency on a 3rd party library which is now essentially a backport of a standard library module. See the #Migrating_to_tomllib_on_Python_3.11+_and_falling_back_to_tomli section for a more sustainable solution.
  • Change any toml requirements in upstream metadata to tomli.
  • Change all toml imports to tomli imports.
  • Change all references of TomlDecodeError to TOMLDecodeError.
  • Open files in binary mode, if passing file objects to tomli.load().

Migrating to tomllib on Python 3.11+ and falling back to tomli

  • Change any toml requirements in upstream metadata to tomli;python_version<"3.11".
  • Change all toml imports to sys.version_info-conditional or try: except ImportError: tomli/tomllib imports.
  • Change all references of TomlDecodeError to TOMLDecodeError.
  • Open files in binary mode, if passing file objects to tomllib.load().

Example of importing:

try:
    import tomllib
except ImportError:
    import tomli as tomllib

Or:

if sys.version_info < (3, 11):
    import tomli as tomllib
else:
    import tomllib

Upstream examples: https://github.com/fedora-infra/fedora-messaging/pull/274 or https://github.com/pytest-dev/pytest/pull/9741

A more complex example that also falls back to toml on Python 2.7 or 3.6: https://github.com/tox-dev/tox/pull/2463

A more complex example that supports pytoml, toml, tomli and tomllib: https://github.com/thoth-station/micropipenv/pull/241

Migrating to tomli-w

  • Change any toml requirements in upstream metadata to tomli-w.
  • Change all toml imports to tomli_w imports.
  • Open files in binary mode, if passing file objects to tomli_w.dump().

A more complex example that migrates to tomli, tomllib and tomli-w: https://github.com/rpm-software-management/rpmlint/pull/905

Feedback

Benefit to Fedora

An upstream dead package will not be depended upon by new packages.

Scope

  • Proposal owners: Deprecate python3-toml. Work with packagers and upstream developers to remove the dependency. Monitor the remaining dependent packages and eventually retire Package-x-generic-16.pngpython-toml (unlikely in Fedora 38).
  • Other developers: No action needed. Don't add new dependencies on python3-toml.
  • Release engineering: N/A (not a System Wide Change)
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives:

Upgrade/compatibility impact

The package will remain available. Only new packages cannot depend on it. Once retired, we don't plan to provide python3-toml from python3-libs or python3-tomli, because it cannot work as a drop-in replacement (the Python module has a different name and slightly different API). The package will eventually be obsoleted by Package-x-generic-16.pngfedora-obsolete-packages once retired, but that is unlikely to happen soon.

How To Test

$ repoquery --repo=rawhide --provides python3-toml
...
deprecated()
...

User Experience

No changes.

Dependencies

N/A (not a System Wide Change)

Contingency Plan

  • Contingency mechanism: revert the deprecation
  • Contingency deadline: Final Freeze
  • Blocks release? No

Documentation

N/A (not a System Wide Change)

Release Notes