Closed gjoseph92 closed 1 month ago
FYI @frostming. No need to look at this, but if you're interested, maybe there's an issue with non-isolated PEP 517 builds? I don't honestly know if it's a PDM bug, or just that the readthedocs environment setup is so strange. But removing --no-isolation
got it to work for now. With that, I was getting ModuleNotFoundError: No module named 'pdm'
during the wheel build in the subprocess.
This PR change is correct. No need to use --no-isolation
here.
Good, thanks. I was just wondering why it failed in that way when I did use --no-isolation
, and curious if it was a PDM bug or not.
What a goose chase. Removing
--no-isolation
got it working. (Previously it didn't work without this.)The problem, I think, was something about non-isolated PEP-517 build process not fully inheriting the readthedocs virtual environment?
You can see that the
Running PEP 517 backend to build a wheel for <Link file:///home/docs/checkouts/readthedocs.org/user_builds/stackstac/checkouts/252 (from None)>
fails in a build like this one: https://readthedocs.org/projects/stackstac/builds/25268793/What I notice in the traceback is that at first, PDM is running in its own self-managed venv in
/home/docs/.local
:But then we get
Notice this is running in
/home/docs/.asdf
instead of/home/docs/.local
. So a different environment.I don't know much about PEP-517 builds or the PDM internals, but my guess here is kinda that, in non-isolated mode, PDM is supposed to ensure that the PEP-517
build-system.requires
packages (pdm-pep517
) are installed in the current(?) environment, then invoke the Python executable as a subprocess to do the actual build. But I think it's invoking the wrong subprocess / not ensuring that subprocess is in the same environment. So it basically runs "system" Python (the Python shim installed by asdf??), wherepdm-pep517
isn't actually installed.tl;dr I'm guessing that in non-isolated mode, PDM is ensuring
pdm-pep517
is installed in the current environment before calling a subprocess to build the wheel, but doesn't actually run that subprocess in the current environment.