Bug 1187837 - pyserial ships file with python3 shebang and drags python3 as a dependency
Summary: pyserial ships file with python3 shebang and drags python3 as a dependency
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pyserial
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul P Komkoff Jr
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1180653 (view as bug list)
Depends On:
Blocks: PYTHON3
TreeView+ depends on / blocked
 
Reported: 2015-01-30 23:32 UTC by Miro Hrončok
Modified: 2016-12-20 13:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 13:11:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Ship one version of miniterm.py, not two. (2.34 KB, patch)
2015-11-10 14:44 UTC, Toshio Ernie Kuratomi
no flags Details | Diff

Description Miro Hrončok 2015-01-30 23:32:45 UTC
There is a file in pyserial package that has a python3 shebang line and thus producing a bogus python3 dependency.

$ rpm -q --requires pyserial
/usr/bin/python3               <--- see here
python(abi) = 2.7

$ rpm -qf /usr/bin/miniterm.py
pyserial-2.6-9.fc21.noarch

$ head -1 /usr/bin/miniterm.py 
#!/usr/bin/python3

This might affect other versions of Fedora as well, I know it affects 21 and 22.


The following comes form specfile:

    %install
    rm -rf $RPM_BUILD_ROOT
    pushd %{py3dir}
    %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
    popd
    %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

I would think the second setup.py call (the Python 2 one) would override the python 3 script, but it does not. Reverse order of things doesn't help, the python3 script seems to win in both cases.

One possible solution is to rm the file in between the install rutines, right before the popd call. Other one is to reassign the file to python3 subpackage.

Comment 1 Michal Cyprian 2015-11-02 14:18:00 UTC
I've added python3 subpackage to spec. Each version have it's own miniterm.py script now. I hope my solution is satisfying, you can see a diff here:

https://mcyprian.fedorapeople.org/pyserial.spec_diff

Comment 2 Fedora End Of Life 2015-11-04 09:57:03 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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 3 Michal Cyprian 2015-11-05 13:22:11 UTC
I've made a mistake in changelog, here is corrected diff:

https://mcyprian.fedorapeople.org/pyserial.spec_diff

Comment 4 Paul P Komkoff Jr 2015-11-06 17:29:13 UTC
I just applied your fix to master and will apply it shortly to 22 23

Comment 5 Toshio Ernie Kuratomi 2015-11-10 14:26:52 UTC
*** Bug 1180653 has been marked as a duplicate of this bug. ***

Comment 6 Toshio Ernie Kuratomi 2015-11-10 14:43:36 UTC
I took a look at the fix and I'm not sure is is really correct (it's better than what we have now but I think it still doesn't follow guidelines).  There doesn't seem to be any difference to the user between miniterm.py using python2 and miniterm.py for python3.  So we should just be shipping miniterm.py in the python3-pyserial package with a python3 shebang line.  We should not be shipping it in the python2 package: https://fedoraproject.org/wiki/Packaging:Python#Avoiding_collisions_between_the_python_2_and_python_3_stacks

Typically separate python2 and python3 versions of an executable are only needed if the executable is importing python code in some way (Examples: many python test suites work by importing and running the python code they're testing.  The provided wrappers for starting most python web frameworks import the user's code and run that in the same python process as the startup wrapper.)

I'll attach a patch to package this with just a single miniterm.py.  If I'm incorrect about how miniterm.py works, feel free to disregard it and go ahead with mcyprian's patch.

Comment 7 Toshio Ernie Kuratomi 2015-11-10 14:44:21 UTC
Created attachment 1092288 [details]
Ship one version of miniterm.py, not two.

Comment 8 Fedora End Of Life 2016-07-19 12:44:56 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Miro Hrončok 2016-07-19 13:06:24 UTC
Still valid.

Comment 10 Fedora End Of Life 2016-11-24 11:24:35 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 11 Fedora End Of Life 2016-12-20 13:11:35 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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