Commit 1cdb8cb
ci: always use $PATH python
Consider the following output form `which python3` and `which pytest-3` in
the CI environment:
which python3
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.10.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib
/opt/hostedtoolcache/Python/3.10.15/x64/bin/python3
which pytest-3
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.10.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib
/usr/bin/pytest-3
Since we were getting e.g. cffi vi `apt-get install python3-cffi`, we were
using the *system* python's cffi for everything. That worked because we
invoked the *system* pytest-3.
Of course, that means we were not really using the github python action's
python in our CI matrix, since we were always using the system python for
everything.
Instead, let's set up a venv as a traditional project would, and that way
we can explicitly call that venv's python everywhere in the makefile, so we
always use that venv's packages and get the right python.
Then, we need only be careful to use the $PATH python, not /usr/bin/python,
to set up this venv, and we always get the right version of python to test
with.
This likely explains some weirdness that I've seen in the past, should have
investigated sooner...
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>1 parent d91df9f commit 1cdb8cb
File tree
4 files changed
+20
-9
lines changed- .github/workflows
4 files changed
+20
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
55 | | - | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments