Bug 1314524 - python2-grafyaml requires both python2 and python3 [NEEDINFO]
python2-grafyaml requires both python2 and python3
Status: NEW
Product: Fedora
Classification: Fedora
Component: python-grafyaml (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Paul Belanger
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: PYTHON3
  Show dependency treegraph
Reported: 2016-03-03 15:15 EST by William Moreno
Modified: 2018-01-31 00:17 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-13 10:20:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
dkrejci: needinfo? (pabelanger)
jberan: needinfo? (pabelanger)

Attachments (Terms of Use)

  None (edit)
Description William Moreno 2016-03-03 15:15:36 EST
There is a issue with the spec:

# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default.
%if 0%{?with_python3}

The in files you include in both packages:


This mean than you are including in the python2 package a executable than requires the python2 version of the package.

Please update the spec to something like:

mv %builroot/%{_bindir}/grafana-dashboard %builroot/%{_bindir}/grafana-dashboard-py2

and the include it in the python2 package files
Comment 1 Petr Viktorin 2016-03-04 04:54:36 EST
Actually, the guidelines specify how the scripts should be named, so that users can use a sane "default" but also explicitly request a specific version:

There are two cases:
1) If the script works the same under both python2 and python3, only the python3 scripts can be packaged

2) Otherwise, there should be /usr/bin/script, /usr/bin/script-2, /usr/bin/script-2.7 for Python 2, and /usr/bin/script-3, /usr/bin/script-3.5 for Python 3.
You could do that with something like this:

mv %{buildroot}/%{_bindir}/grafana-dashboard %{buildroot}/%{_bindir}/grafana-dashboard-3 
ln -s %{buildroot}/%{_bindir}/grafana-dashboard-3 %{buildroot}/%{_bindir}/grafana-dashboard-%{python3_version}

ln -s %{buildroot}/%{_bindir}/grafana-dashboard %{buildroot}/%{_bindir}/grafana-dashboard-%2
ln -s %{buildroot}/%{_bindir}/grafana-dashboard %{buildroot}/%{_bindir}/grafana-dashboard-%{python2_version}
Comment 2 Paul Belanger 2016-03-08 14:31:23 EST
Thanks for the info, so number 1 should be the case. grafana-dashboard will work for both python2 and python3.  So, If I am reading both comments, I don't think I need to make any changes?  Since python3 installs after python2?

Otherwise, I don't have an issue setting up the symlinking above for #2. I was hoping you might has an example package I could look into as I still have some questions and looking at the code always helps.
Comment 3 Petr Viktorin 2016-03-09 04:23:30 EST
Right, looks like #1 is right for you.
You should just remove %{_bindir}/grafana-dashboard from the python2 package, since it's the python3 version (and it's already in the python3 package).
Comment 4 Dominika Krejčí 2016-05-13 07:43:56 EDT
Hello Paul,

do you need any help adding Python 3 support to the RPM?

If you need more instructions, a [guide] for porting Python-based RPMs is available.

[guide] http://python-rpm-porting.readthedocs.io/
Comment 5 Paul Belanger 2016-05-13 10:20:03 EDT
Sorry for the delay, I thought I fixed this already.  Apparently not, I'll work on it next week.
Comment 6 Paul Belanger 2016-05-13 10:38:21 EDT
Sigh, I will learn to use bugzilla one of these days.  Thanks for fixing, I was trying to set the status to assigned.
Comment 7 Dominika Krejčí 2016-09-23 03:55:06 EDT
Hi Paul,
could you please do the change suggested in the Comment #3? python2-grafyaml still depends on both 2 and 3.
Comment 8 Fedora End Of Life 2017-07-25 16:17:13 EDT
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 9 Jan Kurik 2017-08-15 04:24:26 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.
Comment 10 Jan Beran 2017-09-01 09:34:55 EDT
Hello Paul,

I created a Pagure PR that fixes "python2-grafyaml requires both python2 and python3" according to the Comment #3:


May I ask you to review and rebuild?



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