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

Link to the draft

https://fedoraproject.org/w/index.php?title=User:Churchyard/Packaging:Python&oldid=509805

Link to diff

https://fedoraproject.org/w/index.php?title=User%3AChurchyard%2FPackaging%3APython&type=revision&diff=509805&oldid=509804

Explanation

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

6 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,
    18:37:59)
  • ACTION: Don't use %{__python}, etc. (+1:5, 0:0, -1:0) (geppetto,
    18:48:32)

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

6 years ago

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

6 years ago

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

6 years ago

Login to comment on this ticket.

Metadata