File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,15 @@ RUN set -eux \
71
71
; fi \
72
72
; mkdir /pypy && tar -xf /pypy.tar.bz2 -C /pypy --strip-components=1
73
73
74
- ENV PATH="/pypy/bin:$PATH"
74
+ # Make pypi available and ensure executables installed by pip are available
75
+ # (pip uses the "User Scheme" in recent Debian/Ubuntu,
76
+ # see https://packaging.python.org/en/latest/guides/installing-using-linux-tools/#debian-ubuntu)
77
+ ENV PATH="$PATH:/pypy/bin:/home/tox/.local/bin"
78
+
79
+ # Set the default python version
80
+ RUN set -eux \
81
+ ; ln -f -s /usr/bin/python${PYTHON_MAIN_VERSION} /usr/bin/python \
82
+ ; ln -f -s /usr/bin/python${PYTHON_MAIN_VERSION} /usr/bin/python3
75
83
76
84
# Create user (with sudo privileges) and app directory
77
85
RUN set -eux \
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ The list of Python versions to install is passed as arguments (see `Dockerfile`)
11
11
One Python version must be selected as "main" - it will be used to install ` tox ` .
12
12
Along with "regular" Python versions, one pypy version will also be installed.
13
13
14
+ The main python version is set as the default in the container (` python ` and ` python3 ` ).
15
+
14
16
** IMPORTANT** : Python versions must be available either in the official Ubuntu repositories or in
15
17
the [ deadsnakes PPA] ( https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa ) . The PyPy version should
16
18
be available at https://www.pypy.org/download.html .
@@ -29,3 +31,16 @@ so it is possible to run `sudo apt update && sudo apt install ...`.
29
31
30
32
After updating the Python versions in the ` Dockerfile ` , ensure you also update ` test/tox.ini ` to
31
33
reflect the change.
34
+
35
+ ## About pip
36
+
37
+ As stated in https://packaging.python.org/en/latest/guides/installing-using-linux-tools/#debian-ubuntu :
38
+
39
+ > Recent Debian/Ubuntu versions have modified pip to use the “User Scheme” by default,
40
+ > which is a significant behavior change that can be surprising to some users.
41
+
42
+ In other words, pip now installs libraries and executables in ` $HOME/.local ` (or ` /home/tox/.local `
43
+ in this image).
44
+
45
+ This has no impact, except when running commands as ` sudo ` . Just keep in mind the ` root ` user
46
+ doesn't have the same packages installed.
You can’t perform that action at this time.
0 commit comments