Skip to content
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

Detect when a conflicting editable install exists #150

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

stefanv
Copy link
Member

@stefanv stefanv commented Jan 11, 2024

Closes #143

I'd like to check with @rgommers that this won't impact the workflow of those using editable packages. Do those users also use spin? If so, should we more explicitly accommodate editable installs, and simply skip the build step?

@stefanv stefanv added the type: Enhancement New feature or request label Jan 11, 2024
@rgommers
Copy link
Contributor

This seems right to me. It seems to me that use of spin will get too messy if it also tries to support editable builds. Not 100% sure, but it looks a little messy and it's not supported right now.

The NumPy docs spell it out very clearly right now (see note above https://numpy.org/devdocs/building/index.html#customizing-builds):

image


try:
dist = importlib_metadata.Distribution.from_name(package)
if dist.origin.dir_info.editable:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also raise a different warning if a non-editable but installed distribution is detected? Possibly outside the directory expected by spin? That might lead to similar confusion.

Looks like an improvement otherwise! 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortunately, a non-editable installation does not cause problems.

The editable installs are particularly obnoxious, because their hooks are run before the PYTHONPATH takes effect.

@stefanv
Copy link
Member Author

stefanv commented Jan 12, 2024

It seems to me that use of spin will get too messy if it also tries to support editable builds.

Since we now have a way to detect editable installs, we could potentially switch build and PYTHONPATH-setting to no-ops if the editable matches the current directory.

I'll look into that as a follow-up PR.

@stefanv stefanv merged commit c89d824 into scientific-python:main Jan 12, 2024
17 checks passed
@jarrodmillman jarrodmillman added this to the 0.9 milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meson's editable installs overrides spin's own meson-based installation
4 participants