prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.16k stars 172 forks source link

Add support for `pixi add -f requirements.txt` #2206

Open rachfop opened 2 weeks ago

rachfop commented 2 weeks ago

Problem description

I would like to take existing Python projects which normally contains a requirements.txt file and install the libraries with pixi.

A command like:

pixi add --file <path to requirements.txt>

Would be helpful.

ruben-arts commented 1 week ago

I like the idea, I think it could be pretty beneficial for moving to pixi.

I would like to get the design a little more written out.

It should be designed to support more then only pypi requirements.txt. Some ideas I would have are:

We already support pixi init --import we could reuse that wording by making it pixi add --import.

Could you provide more input on the ideas and implementation details?

zbowling commented 1 week ago

I like the idea for dealing with legacy projects but new projects should be encouraged to update to pyproject.toml. requirements.txt is actually an imperative list of instructions that have be read top to bottom because it’s actually a list of args that pip slurps in (and new tools have to emulate pip because you can pip args in there like alternative pypi mirrors) and not actually declarative like the toml file.

ruben-arts commented 1 week ago

I agree @zbowling, thus only making it an "import" type function and not a split of information between files. A pixi.lock should only be made if the information is in the manifest.