You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add better way to do editable python install in project #524
@srilman This isn't really a simple issue, we're working hard on improving our rip library to support more features. But if you really want to help you should be following the work we're doing there!
@ruben-arts Thanks for the advice! Correct me if I'm wrong, but I don't see how rip is related? Assuming that pixi implements something similar to Lifecycle Scripts from npm or yarn, we could execute any arbitrary shell command, not just pip install .... So the workflow when running pixi install would be:
Do all the current actions of pixi install
If a postinstall task is defined, then run pixi run postinstall
Otherwise, exit
Reacted by Martin Stancsics, Lea Waller and Taeyoon Kim
Ah sorry I though it was specifically a request for the pip install --no-build-isolation --no-deps --disable-pip-version-check -e . command. I also like bas' proposal for the lifecycle scripts. Feel free to give it a try.
We changed the logic so much in the last few PR's that I'm not sure what the best strategy is but reusing as much as you can from the src/cli/run.rs is probably important to keep it simple. @baszalmstra do you have some design tips?
For the commands I would start with only postinstall and see how we can implement this the best we can before we implement the logic in more places.
Longer answer, we are relatively close to a first version with uv integrated. This offers us all the features uv provides including editable installs.
However, some features including editable installs require a bit more work. We have to modify the lock file and the pixi.toml to accommodate this. But we'll get there!
Opened a PR with a MVP working. Had a couple of open questions before opening it for review that I put in the PR. If anyone could take a look, that'd be helpful!
Thanks, @pavelzw for this suggestion. One question though - how could you accomodate a following use case: I have a foo package withing a src folder which I want to build as a package. This is how I would set it up in pyproject.toml:
[tool.setuptools.packages.find]
where = ["src"]
include = ["foo"]
Is there a way to do this without having the pyproject.toml in addition to pixi.toml?
Can we get a better explanation of the pixi-endorsed way to do this now? It seems like I am required to have a pyproject.toml. Does that mean I have to use its way of specifying dependencies, rather than specifying dependencies via pixi? If so, that seems not ideal.
I have a top-level pixi.toml and then I have multiple packages that I want installed in an editable manner. My understanding is that the top-level pixi.toml can refer to these by package_name = { path = "path/to/package", editable = true }, but each of these packages needs to have their own pyproject.toml, which meant that I needed to specify dependencies in the non-pixi manner. But then all those dependencies are installed using pypi instead of conda. And if I want them installed from conda, then I actually need to duplicate the dependencies in the top-level pixi.toml
All of this seems suboptimal. So I am hoping I have just missed how this is intended. The current approach makes me not want to put any dependencies in my internal packages and just have a vanilla pyproject.toml. Then I specify each package's dependences as featuers in the top-level pixi.toml
Reacted by Tyler Jost, Daniel San José Pro, Tadeu Manoel, Liam Bindle, vincent-pollet, Nicklas Fianda, ousema-bouaneni, Yunho Cho, Huch0, Samuel and 1 more
Reacted by Tyler Jost, Tadeu Manoel, vincent-pollet, Nicklas Fianda, Yunho Cho, Huch0 and Lood
Can we get a better explanation of the pixi-endorsed way to do this now? It seems like I am required to have a pyproject.toml. Does that mean I have to use its way of specifying dependencies, rather than specifying dependencies via pixi? If so, that seems not ideal.
I have a top-level pixi.toml and then I have multiple packages that I want installed in an editable manner. My understanding is that the top-level pixi.toml can refer to these by package_name = { path = "path/to/package", editable = true }, but each of these packages needs to have their own pyproject.toml, which meant that I needed to specify dependencies in the non-pixi manner. But then all those dependencies are installed using pypi instead of conda. And if I want them installed from conda, then I actually need to duplicate the dependencies in the top-level pixi.toml
All of this seems suboptimal. So I am hoping I have just missed how this is intended. The current approach makes me not want to put any dependencies in my internal packages and just have a vanilla pyproject.toml. Then I specify each package's dependences as featuers in the top-level pixi.toml
I totally agree with this. I am working now with an empty pyproject.toml inside of my package, but this does not seem to be the way to go. And creating subpackages inside of my package which only requires one subpackage also looks suboptimal.
I don't think #879 solves the question above right? Especially the following text:
But then all those dependencies are installed using pypi instead of conda. And if I want them installed from conda, then I actually need to duplicate the dependencies in the top-level pixi.toml.
My use-case: I have package A, that imports an editable install of package B (which then installs package B plus its dependencies using pypi). One of those dependencies is a conda package though, which then fails when installing from pip.
If I'm understanding correctly, it would be nice if pixi installed package A's requirements using pixi, and also installed all package B's requirements using pixi too (instead of doing all those dependencies using pypi).
Activity
baszalmstra commentedon Nov 30, 2023
Maybe it would be nice to implement something similar to Lifecycle Scripts in yarn and npm.
srilman commentedon Feb 4, 2024
+1 I was initially confused by the examples, since
postinstallis the same name used in yarn/npm. Happy to contribute given a little advice!pavelzw commentedon Feb 6, 2024
Also being able to install wheels in some form using
ripwould be nice for my production use case:I'm currently using this workaround (with the annoyance that
pipis still in my prod environment):ruben-arts commentedon Feb 6, 2024
@srilman This isn't really a simple issue, we're working hard on improving our
riplibrary to support more features. But if you really want to help you should be following the work we're doing there!srilman commentedon Feb 6, 2024
@ruben-arts Thanks for the advice! Correct me if I'm wrong, but I don't see how
ripis related? Assuming that pixi implements something similar to Lifecycle Scripts from npm or yarn, we could execute any arbitrary shell command, not justpip install .... So the workflow when runningpixi installwould be:pixi installpostinstalltask is defined, then runpixi run postinstallruben-arts commentedon Feb 7, 2024
Ah sorry I though it was specifically a request for the
pip install --no-build-isolation --no-deps --disable-pip-version-check -e .command. I also like bas' proposal for the lifecycle scripts. Feel free to give it a try.We changed the logic so much in the last few PR's that I'm not sure what the best strategy is but reusing as much as you can from the
src/cli/run.rsis probably important to keep it simple. @baszalmstra do you have some design tips?For the commands I would start with only
postinstalland see how we can implement this the best we can before we implement the logic in more places.Emsu commentedon Feb 23, 2024
For those of us needing editable installs, is the official recommendation to wait for
uvintegration?I read this blog post and it seems like we should wait until the integration is complete and editable installs will work out of the box? https://prefix.dev/blog/uv_in_pixi
baszalmstra commentedon Feb 24, 2024
Short answer: yes.
Longer answer, we are relatively close to a first version with uv integrated. This offers us all the features uv provides including editable installs.
However, some features including editable installs require a bit more work. We have to modify the lock file and the pixi.toml to accommodate this. But we'll get there!
pavelzw commentedon Mar 3, 2024
xref #879
srilman commentedon Mar 4, 2024
Opened a PR with a MVP working. Had a couple of open questions before opening it for review that I put in the PR. If anyone could take a look, that'd be helpful!
ruben-arts commentedon Mar 4, 2024
I would like to close this feature in favor of #879
MatusGasparik commentedon Apr 2, 2024
Thanks, @pavelzw for this suggestion. One question though - how could you accomodate a following use case: I have a
foopackage withing asrcfolder which I want to build as a package. This is how I would set it up inpyproject.toml:Is there a way to do this without having the
pyproject.tomlin addition topixi.toml?pavelzw commentedon Apr 2, 2024
pixi.toml now (not released yet) also supports pyproject.toml. I would wait for the new release and then figure out best practices
spacecaterpillar commentedon Mar 22, 2025
Can we get a better explanation of the pixi-endorsed way to do this now? It seems like I am required to have a
pyproject.toml. Does that mean I have to use its way of specifying dependencies, rather than specifying dependencies via pixi? If so, that seems not ideal.I have a top-level
pixi.tomland then I have multiple packages that I want installed in an editable manner. My understanding is that the top-levelpixi.tomlcan refer to these bypackage_name = { path = "path/to/package", editable = true }, but each of these packages needs to have their ownpyproject.toml, which meant that I needed to specify dependencies in the non-pixi manner. But then all those dependencies are installed using pypi instead of conda. And if I want them installed from conda, then I actually need to duplicate the dependencies in the top-levelpixi.tomlAll of this seems suboptimal. So I am hoping I have just missed how this is intended. The current approach makes me not want to put any dependencies in my internal packages and just have a vanilla
pyproject.toml. Then I specify each package's dependences as featuers in the top-levelpixi.tomldanielsanjosepro commentedon May 13, 2025
I totally agree with this. I am working now with an empty
pyproject.tomlinside of my package, but this does not seem to be the way to go. And creating subpackages inside of my package which only requires one subpackage also looks suboptimal.loodvn commentedon Dec 8, 2025
I don't think #879 solves the question above right? Especially the following text:
My use-case: I have package A, that imports an editable install of package B (which then installs package B plus its dependencies using pypi). One of those dependencies is a conda package though, which then fails when installing from pip.
If I'm understanding correctly, it would be nice if pixi installed package A's requirements using pixi, and also installed all package B's requirements using pixi too (instead of doing all those dependencies using pypi).