Open
Conversation
3c47c8d to
a7bac7b
Compare
dfangl
reviewed
Jan 29, 2026
plux/build/config.py
Outdated
Comment on lines
196
to
198
| if plux_config.bild_backend != BuildBackend.AUTO: | ||
| # first, check if the user configured one | ||
| return plux_config.bild_backend |
Member
There was a problem hiding this comment.
Suggested change
| if plux_config.bild_backend != BuildBackend.AUTO: | |
| # first, check if the user configured one | |
| return plux_config.bild_backend | |
| if plux_config.build_backend != BuildBackend.AUTO: | |
| # first, check if the user configured one | |
| return plux_config.build_backend |
I will review the rest a bit later, however this seems like an obvious error 😅 It is quite consistent, however it is not instantiated with that name on line 138.
Member
Author
There was a problem hiding this comment.
thanks for spotting, i'll do one more pass and write some tests :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Plux has been deeply depending on setuptools, but with #34 we now have a way to easily integrate new build backends. Hatch and hatchling are the first candidates given their significance in the python ecosystem.
This PR adds a
Projectimplementation for hatchling as build backend, but limited to manual build mode for now (no build hook integration). The main things I added are:Finding packages with hatchling: The primary difference to manual build mode in setuptools is the way the config is scanned and packages are discovered. In setuptools, there is a package finder that already recursively lists all existing python packages in the source tree. Hatchling does not have that, so I needed to add our own implementation that resolves packages, but uses information from the hatchling config in the case of namespace packages.
Test isolation: Because having both hatchling and setuptools in the same process makes testing unreliable, I found a hacky way to isolate tests (see the docstrings in the module for more explanation). I guess it's ok for now, given that everything was previously set up to use setuptools, so the codebase is still biased towards it. In the future, it would be great if we find a better way to test and develop multiple build backends.
Build backend detection: I had to add explicit build backend detection to fix an issue where setuptools may be in the sys path, but actually hatchling is being used. I added a config option with which the build backend can be set explicitly with
[tool.plux] build_backend = "hatchling"if needed, but will automatically pick the one that's set in thebuild-backendfield ofbuild-system. If none of that is set it falls back to auto detection using imports.Changes
[tool.plux] build_backend = "hatchling"if needed, but will automatically pick the one that's set in thebuild-backendfield ofbuild-systemTODO