#672 Python guidelines: change example spec to match guidelines
Closed: Fixed None Opened 7 years ago by toshio.

ignatenkobrain and I discovered that the packaging guidelines have conflicting information on whether an unversioned command (where both the python2 and python3 version of the commands is packaged) should use Python3 or Python2. In the guidelines themselves it says python2:

{{{
The unversioned executable must be the python2 version.
https://fedoraproject.org/wiki/Packaging:Python#Naming
}}}

In the example spec file, the example specifically says Python3 should be default:

{{{

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.

}}}
https://fedoraproject.org/wiki/Packaging:Python#Example_common_spec_file

Note that the comment in the example section would be correct if the example spec file was only installing a single version of the binary (which is the common case). So perhaps it would be better to update the example to do the common case action and just mention the dual-version case.

Here's my attempt to implement the latter suggestion:
https://fedoraproject.org/w/index.php?title=User%3AToshio%2FPython&diff=484331&oldid=484330

I'm working on changing the package in question (python-sphinx) to default to the python2 version for now.

I don't follow Fedora too closely anymore except when people ask me about specific things. If you need me to discuss this more, feel free to ping me (abadger1999) on IRC.


Those quotes are taken out of context, though. I don't disagree that it's confusing all needs to just be tossed and rewritten, but...

The first quote is from a later section of the guidelines documenting the specific case of packaging a version of an executable program for more than one python stack because its functionality differs between versions.

The example spec file is for the general case, where you want just one executable and you want it to be the python3 one.

So a quote from a subsection which documents a specific and non-default case is being compared against a quote from the general documentation. I don't see the conflict between them when read in context. I can see some of the confusion arising because of poor writing and formatting of that subsection, but I haven't the time or energy to work on that document again right now. I'm happy to implement any reasonable suggestions on making it clearer, though.

Right. The problem is that the example spec file currently is describing the specific case. In the %files section it currently has this:
{{{
%files -n python2-%{srcname}
%{_bindir}/sample-exec-2.7

%files -n python3-%{srcname}
%{_bindir}/sample-exec
%{_bindir}/sample-exec-3.4
}}}

which is multiple versions of the program case. My draft removes the versioned executables to make it follow the general case (and adds a little more in the comments to point out when the order would have to be switched.)

yes, it's clearly conflicting information. In example spec unversioned binary is in python3 subpackage while guidelines define that in such case it must be in python2 subpackage.

Moreover, 2.7 and 3.4 are hard-coded values and should not be used, %{python2_version} and %{python3_version} should be used in that case.

I'm all in to simplify example spec to have ONLY unversioned binary.

We discussed this at this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-1/2017-02-09/fpc.2017-02-09-17.01.txt):

  • 672 Python guidelines: change example spec (geppetto, 17:14:42)

  • ACTION: Python guidelines: change example spec to match guidelines
    (+1:5, 0:0, -1:0) (geppetto, 17:25:16)

Metadata Update from @toshio:
- Issue assigned to tibbs

7 years ago

Announcement text:

The example spec in the Python guidelines was modified to correspond to the usual, "python3 is default" case where versioned executables are not installed.

Login to comment on this ticket.

Metadata