Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1323256 - Use python3 for /usr/bin/pygmentize
Use python3 for /usr/bin/pygmentize
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: python-pygments (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Steve Milner
Fedora Extras Quality Assurance
:
Depends On:
Blocks: PYTHON3
  Show dependency treegraph
 
Reported: 2016-04-01 11:59 EDT by Miro Hrončok
Modified: 2017-04-01 13:30 EDT (History)
2 users (show)

See Also:
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-29 21:20:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Miro Hrončok 2016-04-01 11:59:24 EDT
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 17:23:22 EST
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-02 19:48:25 EST
What is the purpose of %{_bindir}/pygmentize2 and %{_bindir}/pygmentize3?
Comment 3 Miro Hrončok 2017-03-02 19:54:10 EST
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-02 19:56:15 EST
Miro,

Good point. It was done to avoid the collision but I'll update the package.
Comment 5 Miro Hrončok 2017-03-02 20:06:27 EST
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-02 23:54:24 EST
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 05:35:58 EST
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 09:35:10 EST
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 15:01:20 EST
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 15:39:26 EDT
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 15:39:47 EDT
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 10:52:50 EDT
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 16:24:04 EDT
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-29 21:20:40 EDT
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 13:30:19 EDT
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.

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