pyproject: hack around to make editable install work #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switching to
pyproject.toml
completely withsetuptools
seems to have broken editable installs a bit formypy
(and possibly others): python/mypy#13392.From reading through that, there seem to be a few options to hack around it:
package-dir
. Not sure why this works, but it seems to work and is used by others too.pip install --config-settings editable_mode=strict --editable .
. This seems to work, but it's easy to forget to add options topip install
.src-layout
: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/. Not sure whatsetuptools
is doing differently in that case, but it seems to pick up the typing correctly with no other changes..I mostly went with 1 because it's very non-intrusive, but it doesn't seem documented as a workaround for editable installs, so the behavior might change..