Bug 1413527

Summary: trash-cli: Switch to Python 3
Product: [Fedora] Fedora Reporter: Iryna Shcherbina <ishcherb>
Component: trash-cliAssignee: Ankur Sinha (FranciscoD) <sanjay.ankur>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: jberan, sanjay.ankur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: trash-cli-0.17.1.14-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-09 18:52:46 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, 1312032    
Attachments:
Description Flags
Latest Python3 upstream version
none
Updated Python3 spec file none

Description Iryna Shcherbina 2017-01-16 09:40:48 UTC
Upstream, this software supports Python 3. Please provide a Python 3
package for Fedora.


According to the Python packaging guidelines [0], software must be
packaged for Python 3 if upstream supports it.
The guidelines give detailed information on how to do this, and even
provide an example spec file [1].

Since users aren't expected to import this tool from Python code,
you can just switch to /usr/bin/python3. Alternatively, if you want or
need to keep a Python 2 version, the current best practice is to provide
subpackages -- this is called "Common SRPM" in the guidelines.

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


If you need more instructions, a guide for porting Python-based RPMs is
available at [2].
If anything is unclear, or if you need any kind of assistance with the
porting, you can ask on IRC (#fedora-python on Freenode), or reply here.
We'll be happy to help!


[0] https://fedoraproject.org/wiki/Packaging:Python
[1] https://fedoraproject.org/wiki/Packaging:Python#Example_common_spec_file
[2] http://python-rpm-porting.readthedocs.io/

Comment 1 Fedora End Of Life 2017-02-28 10:59:42 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Jan Beran 2017-03-24 12:52:42 UTC
Created attachment 1266050 [details]
Latest Python3 upstream version

May I ask for a review of the updated spec file?

Comment 3 Jan Beran 2017-04-25 11:25:49 UTC
Hi Ankur,

may I kindly ask for your review of the attached spec file update?

Thank you.

Jan

Comment 4 Iryna Shcherbina 2017-04-25 11:38:27 UTC
Hello Jan,

I have looked through the patch. It looks good, but I have a few small comments:

* when building in mock, the build fails with 

> /var/tmp/rpm-tmp.tmnBws: line 31: nosetests: command not found

This can be fixed if you use `nosetests-%{python3_version}` in check section. However there are no tests to be run, so we should either get sources from GitHub or skip test for now and ask upstream to add tests to PyPI tarball.

* as it is not a Python module but a CLI tool, I think we can just switch it to Python 3 without changing the name of the package, or at least provide the old `trash-cli` name.

* I believe the build time dependency on dos2unix is no longer needed, the usage was removed long ago [0].

[0] https://src.fedoraproject.org/cgit/rpms/trash-cli.git/commit/trash-cli.spec?id=c3b966335acd556c94d96eca46a464d506cb45f4

Comment 5 Ankur Sinha (FranciscoD) 2017-04-27 21:14:50 UTC
Sorry - been busy. I'll only be able to get to this early next week. Monday hopefully. It's on my list of things to do. 

Again, sorry for the delay.

Cheers!

Comment 6 Ankur Sinha (FranciscoD) 2017-05-01 11:10:47 UTC
(In reply to Iryna Shcherbina from comment #4)
Hiya,

Just looked at the patch. Iryna's pointed out the issues already, though:


> 
> I have looked through the patch. It looks good, but I have a few small
> comments:
> 
> * when building in mock, the build fails with 
> 
> > /var/tmp/rpm-tmp.tmnBws: line 31: nosetests: command not found
> 
> This can be fixed if you use `nosetests-%{python3_version}` in check
> section. However there are no tests to be run, so we should either get
> sources from GitHub or skip test for now and ask upstream to add tests to
> PyPI tarball.

+1 to get rid of it. I'll file a ticket upstream asking for the tests to be included in the tar. I expect it'll be done with the new release, but I see no reason to delay the update here on that account.

> 
> * as it is not a Python module but a CLI tool, I think we can just switch it
> to Python 3 without changing the name of the package, or at least provide
> the old `trash-cli` name.

I think providing trash-cli should be sufficient.

> 
> * I believe the build time dependency on dos2unix is no longer needed, the
> usage was removed long ago [0].
> 
> [0]
> https://src.fedoraproject.org/cgit/rpms/trash-cli.git/commit/trash-cli.
> spec?id=c3b966335acd556c94d96eca46a464d506cb45f4

+1


Jan, if you'd like to co-maintain the package and apply this update yourself, please apply for permissions on pkgdb - otherwise I can apply the update on your behalf if you'd like.

Cheers!

Comment 7 Jan Beran 2017-05-02 07:19:31 UTC
Hi,

thanks to Iryna and Ankur for the review.

Ankur, may I ask you to update the spec?

Comment 8 Jan Beran 2017-05-05 15:00:38 UTC
Created attachment 1276619 [details]
Updated Python3 spec file

I have updated the spec file according to the review recommendation:
- just `trash-cli` name is kept
- dos2unix is omitted
- testing is omitted (could be added again when the test is available at PyPI)

Comment 9 Fedora Update System 2017-05-08 12:20:02 UTC
trash-cli-0.17.1.14-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7af0df2d2d

Comment 10 Ankur Sinha (FranciscoD) 2017-05-08 12:20:52 UTC
Thanks Jan and Iryna - built and update pushed for F26.

Comment 11 Fedora Update System 2017-05-09 02:38:40 UTC
trash-cli-0.17.1.14-1.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-7af0df2d2d

Comment 12 Fedora Update System 2017-06-09 18:52:46 UTC
trash-cli-0.17.1.14-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.