Bug 2283617

Summary: pg_activity fails to build with Python 3.13: UNEXPECTED EXCEPTION: DeprecationWarning('Plural value must be an integer, got float')
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: pg_activityAssignee: Mikel Olasagasti Uranga <mikel>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fti-bugs, ksurma, mhroncok, mikel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pg_activity-3.5.1-2.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-24 22:48:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836, 2260875, 2260877    

Description Karolina Surma 2024-05-28 08:21:10 UTC
pg_activity fails to build with Python 3.13.0b1.

___________________________ [doctest] test_views.txt ___________________________
118 ...     delete_per_second=30,
119 ...     tuples_returned_per_second=40,
120 ...     temporary_file=TempFileInfo(
121 ...        temp_files=5,
122 ...        temp_bytes=12054865,
123 ...     ),
124 ...     max_dbname_length=27,
125 ...     waiting=3,)
126 
127 >>> header(term, ui, host=host, server_information=serverinfo,
UNEXPECTED EXCEPTION: DeprecationWarning('Plural value must be an integer, got float')
Traceback (most recent call last):
  File "/usr/lib64/python3.13/doctest.py", line 1395, in __run
    exec(compile(example.source, filename, "single",
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 compileflags, True), test.globs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<doctest test_views.txt[18]>", line 1, in <module>
  File "/builddir/build/BUILDROOT/pg_activity-3.5.1-1.fc41.x86_64/usr/lib/python3.13/site-packages/pgactivity/views.py", line 116, in wrapper
    for line in func(term, *args, **kwargs):
    ...<2 lines>...
            break
  File "/builddir/build/BUILDROOT/pg_activity-3.5.1-1.fc41.x86_64/usr/lib/python3.13/site-packages/pgactivity/views.py", line 233, in header
    uptime = utils.naturaltimedelta(si.uptime)
  File "/usr/lib/python3.13/site-packages/humanize/time.py", line 604, in precisedelta
    fmt_txt = _ngettext(singular_txt, plural_txt, value)
  File "/usr/lib/python3.13/site-packages/humanize/i18n.py", line 163, in _ngettext
    return get_translation().ngettext(message, plural, num)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/gettext.py", line 298, in ngettext
    n = _as_int2(n)
  File "/usr/lib64/python3.13/gettext.py", line 188, in _as_int2
    warnings.warn('Plural value must be an integer, got %s' %
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  (n.__class__.__name__,),
                  ^^^^^^^^^^^^^^^^^^^^^^^^
                  DeprecationWarning,
                  ^^^^^^^^^^^^^^^^^^^
                  stacklevel)
                  ^^^^^^^^^^^
DeprecationWarning: Plural value must be an integer, got float
/builddir/build/BUILD/pg_activity-3.5.1/tests/test_views.txt:127: UnexpectedException

FAILED tests/test_ui.txt::test_ui.txt
FAILED tests/test_views.txt::test_views.txt

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07497626-pg_activity/

For all our attempts to build pg_activity with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/pg_activity/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Karolina Surma 2024-06-12 14:57:09 UTC
*** Bug 2291578 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2024-06-19 19:59:56 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 3 Mikel Olasagasti Uranga 2024-06-19 20:22:41 UTC
Waiting on https://src.fedoraproject.org/rpms/python-humanize/pull-request/8

Comment 4 Miro HronĨok 2024-06-24 13:43:02 UTC
Building pg_activity-3.5.1-2.fc41 for rawhide
Created task: 119511065
Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=119511065

Comment 5 Fedora Fails To Install 2024-06-24 22:48:20 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 41.

Thanks for taking care of it!