Skip to content

Commit 59b4761

Browse files
author
Philip Roche
committed
plugins: Pin pip to supported versions
pip 21 dropped support for python 3.5 and python 2. pip >=21 no longer support python3.5 or python 2 and if used will result in a broken install with pip unable to install packages. * Drop support for Python 3.5 pypa/pip#9189 * Drop support for Python 2 pypa/pip#6148
1 parent 0d52143 commit 59b4761

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

snapcraft/plugins/_python/_pip.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ def _ensure_pip_installed(self):
184184
self.__python_home = os.path.join(os.path.sep, "usr")
185185

186186
# Using the host's pip, install our own pip
187-
self.download({"pip"})
187+
# pip >=21 no longer support python3.5 or python 2 and if
188+
# used will result in a broken install with pip unable to
189+
# install packages.
190+
self.download(
191+
{'pip; python_version >= "3.6"', 'pip<21; python_version < "3.6"'}
192+
)
188193
self.install({"pip"}, ignore_installed=True)
189194
finally:
190195
# Now that we have our own pip, reset the python home

0 commit comments

Comments
 (0)