-
Notifications
You must be signed in to change notification settings - Fork 219
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
Cython source file is not compiled after pixi install/update #1695
Comments
Does the issue persist for How do you expect an editable cython package to behave? Should that rebuild on install or what does it mean? |
Hi! I think this is because uv became a bit smarter with just building the metadata of wheels, during the solve. The workaround for now is to use Something we could relatively easily implement is |
If
As here says: "Please note that some kind of changes, such as the addition or modification of entry points or the addition of new dependencies, and generally all changes involving package metadata, require a new installation step to become effective."
I think it may not be plausible to reinstall the entire env whenever the cython code is changed. Because during the development, the cython code is changed very often. It will be helpful to provide cli to reinstall the local package only. |
We're currently always "checking" if the environment is up-to-date when you run Plus to solve the action cache problem, also rebuild on a clean |
It will solve the problem to simply set pixi run "uv pip install --no-deps --force-reinstall -e ." However, curl -LsSf https://astral.sh/uv/install.sh | sh Should |
I think all of these settings could make sense for pixi.
We deliberatly don't install any other package managers as there should in theory be no reason to need extra installers. For these more demanding projects you can also install |
The quote:
So I think most of the times the C/C++ code does not change the metadata, so there is no need for a frontend to rebuild. However, I think, we could think of a combination of flags that would work :) |
With some more testing, I'm now kind of rethinking the whole thing. I've tried doing an We should have a closer look at what's happening here. @olivier-lacroix do you have any experience with |
None whatsoever @tdejager :-/ |
Again, now that I'm thinking of it, it might be meson doing it itself. |
@MatthewSZhang it would be great that if you could check if you like the flags for uv i.e. fit your workflow and behaves as you would expect, if you have the time of course. You can successfully install your repo with uv in an activated pixi shell. e.g # install uv, through github, homebrew, pip (pixi global install does not work as of now)
uv venv .venv
uv pip install -e . And then do the modifcations as you see fit. |
Hi @tdejager , I have tried [tool.pixi.pypi-dependencies]
mypk = { path = ".", editable = true } So the resulting cli is something like There are two things that may need to be clarified:
|
Just chiming in on the possible API for this, as I had similar thoughts for docker layering purposes in #1652 (comment) I don’t feel like a This being said, there may be some value in having a separate pixi command (e.g. |
@olivier-lacroix I reacted to you with one comment on #1652 (comment). |
This is not the case, meson-python will auto-rebuild all extension modules for which source files ( I'll note that editable installs have various limitations, some of which are fundamental and some are backend-specific. The need to re-run the build/install command for extension modules manually is a
Note that if you're using meson-python, adding Please feel free to ping me on |
Hi! Ralf. Thank you for this response, it's great to see you here in this repository :) So are you saying, and If I'm reading the documentation correctly, that if you throw away the built extension in this issues case the |
Happy to be here! Quite liking my first forays into Pixi land:)
Not quite. That will actually give you a confusing error, the error message for which is hard to improve because of how Traversable works. What an editable install produces is:
If you remove (2) but keep (1), then an If you remove the I'd imagine that if you only do |
Hi Rolf! Thanks for the clarification, this is very helpful. I'm not sure what in the original workflow by the OP results in a missing build dir. However, with that said and your details, I do think that an explicit re-install of that package is the right way to go. Which will essentially do what you suggested. Uninstall and re-install. I suppose the 'build_wheel' pep517 needs to be recalled as well because getting the built wheel from a cache will still not give you back the 'build' folder. Is that correct :)? |
Also as an aside @rgommers if there is any way we can improve the experience of scientific Python users that you see, please make as many issues as you'd like 👍😁 |
Yes, that sounds right, assuming you know that the
Will do, thank you! So far it's been a smooth ride, but just getting started (some progress at https://github.com/rgommers/pixi-dev-scipystack). Hopefully I have learned enough to ask intelligent questions in a couple of weeks at EuroSciPy. |
Hi @rgommers Thanks for your explanation and I understand meson better now :) Hi @tdejager
The build dir will loss when using github action |
I’m encountering a similar issue. I’m working on a C++ and Python project using scikit-build-core as the build backend. When I make changes to the C++ source code, running pixi install doesn’t recompile the .so files. I’ve tried running The only way I’ve found to get pixi to reinstall my package is by toggling the editable flag in pyproject.toml between true and false. |
I think it should be |
Seems like |
Yeah you are right, we should start including this! |
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
pixi run test
ERRORS
FileNotFoundError: [Errno 2] No such file or directory: '~/fastcan/build/cp312'
Here is my repo
Issue description
The project contains some cython code, which should be compiled when installing the
default
environment. The compiled file should be in the folder calledbuild
. There are some founding about the folderbuild
.pixi/envs/
does not containdefault
environment,pixi install
will correctly generatebuild
folder..pixi/envs/
containsdefault
environment butbuild
folder for some reason is missing,pixi install
will not generatebuild
folder and only print "The default environment has been installed."pixi update
will solve the problem 2, but the latest version 0.26.1 cannot anymore.prefix-dev/[email protected]
for github CI (cache enable),build
folder is missing and cannot be regenerate bypixi update
.Expected behavior
When I run
pixi install
orpixi update
, pixi should check whether the environment properly install the project (in editable mode) which contain cython code. If thebuild
folder missing, pixi should notice it and regenerate it.The text was updated successfully, but these errors were encountered: