#745 Don't use %{__python}, %{python_sitelib}, and %{python_sitearch} unless redefined
Closed: accepted 4 years ago Opened 4 years ago by churchyard.

Link to the draft


Link to diff



First of all, the guidelines said __python is %{__python2}, which is not true, it's /usr/bin/python, not /usr/bin/python2.

The guidelines say (in a different section) that usage of /usr/bin/python is forbidden. Packagers have assumptions about %{__python}, %{python_sitelib}, and %{python_sitearch} - we need them not to assume anything. Either use %{__python2}, %{python2_sitelib}, and %{python2_sitearch} explicitly or set %{__python} to your preferred python version if you must.

Second, the guidelines said stuff like "default python interpreter" and other undefined things we want to avoid. I removed those.

Related to https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build

BTW The idea behind using %{__python}, %{python_sitelib}, and %{python_sitearch} might have been that a packager who doesn't care which version is used uses those and leaves the decision on the distro. However, in reality those are heavily combined with python2 only approaches and are simply assumed to be python2. If a packager still wants to use it as once intended, they can set __python to be python3 (or 2) at the top of the specfile (even conditionalize this for EPEL/Fedora or whatever) and keep the python2/python3 difference be determined only by the definition of __python they desire.

Metadata Update from @tibbs:
- Issue tagged with: meeting

4 years ago

We discussed this at this weeks meeting (http://meetbot.fedoraproject.org/fedora-meeting-2/2018-02-21/fpc.2018-02-21-18.00.txt):

  • x745 Don't use %{__python}, %{python_sitelib/arch} unredefined
    (geppetto, 18:34:03)
  • ACTION: Don't use %{__python}, etc. (+1:4, 0:0, -1:0) (geppetto,
  • ACTION: Don't use %{__python}, etc. (+1:5, 0:0, -1:0) (geppetto,

Metadata Update from @james:
- Issue untagged with: meeting
- Issue tagged with: writeup

4 years ago

Metadata Update from @tibbs:
- Issue untagged with: writeup
- Issue assigned to tibbs
- Issue tagged with: announce

4 years ago

Metadata Update from @tibbs:
- Issue untagged with: announce
- Issue close_status updated to: accepted
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.