Skip to content
Snippets Groups Projects
Commit 5979f0b0 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

bin/install: Force legacy behavior of editable installs with recent pip

As mypy does not support editable installs for projects that have a
pyproject.toml and use a build backend that supports PEP 660, force
the legacy behavior of editable installs by passing the configuration
settings "editable_mode=compat" to the build backend.

It enables to remove the pip version restriction in the swh venv and
avoid bad surprises when the mypy pre-commit hook is called when
committing in a swh repository.

See https://github.com/python/mypy/issues/13392 for more details.
parent 99253ecf
No related branches found
Tags v0.23.5
1 merge request!264bin/install: Force legacy behavior of editable installs with recent pip
......@@ -8,14 +8,18 @@ PIP="python3 -m pip $PIP_FLAGS"
# pip 21.3 added support to editable installs for projects that have a
# pyproject.toml and use a build backend that supports PEP 660, but mypy
# does not detect yet such editable installs and following errors are
# does not support such editable installs and following errors are
# reported when type checking swh modules :
#
# Cannot find implementation or library stub for module named swh....
#
# TODO: Remove that version pin once mypy supports PEP 660 editable
# installs, see https://github.com/python/mypy/issues/12313
$PIP install "pip<21.3"
# As a workaround, we force the legacy behavior of editable installs
# by passing the "editable_mode=compat" configuration settings to the
# PEP 517 build backend
#
# See https://github.com/python/mypy/issues/13392
$PIP config --site set install.config-settings editable_mode=compat
$PIP install $PREREQUISITES "$@"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment