Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1950271 - pg_activity fails to build with Python 3.10: Expected: <DurationMode.query: 1> Got: DurationMode.query
Summary: pg_activity fails to build with Python 3.10: Expected: <DurationMode.query: 1...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pg_activity
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikel Olasagasti Uranga
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-04-16 09:35 UTC by Tomáš Hrnčiar
Modified: 2021-04-19 17:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-19 17:05:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-04-16 09:35:52 UTC
pg_activity fails to build with Python 3.10.0a7.

=================================== FAILURES ===================================
_________________ [doctest] pgactivity.handlers.duration_mode __________________
039 Return the updated duration mode matching input key.
040 
041     >>> from blessed.keyboard import Keystroke as k
042 
043     >>> duration_mode(k("42"), DurationMode.query)
Expected:
    <DurationMode.query: 1>
Got:
    DurationMode.query

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/handlers.py:43: DocTestFailure
___________________ [doctest] pgactivity.handlers.query_mode ___________________
070 Return the query mode matching input key or None.
071 
072     >>> import curses
073     >>> from blessed.keyboard import Keystroke as k
074 
075     >>> query_mode(k("42"))
076     >>> query_mode(k("1"))
Expected:
    <QueryMode.activities: 'running queries'>
Got:
    QueryMode.activities

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/handlers.py:76: DocTestFailure
__________________ [doctest] pgactivity.handlers.sort_key_for __________________
094     >>> from blessed.keyboard import Keystroke as k
095     >>> from pgactivity.types import QueryMode
096 
097     >>> flag = Flag.all()
098 
099     Unhandled key:
100     >>> sort_key_for(k("1"), QueryMode.activities, flag)
101 
102     In activities mode, 'm', 'w', 't', ... keys are handled:
103     >>> sort_key_for(k("m"), QueryMode.activities, flag)
Expected:
    <SortKey.mem: 2>
Got:
    SortKey.mem

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/handlers.py:103: DocTestFailure
__________________ [doctest] pgactivity.handlers.verbose_mode __________________
054 Return the updated query display mode (aka verbose mode) matching input
055     key.
056 
057     >>> from blessed.keyboard import Keystroke as k
058 
059     >>> verbose_mode(k("42"), QueryDisplayMode.truncate)
Expected:
    <QueryDisplayMode.truncate: 1>
Got:
    QueryDisplayMode.truncate

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/handlers.py:59: DocTestFailure
_____________________ [doctest] pgactivity.types.UI.column _____________________
543 Return the column matching 'key'.
544 
545         >>> ui = UI.make()
546         >>> ui.column("cpu")
Expected:
    Column(name='CPU%', template_h='%6s ', mandatory=False, sort_key=<SortKey.cpu: 1>)
Got:
    Column(name='CPU%', template_h='%6s ', mandatory=False, sort_key=SortKey.cpu)

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/types.py:546: DocTestFailure
_____________________ [doctest] pgactivity.types.enum_next _____________________
032 Return an increment value of given enum.
033 
034     >>> class Seasons(enum.IntEnum):
035     ...     winter = 1
036     ...     spring = 2
037     ...     summer = 3
038     ...     autumn = 4
039 
040     >>> enum_next(Seasons.winter)
Expected:
    <Seasons.spring: 2>
Got:
    Seasons.spring

/builddir/build/BUILD/pg_activity-2.1.4/pgactivity/types.py:40: DocTestFailure
=========================== short test summary info ============================
FAILED pgactivity/handlers.py::pgactivity.handlers.duration_mode
FAILED pgactivity/handlers.py::pgactivity.handlers.query_mode
FAILED pgactivity/handlers.py::pgactivity.handlers.sort_key_for
FAILED pgactivity/handlers.py::pgactivity.handlers.verbose_mode
FAILED pgactivity/types.py::pgactivity.types.UI.column
FAILED pgactivity/types.py::pgactivity.types.enum_next
================== 6 failed, 37 passed, 1 deselected in 0.33s ==================

There were some changes in enum in latest alpha of Python 3.10. This seems like it could be connected to that.
https://docs.python.org/3.10/whatsnew/changelog.html#python-3-10-0-alpha-7

bpo-40066: Enum: adjust repr() to show only enum and member name (not value, nor angle brackets) and str() to show only member name. Update and improve documentation to match.

bpo-40066: Enum’s repr() and str() have changed: repr() is now EnumClass.MemberName and str() is MemberName. Additionally, stdlib Enum’s whose contents are available as module attributes, such as RegexFlag.IGNORECASE, have their repr() as module.name, e.g. re.IGNORECASE.
https://bugs.python.org/issue40066

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

For all our attempts to build pg_activity with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.


Note You need to log in before you can comment on or make changes to this bug.