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

Add an alias for an editable debug build? #672

Closed
virtuald opened this issue Sep 29, 2024 · 5 comments
Closed

Add an alias for an editable debug build? #672

virtuald opened this issue Sep 29, 2024 · 5 comments

Comments

@virtuald
Copy link

In the documentation, editable installs are done via

$ pip install -e . --no-build-isolation \
    -Csetup-args=-Dbuildtype=debug \
    -Cbuild-dir=build-dbg

... but that's annoying. Having a helper command that meson-python installs that executes this for you would be useful and prevent issues such as #512

A command for setting up editable installs would also be able to set the build-dir using the abi tag, and probably other useful things (I'm sure I'll think of more things as I start using this)...

And yes, every user could create their own script to run this. But why not do it once for everyone, that seems to be the meson philosophy anyways?

@rgommers rgommers changed the title Add Add an alias for an editable debug build? Sep 30, 2024
@rgommers
Copy link
Contributor

In the documentation, editable installs are done via

Not quite, you're mixing several things:

  1. Asking pip for an editable build with pip install -e . --no-build-isolation
  2. Asking meson-python for a debug build
  3. Asking meson-python to build in a custom build directory

Each of those are useful separately, so I don't think this request is a good idea (there's a large amount of such combinations of options one may want). And also a user may want uv rather than pip nowadays, and we'd have to handle conda environment variable unsetting. So I'd much prefer to not add an executable script for anything like this.

Finally, let me note that a separate tool with a better UX than pip for development, which can handle editable installs too now, is https://github.com/scientific-python/spin/. I'd suggest using that instead.

I'm pretty sure others will agree and we don't want to do this, so I'll close this feature request. Thanks for the suggestion though @virtuald.

@rgommers rgommers closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
@virtuald
Copy link
Author

That's fair, but I would argue that much of the time if you're doing an editable install then you're likely going to be interested in debugging -- and https://meson-python.readthedocs.io/en/latest/how-to-guides/debug-builds.html has that exact command that I was referencing. It would be nice if there was an easy way to do that.

However, it does seem like spin would likely be a better place to do it, though having yet another wrapper around things is weird.

@eli-schwartz
Copy link
Member

though having yet another wrapper around things is weird.

Interestingly, this is something that bothers me a lot about the current python ecosystem. People are extremely... tunnel-minded... about having "one way to do it" and how every package must build with the same pip incantation, so build backends have an aversion to providing integrated frontends.

Then it turns out the frontends aren't good enough, or have bad features, so people end up writing backend-specific frontends targeted at specific features, which also wrap other frontends. I still don't understand the utility of poetry, hatch, pdm, etc.

It's an ecosystem-wide issue, dunno what the answer is.

@rgommers
Copy link
Contributor

and https://meson-python.readthedocs.io/en/latest/how-to-guides/debug-builds.html has that exact command that I was referencing.

Note that that's really outdated (I should get around to deleting it). These are the relevant docs: https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html

if you're doing an editable install then you're likely going to be interested in debugging

It's actually very rare in my experience; most users of editable installs want them for IDE integration for pure Python code.

@virtuald
Copy link
Author

virtuald commented Oct 1, 2024

I'm a strong believer in "simple things should be simple and complex things should be possible". When developing a native library, a debug build is often something you want and should be an easy thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants