-
Notifications
You must be signed in to change notification settings - Fork 210
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
pixi init --pyproject does not work with existing pyproject.toml file but poetry check validates status... author's line from [tool.poetry] which matches pixi.toml author's spec does not work #1687
Comments
Currently, the init operation requires the This indeeds differs from the spec (where that table is optional). This is to ensure we can get a project name (whoch is required by pixi). We could always relax this constraint, but that will create more cases to handle to infer project name from all possible situations. What do you think @tdejager ? |
Maybe just document that in the documentation as a requirement? Copying the [tool.poetry] section of the pyproject.toml up above urps on the authors field due to differing requirements:
Not looking to add complexity or relax the design principles of pixi. However, my first instinct was to copy the [tool.poetry] and use that as the project. but the author's line included in the graphrag project's pyproject.toml [tool.poetry] appears to match the approriate spec at: https://pixi.sh/latest/reference/project_configuration/#authors-optional but generates an error above when copying in the pyproject.toml.... I can delete the authors line, but at that point, I'm starting to manually mess with an existing pyproject.toml and having to hand-jam something that appears it should be working. |
Yeah, poetry are doing their own thing... |
I think it improves the experience to not error on the existing format and if it can't read it, just add what |
I agree :) |
Added If you want to get started on this, he Then tell the users the pyproject.toml is still unreadable because of some issue which would have been the result of the previous This way you can allow the user to get the info that pixi would add but allows them to manually edit the file to what they want / pixi needs. |
This Fixes #1687 and #1207 by keeping the `[project]` table optional in `pyproject.toml`. The `[project]` table had been made mandatory to make sure a name was defined. Now, the project name is read from, in order of priority - the `[tool.pixi.project]` table - the `[project]` table - the `[tool.poetry]` table The same is done for project description, version and authors. During init, if the name cannot be read from the `[project]` table or the `[tool.poetry]` table, a default name (inferred from the directory name) is added to the `[tool.pixi.project]` This PR also refactors handling of `pyproject.toml`: both pixi and non-pixi `pyproject.toml` are now read into the same `PyProjectManifest` struct, with existence checking of the `[tool.pixi.project]` table managed outside of serde when necessary. --------- Co-authored-by: Ruben Arts <[email protected]>
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
Issue description
The documentation at pixi.sh says that pixi works with existing pyproject.toml files. Poetry check works with the latest (as of this date) pull of the project. pixi however cannot parse the file at least not on Windows (if that makes any difference).
Expected behavior
I'm assuming that poetry/poe using pyproject.toml files that work should be in-scope and add pixi to the manifest without complaining about something that poetry says is valid. I would expect pixi to add the relevant sections to the pyproject.toml
I got the same behavior for an older version of pixi (0.25) and an older pull (c8aefb23cb2297dca9fb10cedbb8266e59f7029c) of the same repo. Updating the repo to the latest pull (see above) and pixi to the latest version using self-update does not make a difference.
Also, if it makes any difference, poetry is globally installed by pixi and I'm operating in windows.
The text was updated successfully, but these errors were encountered: