Bug 1323256

Summary: Use python3 for /usr/bin/pygmentize
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-pygmentsAssignee: Steve Milner <smilner>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: ishcherb, smilner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pygments-2.2.0-7.fc25 python-pygments-2.2.0-7.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-30 01:20:40 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: 1285816    

Description Miro Hrončok 2016-04-01 15:59:24 UTC
Description of problem:
/usr/bin/pygmentize uses python2 while it should work with the default version of Python, python3

Version-Release number of selected component (if applicable):
python-pygments-0:2.1.3-1.fc24
python-pygments-0:2.1.3-1.fc25

How reproducible:
Always.

Steps to Reproduce:
1. dnf install /usr/bin/pygmentize

Actual results:
python-pygments is installed

Expected results:
python3-pygments is installed

Comment 1 Fedora Update System 2017-03-02 22:23:22 UTC
python-pygments-2.2.0-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ab70d1df45

Comment 2 Miro Hrončok 2017-03-03 00:48:25 UTC
What is the purpose of %{_bindir}/pygmentize2 and %{_bindir}/pygmentize3?

Comment 3 Miro Hrončok 2017-03-03 00:54:10 UTC
To quote from the guidelines [0]:

"If the executables provide the same functionality independent of whether they are run on top of Python 2 or Python 3, then only the Python 3 version of the executable should be packaged. Transitioning from python2 to python3 is left to individual package maintainers except for packages in Fedora's critical path. For these, we want to port to python3 versions in the same Fedora release if possible.

Examples of this:

/usr/bin/pygmentize ought to generate the same output regardless of whether it's implemented via Python 2 or Python 3, so only one version needs to be shipped."

So the actual fix here is to change it to python3 only or keep it python2 only (if there's a good reason for that).

[0] https://fedoraproject.org/wiki/Packaging:Python#Avoiding_collisions_between_the_python_2_and_python_3_stacks

Comment 4 Steve Milner 2017-03-03 00:56:15 UTC
Miro,

Good point. It was done to avoid the collision but I'll update the package.

Comment 5 Miro Hrončok 2017-03-03 01:06:27 UTC
Also, if you intend to switch for python3 as I originally suggested in #c0, I'd avoid doing it in a stable release and would only do it in rawhide and F26.

Comment 6 Fedora Update System 2017-03-03 04:54:24 UTC
python-pygments-2.2.0-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ab70d1df45

Comment 7 Iryna Shcherbina 2017-03-06 10:35:58 UTC
The python3-pygments RPM requires both Python 2 and Python 3.

$ dnf --disablerepo=* --enablerepo=rawhide repoquery --requires python3-pygments
/usr/bin/python
python(abi) = 3.5
...

Except in very special circumstances, there is no need for one package
to drag in both Python stacks. Usually, this is a packaging error: currently an executable built with Python 2 is included in a python3 subpackage.

If you intend the executable to be Python 2 only, it should be included in Python 2 subpackage. If you intend to switch for Python 3, as originally suggested and strongly encouraged, then make sure you install an executable built with Python 3.

It's ok to do this in Rawhide only, however, it would be greatly
appreciated if you could push it to Fedora 26 as well.


If anything is unclear, or if you need any kind of assistance, you can
ask on IRC (#fedora-python on Freenode), or reply here. We'll be happy
to help investigating or fixing this issue!

Comment 8 Steve Milner 2017-03-06 14:35:10 UTC
Thanks for the report. I'm going to update the package and make the binary Python3 only per the Fedora Guidelines. I went ahead and unpushed 2.2.0-1 in the meantime.

Comment 9 Steve Milner 2017-03-06 20:01:20 UTC
python3-pygments should no longer /usr/bin/python starting 2.2.0-4 (F26 and master)

$ rpm -qpR python3-pygments-2.2.0-4.fc27.noarch.rpm
/usr/bin/python3
python(abi) = 3.5
python3-setuptools
<snip>

Comment 10 Fedora Update System 2017-03-23 19:39:26 UTC
python-pygments-2.2.0-7.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3ceb94d98d

Comment 11 Fedora Update System 2017-03-23 19:39:47 UTC
python-pygments-2.2.0-7.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f70a3c4cc7

Comment 12 Fedora Update System 2017-03-24 14:52:50 UTC
python-pygments-2.2.0-7.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f70a3c4cc7

Comment 13 Fedora Update System 2017-03-24 20:24:04 UTC
python-pygments-2.2.0-7.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3ceb94d98d

Comment 14 Fedora Update System 2017-03-30 01:20:40 UTC
python-pygments-2.2.0-7.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2017-04-01 17:30:19 UTC
python-pygments-2.2.0-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.