-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editable install of screenpy in IDE fails to recognize code #26
Comments
As mentioned above, there are alternatives to setuptool we could consider. At the risk of sounding self-serving, I have found poetry-core configured as the backend in the pyproject.toml works when doing editable installs. It also has the added benefit of allowing screenpy contributors to use poetry to fully manage their environments when branch switching without having to manually manipulate dependencies. |
…from the normal.
* #26 using pyproject.toml to configure installation of package Co-authored-by: Marcel Wilson <[email protected]>
) * ScreenPyHQ#26 using pyproject.toml to configure installation of package Co-authored-by: Marcel Wilson <[email protected]>
) * ScreenPyHQ#26 using pyproject.toml to configure installation of package Co-authored-by: Marcel Wilson <[email protected]>
When using screepy package via editable install (i.e.
pip install -e ~/projects/screenpy
) IDE code editors fail to recognize the package is installed (imports appear with red underlines). The package will work at runtime but the editor is rendered useless because the IDE can't figure out where the code is on the drive.This appears to have started with the introduction of the pyproject.toml file in 352c97c .
Further explanation about what's happening can be found here:
python/mypy#13392 (comment)
Apparently pip prioritizes using the
pyproject.toml
over thesetup.py
when installing the package. In its current state, our pyproject.toml doesn't define[build-system]
so pip defaults to the Fallback Behavior by using the latest version of setuptools. As mentioned in the quote above, v64 setuptools changed how editable installations work. See python/mypy#13392 (comment)The immediate solution would be to configure the toml to use setuptools 63 until pypa/setuptools#3518 is resolved. Or we could consider using a different backend to install the project (e.g. poetry, flit, etc).
Since python is moving away from using
setup.py
topyproject.toml
to configure the install of packages this might be the perfect time to look at what we want in the toml beyond the immediate issue of editable installs.The text was updated successfully, but these errors were encountered: