@@ -29,8 +29,8 @@ RUN echo "Python version:" \
29
29
&& echo "Installing dependencies:" \
30
30
# Export packages from poetry.lock
31
31
&& poetry export -f requirements.txt --without-hashes | \
32
- # Replace playwright version so that it matches whatever is pre-installed in the image
33
- sed "s/^playwright==.* /playwright==$(playwright --version | cut -d ' ' -f 2)/" | \
32
+ # Replace playwright version so that it matches whatever is pre-installed in the image (the `hash` checks if playwright is installed)
33
+ sed "s/^playwright==\( .* \) /playwright==$(hash playwright 2>/dev/null && (playwright --version | cut -d ' ' -f 2) || echo ' \1 ' )/" | \
34
34
# Install everything using pip (ignore dependency checks - the lockfile is correct, period)
35
35
pip install -r /dev/stdin --no-dependencies \
36
36
&& echo "All installed Python packages:" \
@@ -48,9 +48,9 @@ RUN echo "Python version:" \
48
48
&& python --version \
49
49
&& echo "Installing dependencies:" \
50
50
# Install everything using pip, set playwright version so that it matches whatever is pre-installed in the image
51
- cat requirements.txt \
52
- # Replace playwright version so that it matches whatever is pre-installed in the image
53
- sed "s/^playwright==.* /playwright==$(playwright --version | cut -d ' ' -f 2)/" | \
51
+ && cat requirements.txt | \
52
+ # Replace playwright version so that it matches whatever is pre-installed in the image (the `hash` checks if playwright is installed)
53
+ sed "s/^playwright==\( .* \) /playwright==$(hash playwright 2>/dev/null && (playwright --version | cut -d ' ' -f 2) || echo ' \1 ' )/" | \
54
54
# Install everything using pip (ignore dependency checks - the lockfile is correct, period)
55
55
pip install -r /dev/stdin --no-dependencies \
56
56
&& echo "All installed Python packages:" \
0 commit comments