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
Support pyproject.toml as an alternative to pixi.toml #79
In python world it would be far from ideal to need both a pyproject.toml and a pixi.toml. Ideally pixi would also be able to read a pyproject.toml file and use that as a project file.
Some care needs to be taken in the distinction between conda and pypi packages. Since the pyproject.toml originally specifies pypi packages I think we would need to add another section for the conda packages.
[tool.pixi.dependencies]
some_conda_package = "*"
Reacted by Alex Kerney, Dave Hirschfeld, Olivier Lacroix, Pavel Zwerschke, Travis Hathaway, nandi, Ralf Gommers, Louis Maddox, goyalyashpal, Jan-Hendrik Müller and 12 more
changed the title [-]Support pyproject as an alternative to pixi.toml[/-][+]Support `pyproject.toml` as an alternative to `pixi.toml`[/+]on Jun 12, 2023
How about putting all Python dependencies in project.dependencies and then having a Pixi mapping that allows overriding specific dependencies with their conda sourced counterparts?
That would help a project that could be installed via PyPI and via Pixi, and allow specifying dependcies that should be installed via pip by not mapping a conda source.
# Python only dependencies
[project]
dependencies = [
"xarray=2023.05.01",
"requests", # since it isn't mapped below, Pixi should try to install it from pip
]
# Up to the user to provide if installing via PyPI
[tool.pixi.dependencies]
netcdf4 = "*"# Python dependencies that should preferably be installed via conda packages
[tool.pixi.mapped_dependencies]
xarray = "xarray=2023.05.01"
Reacted by Bas Zalmstra, Lucio Queiroz, Dave Hirschfeld, Luiz Irber, Hadrien Mary, nandi and jcyongqin
having a Pixi mapping that allows overriding specific dependencies with their conda sourced counterparts?
That would be useful where the packages have different names or there are constraints specified in the pip format instead of what pixi expects.
You could theoretically automate that by parsing and converting the pip constraints and using a pypi --> conda-forge mapping but easier, and just as effective, would be to allow the pip dependencies to be manually overridden as outlined above 🚀
how about conda/pixi just serve as a 'bootstraper' (to instally python, R, julia, npm, js) where each language can have its own way of dealing with libraries?
i used to want conda to handle all the packaging but i learned that creates constant friction.
@majidaldo we firmly believe that the conda ecosystem provides a package management solution beyond just language-specific packages. It makes it trivial to install packages for different languages and provides packages for system dependencies. Conda is an excellent replacement for docker in a lot of ways. We believe conda packages are the way forward.
Nonetheless, pixi can already easily be used as a boostrapper. Using a pixi project like this would bootstrap a python/poetry environment:
Installing poetry into the environment it manages is generally sadness inducing. It tends to do things like update it's own dependencies (which causes it crash mid update). We moved away from using mamba to manage poetry for this and use brew instead, just using mamba for the python binary + some other bits.
I'd like to +1 some kind of support (or conversion even) from pyproject.toml. I have a protect with a pyproject.toml, with the expectation to use poetry:
For one reason or another, it tries to resolve dependencies forever on one of my machines. I'm trying out replacing it with pixi, and (in practice) I'm doing a lot of:
I'm not sure conversion needs to be a core feature, because there will be oodles of different formats (and likely impossible to support them all). But Perhaps a small library that is even separate, or a web interface to handle it?
Also a suggestion for the new docs - maybe default to dark mode with yellow to match the current site? The white/yellow is a bit jarring for someone like myself that lives in a bat cave. 🦇
We're still working hard on the pypi support, which the focus goes towards especially when you want to support pyproject.toml you don't want to use other tools like pip and poetry as they are all going to read from the same file.
We're also going through some major refactors of the pixi code in the way we interact with the toml file so supporting two formats as of right now will slow down progress.
That said this feature will most likely be one we're picking up after the refactors that are planned.
Continue giving ideas to this thread so we can start on this with a good understanding of the users needs! 💯
My main use case here as simple as it sounds is to not have a bunch of different files flying around our repositories.
Especially as pixi (and for that matter conda) are specialized tools that don't show up in python tutorials, installation examples and so on so python devs are used to seeing a pyproject.toml and looking into it to figure out what is going on.
I know that pixi is trying to also be a tool for non-python packages but I would assume that there are a huge amount of python devs that might be a pool for you to gain traction and more early adopters.
Managing a separate file might seem like a small thing but I actually think it might be quite important for adoption to convince devs to try out the tool.
Personally, I have nothing against having a pixi.toml file next to the standard pyproject.toml file. I even quite like it to have some specific Pixi configurations in pixi.toml because pyproject.toml files tend to be a bit too long if we include the configuration of all tools.
However, I don't think it is good to have to maintain two versions of the version string in these 2 files (same for name and description but this is less a problem since they don't change too much).
I understood (#638 (comment)) that Pixi developers believe in "one source of truth", meaning in practice one file.
For Python projects, if we'd like only one file, it has to be pyproject.toml and not pixi.toml.
Python has a Python Packaging Authority, many related recent PEPs and a nice dynamics on packaging related to what is done by PyPA (PDM is an interesting example and IMHO Pixi should also take inspiration from this project). It's counter productive not to follow the results of this standardization effort when you can.
If you (Pixi devs) think "only one file" is important:
I believe you already know about Rye, but I think it's worth re-reading about Rye's philosophy and this discussion about whether Rye should exist or not.
Personally I'd love to have a single tool support both conda package and PyPi packages that is fast and supports building Python packages using the standard pyproject.toml with minimal tool-specific additions to it. Ideally the same pyproject.toml should be usable by PDM/Hatch/Rye/Pixi to build and upload to PyPi, and by Pixi to also build & upload to conda-forge.
I'd like to use pixi but I also want to have my package installable by pip and to be able to publish functional python wheels. I'd like to be able to support that without having to specify dependencies and constraints twice in the pyproject.toml file.
To interop smoothly with pip it might be nice to have a package which could parse the pixi dependencies and dynamically specify them for pip in the same way that hatch-requirements-txt can parse requirements.txt files to dynamically specify dependencies.
I'd like to be able to support that without having to specify dependencies and constraints twice in the pyproject.toml file.
Pixi dependencies are about conda packages, which are really not the same than the PyPI packages written in the list pyproject.toml [project] dependencies.
IMHO, if you want to publish functional python wheels, you need another specialized tool (PDM, Hatch, Poetry, ...) working with PyPI packages and standard Python virtual envs.
We now have two different worlds for Python packaging:
Both are nice and have their pros and cons. For maintainers of scientific Python packages it's now good to support both frameworks.
I think Pixi could become great for the conda part and should focus on this aspect. Therefore, I'm not sure Pixi should try to also work with standard Python venvs based only on PyPI packages.
If you like Pixi, I guess you like lock files. Then you might want to try PDM for the PyPA aspect.
Some data can be shared between these 2 frameworks (in particular [project], name, description, version). Other data should be kept separated, as for example the runtime, build, optional and dev dependencies.
Of course, it would be nice to also have a simple way to specify that the conda/pixi dependencies can just be taken to be the PyPI dependencies ([build-system] requires, [project] dependencies and groups in [project.optional-dependencies]), which could work for simple cases, but it is a special case.
Of course, for a lot of simple cases, there is a direct correspondence between a Python wheel on PyPI and a conda package. But there are also more complicated cases,
Yeah, I think I agree that it might be more trouble than it's worth 😔
You'd need pypi-specific deps, conda-specific deps, and even where there are common dependencies you'd still need to translate the package names. At that point, it's probably just easiest to maintain separate sets of dependencies.
At least having them in the same pyproject.toml file would help to keep them in-sync as it would be less likely to forget to update one set.
In the HoloViz ecosystem we are Python library authors and also heavy conda users. A long, long, long time ago (before my time) the group of HoloViz maintainers built https://github.com/holoviz-dev/pyctdev, a tooling library meant to support developing a library using either conda or pip through a unified interface. While this tool has been useful to some extent, it also has failed in many ways and in practice is now only used on our CI (holoviz-dev/pyctdev#104). We're also not super fond of maintaining a Python packaging/tooling library :D (please don't use pyctdev!!!).
While pyctdev hasn't been wildly successful, I believe there's still a lot of value in making it easier to develop a Python library using conda as the env+package manager, while still allowing contributors to only use pip if they prefer. Some of the advantages given by conda are that it makes it easy to control which Python version to use and it allows installing non-Python dependencies (some of our projects require nodejs for instance).
Some of the things I wish I could declare in a pyproject.toml and that would be understood/picked up by a tool like Pixi:
optional deps/extras
a mapping (or using the one from conda-forge) of pip -> conda names
a list of packages to install from conda only (e.g. nodejs)
a list of packages to install from pip only (e.g. one of the many Python packages available on PyPI but not on anaconda.org)
the channels to install the conda packages from
and basically all the arguments I may want to pass conda/mamba/pixi when it runs conda create
I would need to be able to specify the Python version I want the environment to contain. I would also need Pixi to either know how to install the library or let me declare how to do it (it sounds simple but I'm sure this is a complex topic as there are very complex packages to build out there, the ones I deal with are pretty simple).
In the HoloViz ecosystem we are Python library authors and also heavy conda users. A long, long, long time ago (before my time) the group of HoloViz maintainers built https://github.com/holoviz-dev/pyctdev, a tooling library meant to support developing a library using either conda or pip through a unified interface. While this tool has been useful to some extent, it also has failed in many ways and in practice is now only used on our CI (holoviz-dev/pyctdev#104). We're also not super fond of maintaining a Python packaging/tooling library :D (please don't use pyctdev!!!).
While pyctdev hasn't been wildly successful, I believe there's still a lot of value in making it easier to develop a Python library using conda as the env+package manager, while still allowing contributors to only use pip if they prefer. Some of the advantages given by conda are that it makes it easy to control which Python version to use and it allows installing non-Python dependencies (some of our projects require nodejs for instance).
Some of the things I wish I could declare in a pyproject.toml and that would be understood/picked up by a tool like Pixi:
optional deps/extras
a mapping (or using the one from conda-forge) of pip -> conda names
a list of packages to install from conda only (e.g. nodejs)
a list of packages to install from pip only (e.g. one of the many Python packages available on PyPI but not on anaconda.org)
the channels to install the conda packages from
and basically all the arguments I may want to pass conda/mamba/pixi when it runs conda create
I would need to be able to specify the Python version I want the environment to contain. I would also need Pixi to either know how to install the library or let me declare how to do it (it sounds simple but I'm sure this is a complex topic as there are very complex packages to build out there, the ones I deal with are pretty simple).
Activity
[-]Support pyproject as an alternative to pixi.toml[/-][+]Support `pyproject.toml` as an alternative to `pixi.toml`[/+]baszalmstra commentedon Jun 12, 2023
Related to
abkfenris commentedon Jun 16, 2023
How about putting all Python dependencies in
project.dependenciesand then having a Pixi mapping that allows overriding specific dependencies with their conda sourced counterparts?That would help a project that could be installed via PyPI and via Pixi, and allow specifying dependcies that should be installed via pip by not mapping a conda source.
baszalmstra commentedon Jun 16, 2023
I like that a lot!
dhirschfeld commentedon Jun 28, 2023
That would be useful where the packages have different names or there are constraints specified in the
pipformat instead of whatpixiexpects.You could theoretically automate that by parsing and converting the
pipconstraints and using apypi --> conda-forgemapping but easier, and just as effective, would be to allow thepipdependencies to be manually overridden as outlined above 🚀majidaldo commentedon Jul 19, 2023
how about conda/pixi just serve as a 'bootstraper' (to instally python, R, julia, npm, js) where each language can have its own way of dealing with libraries?
i used to want conda to handle all the packaging but i learned that creates constant friction.
baszalmstra commentedon Jul 20, 2023
@majidaldo we firmly believe that the conda ecosystem provides a package management solution beyond just language-specific packages. It makes it trivial to install packages for different languages and provides packages for system dependencies. Conda is an excellent replacement for docker in a lot of ways. We believe conda packages are the way forward.
Nonetheless, pixi can already easily be used as a boostrapper. Using a pixi project like this would bootstrap a python/poetry environment:
You can do a similar thing for Rust, npm, etc.
However, we are currently investigating ways to use pypi packages with pixi as well, stay tuned!
shughes-uk commentedon Aug 9, 2023
Installing poetry into the environment it manages is generally sadness inducing. It tends to do things like update it's own dependencies (which causes it crash mid update). We moved away from using
mambato manage poetry for this and usebrewinstead, just usingmambafor the python binary + some other bits.zen-xu commentedon Oct 17, 2023
@baszalmstra
But installing poetry can pollute Python's environment dependencies. Is it possible to isolate such dev-dependencies?
For example, installing dev-dependencies in
.pixi/dev-env?raceychan commentedon Nov 27, 2023
on updates on this idea?
vsoch commentedon Dec 8, 2023
I'd like to +1 some kind of support (or conversion even) from pyproject.toml. I have a protect with a pyproject.toml, with the expectation to use poetry:
For one reason or another, it tries to resolve dependencies forever on one of my machines. I'm trying out replacing it with pixi, and (in practice) I'm doing a lot of:
$ pixi add --pypi google-cloud-logging WARN pixi::project: ALPHA feature enabled!I'm not sure conversion needs to be a core feature, because there will be oodles of different formats (and likely impossible to support them all). But Perhaps a small library that is even separate, or a web interface to handle it?
Also a suggestion for the new docs - maybe default to dark mode with yellow to match the current site? The white/yellow is a bit jarring for someone like myself that lives in a bat cave. 🦇
If you like the mkdocs look but want sphinx, I like https://github.com/jbms/sphinx-immaterial. It comes with light/dark modes out of the box (with the choice to choose a default) and the yellow / marigold on dark looks pretty nice :)

And final question - is the expected workflow for developing a python package to do:
Or is there a pixi add command that says "install this local path in development mode"?
OK I think that's all the questions I have - thanks muchly!
ruben-arts commentedon Jan 8, 2024
Story update
We're still working hard on the
pypisupport, which the focus goes towards especially when you want to supportpyproject.tomlyou don't want to use other tools likepipandpoetryas they are all going to read from the same file.We're also going through some major refactors of the pixi code in the way we interact with the toml file so supporting two formats as of right now will slow down progress.
That said this feature will most likely be one we're picking up after the refactors that are planned.
Continue giving ideas to this thread so we can start on this with a good understanding of the users needs! 💯
daviskirk commentedon Jan 8, 2024
My main use case here as simple as it sounds is to not have a bunch of different files flying around our repositories.
Especially as pixi (and for that matter conda) are specialized tools that don't show up in python tutorials, installation examples and so on so python devs are used to seeing a pyproject.toml and looking into it to figure out what is going on.
I know that pixi is trying to also be a tool for non-python packages but I would assume that there are a huge amount of python devs that might be a pool for you to gain traction and more early adopters.
Managing a separate file might seem like a small thing but I actually think it might be quite important for adoption to convince devs to try out the tool.
paugier commentedon Jan 10, 2024
Personally, I have nothing against having a
pixi.tomlfile next to the standardpyproject.tomlfile. I even quite like it to have some specific Pixi configurations inpixi.tomlbecausepyproject.tomlfiles tend to be a bit too long if we include the configuration of all tools.However, I don't think it is good to have to maintain two versions of the version string in these 2 files (same for
nameanddescriptionbut this is less a problem since they don't change too much).I understood (#638 (comment)) that Pixi developers believe in "one source of truth", meaning in practice one file.
For Python projects, if we'd like only one file, it has to be
pyproject.tomland notpixi.toml.Python has a Python Packaging Authority, many related recent PEPs and a nice dynamics on packaging related to what is done by PyPA (PDM is an interesting example and IMHO Pixi should also take inspiration from this project). It's counter productive not to follow the results of this standardization effort when you can.
If you (Pixi devs) think "only one file" is important:
pyproject.toml(Supportpyproject.tomlas an alternative topixi.toml#79)pixi initshould not createpixi.tomlfor projects usingpyproject.tomlpixi.tomlhas to be deprecated for projects usingpyproject.tomljdumas commentedon Jan 10, 2024
I believe you already know about Rye, but I think it's worth re-reading about Rye's philosophy and this discussion about whether Rye should exist or not.
Personally I'd love to have a single tool support both conda package and PyPi packages that is fast and supports building Python packages using the standard
pyproject.tomlwith minimal tool-specific additions to it. Ideally the samepyproject.tomlshould be usable by PDM/Hatch/Rye/Pixi to build and upload to PyPi, and by Pixi to also build & upload to conda-forge.majidaldo commentedon Jan 10, 2024
An easier, more defined, and more stable path is for pixi to process the lock files of each programming language's "standard" way of creating them.
Let each programming language do its thing. pixi can then be some "supervisor" on top of that.
dhirschfeld commentedon Jan 11, 2024
I'd like to use
pixibut I also want to have my package installable bypipand to be able to publish functional python wheels. I'd like to be able to support that without having to specify dependencies and constraints twice in thepyproject.tomlfile.To interop smoothly with
pipit might be nice to have a package which could parse thepixidependencies and dynamically specify them forpipin the same way thathatch-requirements-txtcan parserequirements.txtfiles to dynamically specify dependencies.paugier commentedon Jan 15, 2024
Pixi dependencies are about conda packages, which are really not the same than the PyPI packages written in the list
pyproject.toml [project] dependencies.Of course, for a lot of simple cases, there is a direct correspondence between a Python wheel on PyPI and a conda package. But there are also more complicated cases, for example https://pypi.org/search/?q=pyqt5-qt5 does not exists in conda-forge.
IMHO, if you want to publish functional python wheels, you need another specialized tool (PDM, Hatch, Poetry, ...) working with PyPI packages and standard Python virtual envs.
We now have two different worlds for Python packaging:
Both are nice and have their pros and cons. For maintainers of scientific Python packages it's now good to support both frameworks.
I think Pixi could become great for the conda part and should focus on this aspect. Therefore, I'm not sure Pixi should try to also work with standard Python venvs based only on PyPI packages.
If you like Pixi, I guess you like lock files. Then you might want to try PDM for the PyPA aspect.
Some data can be shared between these 2 frameworks (in particular
[project], name, description, version). Other data should be kept separated, as for example the runtime, build, optional and dev dependencies.Of course, it would be nice to also have a simple way to specify that the conda/pixi dependencies can just be taken to be the PyPI dependencies (
[build-system] requires,[project] dependenciesand groups in[project.optional-dependencies]), which could work for simple cases, but it is a special case.dhirschfeld commentedon Jan 15, 2024
Yeah, I think I agree that it might be more trouble than it's worth 😔
You'd need pypi-specific deps, conda-specific deps, and even where there are common dependencies you'd still need to translate the package names. At that point, it's probably just easiest to maintain separate sets of dependencies.
At least having them in the same
pyproject.tomlfile would help to keep them in-sync as it would be less likely to forget to update one set.maximlt commentedon Jan 19, 2024
+1 on supporting
pyproject.tomlin Pixi!In the HoloViz ecosystem we are Python library authors and also heavy conda users. A long, long, long time ago (before my time) the group of HoloViz maintainers built https://github.com/holoviz-dev/pyctdev, a tooling library meant to support developing a library using either conda or pip through a unified interface. While this tool has been useful to some extent, it also has failed in many ways and in practice is now only used on our CI (holoviz-dev/pyctdev#104). We're also not super fond of maintaining a Python packaging/tooling library :D (please don't use pyctdev!!!).
While pyctdev hasn't been wildly successful, I believe there's still a lot of value in making it easier to develop a Python library using conda as the env+package manager, while still allowing contributors to only use pip if they prefer. Some of the advantages given by conda are that it makes it easy to control which Python version to use and it allows installing non-Python dependencies (some of our projects require nodejs for instance).
Some of the things I wish I could declare in a
pyproject.tomland that would be understood/picked up by a tool like Pixi:conda createI would need to be able to specify the Python version I want the environment to contain. I would also need Pixi to either know how to install the library or let me declare how to do it (it sounds simple but I'm sure this is a complex topic as there are very complex packages to build out there, the ones I deal with are pretty simple).
That's a pretty long wish list I know and I'm sorry! I've been looking at the conda ecosystem for a while, waiting for the replacement of pyctdev, I don't think it's yet there but have some hope Pixi might be a good candidate! Other projects I plan to explore a little more and from which some inspiration could be drawn: https://github.com/OldGrumpyViking/hatch-conda, https://github.com/macro128/pdm-conda and https://github.com/basnijholt/unidep.
majidaldo commentedon Jan 20, 2024
Check out what I did here https://github.com/pnnl/hydraconda