From Fedora Project Wiki
(→‎Owner: split out owners, remove unnecessary comments)
(→‎Detailed Description: update queries to use both fedrq and repoquery, and split BuildRequires count from Requires count)
Line 54: Line 54:
`python-mock` has been marked as deprecated since Fedora 34, but many packages are still using it
`python-mock` has been marked as deprecated since Fedora 34, but many packages are still using it


Binary packages from 16 source packages require `python3-mock`
  <nowiki>
  <nowiki>
  $ rpmdistro-repoquery fedora rawhide --disablerepo=\* --enablerepo=fedora-source --whatrequires python3-mock | wc -l
  $ fedrq whatrequires python3-mock -F source --notsrc | wc -l
  78
16
  $ rpmdistro-repoquery fedora rawhide --enablerepo=fedora-source --whatrequires python3-mock | wc -l
$ repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep -v src$ | wc -l
  140
16
$ repoquery -q --repo=rawhide --whatrequires python3-mock --source | wc -l
16
</nowiki>
 
124 source packages require `python3-mock`
<nowiki>
$ fedrq whatrequires python3-mock -F source --src | wc -l
124
$ repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep src$ | wc -l
  124
</nowiki>
 
For a combined 134 packages
<nowiki>
  $ fedrq whatrequires python3-mock -F source | wc -l
134
$ (repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep src$; repoquery -q --repo=rawhide --whatrequires python3-mock --source) | pkgname | sort | uniq | wc -l
  134
  </nowiki>
  </nowiki>



Revision as of 16:46, 19 December 2023

Important.png
Comments and Explanations
The page source contains comments providing guidance to fill out each section. They are invisible when viewing this page. To read it, choose the "view source" link.
Copy the source to a new page before making changes! DO NOT EDIT THIS TEMPLATE FOR YOUR CHANGE PROPOSAL.
Idea.png
Guidance
For details on how to fill out this form, see the documentation.
Idea.png
Report issues
To report an issue with this template, file an issue in the pgm_docs repo.


Remove Python Mock Usage

Important.png
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

python-mock has been [deprecated since Fedora 34](https://fedoraproject.org/wiki/Changes/DeprecatePythonMock) - 6 releases ago, but is still in use in many packages. We plan to go through the remaining usages and clean them up, and retire python-mock if we get to zero.

Owner

  • Name: Michel Lind
  • Email: michel @ michel-slm.name; maxwell@gtmx.me


Current status

  • Targeted release: Fedora Linux 40
  • Last updated: 2023-12-19
  • [<will be assigned by the Wrangler> devel thread]
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

python-mock has been marked as deprecated since Fedora 34, but many packages are still using it

Binary packages from 16 source packages require python3-mock

 $ fedrq whatrequires python3-mock -F source --notsrc | wc -l
 16
 $ repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep -v src$ | wc -l
 16
 $ repoquery -q --repo=rawhide --whatrequires python3-mock --source | wc -l
 16
 

124 source packages require python3-mock

 $ fedrq whatrequires python3-mock -F source --src | wc -l
 124
 $ repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep src$ | wc -l
 124
 

For a combined 134 packages

 $ fedrq whatrequires python3-mock -F source | wc -l
 134
 $ (repoquery -q --repo=rawhide{,-source} --whatrequires python3-mock | grep src$; repoquery -q --repo=rawhide --whatrequires python3-mock --source) | pkgname | sort | uniq | wc -l
 134
 

Some of these are false positives - packages not using dynamic build requirements might still be marked as requiring python-mock after upstream no longer does so. The rest should be easily portable as described in the previous proposal.

Some packages could be dead upstream and not used by anything else in Fedora, in which case we can consider removing them.

Feedback

Benefit to Fedora

Eventually, we might be able to no longer maintain a standard library backport in a separate package.

This will also make branching packages for EPEL easier - there have been several instances where the Fedora package needs to be modified to not use python-mock because of a policy decision to not bring python-mock into newer EPEL releases (where the default Python already contains unittest.mock).

Scope

  • Proposal owners:

Put up PRs for the affected packages. In case the changes are minimal and no response is heard from the package maintainers the PRs will be merged after a sufficient time.

  • Other developers:

Package maintainers should review and merge any PRs filed against their packages, and if necessary forward the patches upstream (e.g. by filing upstream PRs).

  • Release engineering: N/A (not needed for this Change)
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Community Initiatives:

Upgrade/compatibility impact

N/A


How To Test

User Experience

No changes

Dependencies

N/A

Contingency Plan

  • Contingency mechanism: defer retiring python-mock for another cycle
  • Contingency deadline: Final Freeze
  • Blocks release? No


Documentation

N/A (not a System Wide Change)

Release Notes