-
Notifications
You must be signed in to change notification settings - Fork 180
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
feat: Support pyproject.toml #999
Conversation
09212b5
to
1cf93e6
Compare
6be9d69
to
2610590
Compare
Hello @olivier-lacroix and everyone following this. The team is very positive on the support for Its however not a small feat to support a second manifest. Next to this PR we would also need to support file modification for the cli commands like So we would like to take some time to design it properly. Meanwhile we would like you to continue on this PR and get it tested. I will support this PR and start testing right away. To the community: I would like to ask you to start testing this PR if you can! Again thanks for the work, we really appreciate the work from the community and hope we can get this feature to a next level, together ❤️! |
Thanks @ruben-arts ! Keen to get your feedback on the directions / choices made here as I do not know the codebase very well. It's also my first chunk of Rust code, so pretty sure things can be improved :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial thoughts, we should also add a test to make sure we support the pixi full spec in pyproject.toml. It's kinda inherited because you just read the toml table prefixed with tool.pixi
but it is a good test to make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like where this is going! But I think we need to refactor the structure a little bit more, let me explain:
Currently the manifest::Manifest
contains a kind
and a toml_edit::Document
. I would opt to move both of these fields into an enum that represents and editable source of the Manifest
. We have a lot of functions in Manifest
that modify this document but depending on whether the source is a pyproject.toml
or a pixi.toml
this will need to behave differently. To adhere to the single responsibility design I think it makes sense to move this into its own type.
e.g.:
pub enum ManifestSource {
PyProjectToml(toml_edit::Document),
PixiToml(toml_edit::Document),
}
fedad53
to
1045339
Compare
6d115dd
to
1dc569d
Compare
@baszalmstra I took your comments into account. |
@olivier-lacroix In theory all |
Yes @ruben-arts . ButI understood you wanted a test with a file that had all pixi features? |
Ah sorry I see, @olivier-lacroix. You could check |
He @olivier-lacroix, your going very fast, awesome! We've taken a good look at how we would want to implement it. The only big change for now is that we want to import the We're currently working hard on supporting pypi source dependencies. Which we also want to mix with this feature where we should install the actual project itself aswell using |
In my opinion it is ready for review! Awesome work @olivier-lacroix |
Thank you @ruben-arts ! |
@olivier-lacroix Added some documentation, let me know if it looks good. |
```yaml | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
manifest-path: pyproject.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, i'm wondering whether we should make this behavior implicit. Currently it's always running with manifest-path $PWD/pixi.toml
EDIT: let's do this discussion in prefix-dev/setup-pixi#87
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for that @ruben-arts !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure: when specifying both [tool.pixi]
in pyproject.toml
and pixi.toml
, pixi would fail?
Not sure what you mean @pavelzw ? |
When we basically define the pixi configuration two times, once in pixi.toml and once in pyproject.toml. Does pixi handle this error case or just silently ignore one config? |
It will pick |
Do you(@pavelzw) mean you want the automatic mapping @olivier-lacroix describes in: #532 ? |
Co-authored-by: Olivier Lacroix <[email protected]>
Hi all, let me know if you expect me to add anything else to this PR before merging. re. the presence of both pixi.toml and pyproject.toml, let me know if you want pixi to fail, or if documenting the current behaviour is enough (I feel like the current behaviour is OK, but that's just me :-) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small doc changes, but otherwise looks good to me!
Co-authored-by: Bas Zalmstra <[email protected]>
Co-authored-by: Bas Zalmstra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @olivier-lacroix!
Great! thank you all for your guidance & feedback! |
@olivier-lacroix we are working on a blog-post where we are also going to mention your work on |
@ruben-arts , that's very kind of you and also quite unecessary :-). my github handle is not very creative and is my firstname-lastname |
@olivier-lacroix will mention your GitHub then! If you have other socials let us know! |
Hi there,
A (very) rough and partial implementation of pyproject.toml support for pixi.
kind
field is added to theManifest
struct to differentiate between the pixi.toml and pyproject.tomlkind
is detected from the (potentially discovered) manifest filetool.pixi
part(s) as it would the content of pixi.tomlproject.requires_python
andproject.dependencies
are injected into the Manifest as conda dependencies, unless they already exist intool.pixi.dependencies
ortool.pixi.pypi_dependencies
Keen to get some early feedback before I progress any further on your interest in such a feature and on the proposed approach.
Would be further required, among others:
Handling of extras, mapping them to features & environments