python-packaging.html will result in incorrect #! lines for Python 3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Packaging Guide |
Fix Released
|
Undecided
|
Dmitry Shachnev |
Bug Description
The advice in python-
PYTHON3=$(shell py3versions -r)
...
set -ex; for python in $(PYTHON3); do \
$$python setup.py build; \
done
...
set -ex; for python in $(PYTHON3); do \
$$python setup.py install --install-
done
... will result in incorrect #! lines for applications defaulting to Python 3, something like #! /usr/bin/python3.2 rather than #! /usr/bin/python3. To avoid that, you need something like this:
https:/
This only really matters if you're defaulting to Python 3, which probably isn't the case in the example given in this documentation since it runs the standard dh_auto_* commands *after* the manual additions and those commands will overwrite #! with #! /usr/bin/python. However, these overrides are likely to be copied and pasted with modifications, so it's worth getting them pedantically right.
Related branches
- Daniel Holbach (community): Approve
-
Diff: 121 lines (+46/-13)5 files modifieddebian/changelog (+10/-0)
themes/ubuntu/static/guide.css (+22/-6)
ubuntu-packaging-guide/python-packaging.rst (+12/-5)
ubuntu-packaging-guide/udd-intro.rst (+1/-1)
ubuntu-packaging-guide/udd-merging.rst (+1/-1)
Changed in ubuntu-packaging-guide: | |
assignee: | nobody → Dmitry Shachnev (mitya57) |
status: | New → In Progress |
Changed in ubuntu-packaging-guide: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-packaging-guide: | |
status: | Fix Committed → Fix Released |
I hope it's OK now:
=== modified file 'ubuntu- packaging- guide/python- packaging. rst' packaging- guide/python- packaging. rst 2012-08-23 11:29:49 +0000 packaging- guide/python- packaging. rst 2012-09-07 16:12:04 +0000
--- ubuntu-
+++ ubuntu-
@@ -37,8 +37,12 @@
.. code-block:: makefile
- # This command builds the list of supported Python 3 versions ,$(PY3REQUESTED )) python3
- PYTHON3=$(shell py3versions -r)
+ # These command build the list of supported Python 3 versions
+ # The last version should be just "python3" so that the scripts
+ # get a correct shebang.
+ PY3REQUESTED := $(shell py3versions -r)
+ PY3DEFAULT := $(shell py3versions -d)
+ PYTHON3 := $(filter-out $(PY3DEFAULT)
%:
# Adding the required helpers