Bug 1314043 - dnsyo: Switch to Python 3 [NEEDINFO]
dnsyo: Switch to Python 3
Status: NEW
Product: Fedora
Classification: Fedora
Component: dnsyo (Show other bugs)
25
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ricky Elrod
Fedora Extras Quality Assurance
:
Depends On:
Blocks: PYTHON3
  Show dependency treegraph
 
Reported: 2016-03-02 14:22 EST by Tomas Orsava
Modified: 2016-10-05 11:17 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
dkrejci: needinfo? (relrod)
dkrejci: needinfo? (relrod)


Attachments (Terms of Use)
pure python3 spec patch (2.82 KB, patch)
2016-08-17 00:23 EDT, J. Randall Owens
no flags Details | Diff

  None (edit)
Description Tomas Orsava 2016-03-02 14:22:11 EST
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 24 as well.


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
Comment 1 Dominika Krejčí 2016-04-22 10:57:43 EDT
Hello Ricky,

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.org/en/latest/index.html
Comment 2 Jan Kurik 2016-07-26 00:58:27 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.
Comment 3 J. Randall Owens 2016-08-17 00:23 EDT
Created attachment 1191466 [details]
pure python3 spec patch

The new koji build 2.0.7-1.fc26 Requires all the python2 and python3 stuff to install, and includes both dnsyo (for python2) and python3-dnsyo. Is this what we want? I'd think we'd want either just python3 in this one, or separate python2 & python3 subpackages, from vague impressions I've gotten of the packages I've installed and updated. But python certainly isn't my thing, much less the multiversioning of it, so I could be very wrong. If you do want just the python3, though, here's a spec patch for that (not that it isn't obvious & simple, if this were one's goal).
Comment 4 J. Randall Owens 2016-08-17 00:43:35 EDT
After a quick scan of https://fedoraproject.org/wiki/Packaging:Python , it looks like the following apply to building python packages:

"Must: If you build for more than one python runtime you must use the %python_provide macro.
"Must: If you build for a single python runtime you must add %python_provide python-$module so that the current default python is provided from the unversioned python package."

And the %python_provide is what give you the python2-foo & python3-foo provides for the subpackages. I think the page just kind of assumes that it's obvious you have to provide subpackages, to the point that they don't even come right out and say so. Or maybe I'm reading too much into it.

Anyway, it looks as though yes, it should either be python3-only 'dnsyo', or build two subpackages, 'python2-dnsyo' & 'python3-dnsyo'.
Comment 5 Petr Viktorin 2016-08-17 07:33:15 EDT
Hello,
The general idea is:
- If the package has a Python library that people can import from their code, it's better to include both the Python2 and the Python3 version. That way people aren't forced to switch to py3 immediately, but have some transition period.
- If the package is just used for the script in /usr/bin, you can just switch it to py3 entirely.

The Reviewer checklist in the guidelines is targetting libraries (without saying so – that's a bug in the guidelines – sorry!)
Comment 6 Ricky Elrod 2016-08-17 16:55:56 EDT
(In reply to Petr Viktorin from comment #5)
> - If the package is just used for the script in /usr/bin, you can just
> switch it to py3 entirely.

I suppose I can do that, but then I have to maintain two separate specfiles for the epel vs fedora branches, right? So it might be easier to just keep both in the specfile for now so it can keep being shared/merged cleanly between the branches.

I'll take a closer look at this later tonight.
Comment 7 Dominika Krejčí 2016-10-05 11:17:48 EDT
Hello Ricky, how is it going? Do you need some help?

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