From Fedora Project Wiki
(Initial draft)
 
(use comma separated list for owners like most multi-owner changes)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{admon/important | 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.<br/> '''Copy the source to a ''new page'' before making changes!  DO NOT EDIT THIS TEMPLATE FOR YOUR CHANGE PROPOSAL.'''}}
= Remove Python Mock Usage =


{{admon/tip | Guidance | For details on how to fill out this form, see the [https://docs.fedoraproject.org/en-US/program_management/changes_guide/ documentation].}}


{{admon/tip | Report issues | To report an issue with this template, file an issue in the [https://pagure.io/fedora-pgm/pgm_docs pgm_docs repo].}}
<!-- The actual name of your proposed change page should look something like: Changes/Your_Change_Proposal_Name.  This keeps all change proposals in the same namespace -->
= Remove Python Mock Usage <!-- The name of your change proposal --> =
{{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?". -->
`python-mock` has been [[Changes/DeprecatePythonMock|deprecated since Fedora 34]] - 6 releases ago, but is still in use in many packages. We plan to go through the remaining usages and clean them up, with the goal of retiring `python-mock` from Fedora.
`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 ==
== Owner ==
<!--
* Name: [[User:Salimma|Michel Lind]], [[ User:Gotmax23|Maxwell G]]
For change proposals to qualify as self-contained, owners of all affected packages need to be included here. Alternatively, a SIG can be listed as an owner if it owns all affected packages.
* Email: michel @ michel-slm.name, maxwell @ gtmx.me
This should link to your home wiki page so we know who you are.
 
-->
* Name: [[User:Salimma|Michel Lind]]
<!-- Include you email address that you can be reached should people want to contact you about helping with your change, status is requested, or technical issues need to be resolved. If the change proposal is owned by a SIG, please also add a primary contact person. -->
* Email: michel @ michel-slm.name
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
* FESCo shepherd: [[User:FASAccountName| Shehperd name]] <email address>
* FESCo shepherd: [[User:FASAccountName| Shepherd name]] <email address>
-->
-->


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
[[Category:ChangeAcceptedF41]]
<!-- 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 35: Line 21:
<!-- After review, the Wrangler will move your page to Category:ChangeReadyForFesco... if it still needs more work it will move back to Category:ChangePageIncomplete-->
<!-- After review, the Wrangler will move your page to Category:ChangeReadyForFesco... if it still needs more work it will move back to Category:ChangePageIncomplete-->


<!-- Select proper category, default is Self Contained Change -->
<!-- [[Category:SelfContainedChange]] -->
[[Category:SystemWideChange]]
[[Category:SystemWideChange]]


* Targeted release: [https://docs.fedoraproject.org/en-US/releases/f40/ Fedora Linux 40]
* Targeted release: [https://docs.fedoraproject.org/en-US/releases/f41/ Fedora Linux 41]
* Last updated: <!-- this is an automatic macro — you don't need to change this line -->  {{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}  
* Last updated: <!-- this is an automatic macro — you don't need to change this line -->  {{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}  
<!-- After the change proposal is accepted by FESCo, tracking bug is created in Bugzilla and linked to this page  
<!-- After the change proposal is accepted by FESCo, tracking bug is created in Bugzilla and linked to this page  
Line 47: Line 31:
ON_QA -> change is fully code complete
ON_QA -> change is fully code complete
-->
-->
* [<will be assigned by the Wrangler> devel thread]
* [https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/75XB7Y7WN55RFGQ5WMZAEBXP7FZXSGMA/ Announced]
* FESCo issue: <will be assigned by the Wrangler>
* [https://discussion.fedoraproject.org/t/f40-change-proposal-remove-python-mock-useage-system-wide/100082 Discussion thread]
* Tracker bug: <will be assigned by the Wrangler>
* FESCo issue: [https://pagure.io/fesco/issue/3140 #3140]
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=2258085 #2258085]
* Release notes tracker: <will be assigned by the Wrangler>
* Release notes tracker: <will be assigned by the Wrangler>


== Detailed Description ==
== Detailed Description ==
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->
`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 -b rawhide -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 -b rawhide -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 -b rawhide -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>


Line 71: Line 74:


== Benefit to Fedora ==
== Benefit to Fedora ==
<!-- What is the benefit to the distribution?  Will the software we generate be improved? How will the process of creating Fedora releases be improved?
 
      Be sure to include the following areas if relevant:
      If this is a major capability update, what has changed?
          For example: This change introduces Python 5 that runs without the Global Interpreter Lock and is fully multithreaded.
      If this is a new functionality, what capabilities does it bring?
          For example: This change allows package upgrades to be performed automatically and rolled-back at will.
      Does this improve some specific package or set of packages?
          For example: This change modifies a package to use a different language stack that reduces install size by removing dependencies.
      Does this improve specific Spins or Editions?
          For example: This change modifies the default install of Fedora Workstation to be more in line with the base install of Fedora Server.
      Does this make the distribution more efficient?
          For example: This change replaces thousands of individual %post scriptlets in packages with one script that runs at the end.
      Is this an improvement to maintainer processes?
          For example: Gating Fedora packages on automatic QA tests will make rawhide more stable and allow changes to be implemented more smoothly.
      Is this an improvement targeted as specific contributors?
          For example: Ensuring that a minimal set of tools required for contribution to Fedora are installed by default eases the onboarding of new contributors.
    When a Change has multiple benefits, it's better to list them all.
    Consider these Change pages from previous editions as inspiration:
    https://fedoraproject.org/wiki/Changes/Annobin (low-level and technical, invisible to users)
    https://fedoraproject.org/wiki/Changes/ParallelInstallableDebuginfo (low-level, but visible to advanced users)
    https://fedoraproject.org/wiki/Changes/VirtualBox_Guest_Integration (primarily a UX change)
    https://fedoraproject.org/wiki/Changes/NoMoreAlpha (an improvement to distro processes)
    https://fedoraproject.org/wiki/Changes/perl5.26 (major upgrade to a popular software stack, visible to users of that stack)
-->
Eventually, we might be able to no longer maintain a standard library backport in a separate package.  
Eventually, we might be able to no longer maintain a standard library backport in a separate package.  


Line 104: Line 80:
== Scope ==
== Scope ==
* Proposal owners:
* Proposal owners:
<!-- 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?-->
** Set up a COPR with a stub package providing `python3-mock` and rebuild all packages that list python3-mock as a BR. The ones that successfully build don't actually need it
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.
** 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.
** Set up a second COPR to rebuild packages with the PRs applied to remove `python3-mock`. This will allow us to track progress in one place


* Other developers:
* Other developers:
<!-- 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?-->
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).
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)
* Release engineering: N/A (not needed for this Change)


* Policies and guidelines: N/A (not needed for this Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Policies and guidelines: N/A (not needed for this Change)
<!-- Do the packaging guidelines or other documents need to be updated for this feature?  If so, does it need to happen before or after the implementation is done?  If a FPC ticket exists, add a link here. Please submit a pull request with the proposed changes before submitting your Change proposal. -->


* Trademark approval: N/A (not needed for this Change)
* Trademark approval: N/A (not needed for this Change)
<!-- If your Change may require trademark approval (for example, if it is a new Spin), file a ticket ( https://pagure.io/Fedora-Council/tickets/issues ) requesting trademark approval from the Fedora Council. This approval will be done via the Council's consensus-based process. -->


* Alignment with Community Initiatives:  
* Alignment with Community Initiatives:  
<!-- Does your proposal align with the current Fedora Community Initiatives: https://docs.fedoraproject.org/en-US/project/initiatives/ ? It's okay if it doesn't, but it's something to consider -->
Not specifically, but this is in line with Fedora's "First" Foundation


== 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? -->
N/A
N/A
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 




== How To Test ==
== How To Test ==
<!-- This does not need to be a full-fledged document. Describe the dimensions of tests that this change implementation is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.
Package owners who receive a PR should be able to verify that the CI passes on the PR, and alternatively they can check the provided COPRs
 
Remember that you are writing this how to for interested testers to use to check out your change implementation - documenting what you do for testing is OK, but it's much better to document what *I* can do to test your change.
 
A good "how to test" should answer these four questions:
 
0. What special hardware / data / etc. is needed (if any)?
1. How do I prepare my system to test this change? What packages
need to be installed, config files edited, etc.?
2. What specific actions do I perform to check that the change is
working like it's supposed to?
3. What are the expected results of those actions?
-->
 
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 


== User Experience ==
== User Experience ==
<!-- If this change proposal is noticeable by users, how will their experiences change as a result?
This section partially overlaps with the Benefit to Fedora section above. This section should be primarily about the User Experience, written in a way that does not assume deep technical knowledge. More detailed technical description should be left for the Benefit to Fedora section.
Describe what Users will see or notice, for example:
  - Packages are compressed more efficiently, making downloads and upgrades faster by 10%.
  - Kerberos tickets can be renewed automatically. Users will now have to authenticate less and become more productive. Credential management improvements mean a user can start their work day with a single sign on and not have to pause for reauthentication during their entire day.
- Libreoffice is one of the most commonly installed applications on Fedora and it is now available by default to help users "hit the ground running".
- 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
No changes


== Dependencies ==
== Dependencies ==
<!-- What other packages (RPMs) depend on this package?  Are there changes outside the developers' control on which completion of this change depends?  In other words, completion of another change owned by someone else and might cause you to not be able to finish on time or that you would need to coordinate?  Other upstream projects like the kernel (if this is not a kernel change)? -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
N/A
N/A


Line 173: Line 118:


== Documentation ==
== Documentation ==
<!-- Is there upstream documentation on this change, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
The previous [[Changes/DeprecatePythonMock#How_to_migrate_to_unittest.mock|howto]] on migrating to unittest.mock still applies.


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
Upstream [https://docs.python.org/3/library/unittest.mock.html unittest.mock documentation]
N/A (not a System Wide Change)


== Release Notes ==
== Release Notes ==

Latest revision as of 23:52, 14 May 2024

Remove Python Mock Usage

Summary

python-mock has been deprecated since Fedora 34 - 6 releases ago, but is still in use in many packages. We plan to go through the remaining usages and clean them up, with the goal of retiring python-mock from Fedora.

Owner


Current status

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 -b rawhide -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 -b rawhide -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 -b rawhide -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:
    • Set up a COPR with a stub package providing python3-mock and rebuild all packages that list python3-mock as a BR. The ones that successfully build don't actually need it
    • 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.
    • Set up a second COPR to rebuild packages with the PRs applied to remove python3-mock. This will allow us to track progress in one place
  • 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:

Not specifically, but this is in line with Fedora's "First" Foundation

Upgrade/compatibility impact

N/A


How To Test

Package owners who receive a PR should be able to verify that the CI passes on the PR, and alternatively they can check the provided COPRs

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

The previous howto on migrating to unittest.mock still applies.

Upstream unittest.mock documentation

Release Notes