Red Hat Bugzilla – Bug 1314043
dnsyo: Switch to Python 3
Last modified: 2016-10-05 11:17:48 EDT
Upstream, this software supports Python 3. Please provide a Python 3
package for Fedora.
According to the Python packaging guidelines , 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 .
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!
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.
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.
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).
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'.
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!)
(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.
Hello Ricky, how is it going? Do you need some help?