PyO3 / pyproject-toml-rs

pyproject.toml parser in Rust
MIT License
20 stars 8 forks source link

Adding the tool table to scope #11

Open cnpryer opened 1 year ago

cnpryer commented 1 year ago

Having used pyproject-toml myself, I'd prefer this as well.

AFAIK to do this you have to add it to a wrapper around PyProjectToml, since it's specifically just core metadata currently. It'd be nice to add this to the scope.

The tool table is mentioned in both PEP 621 and PEP 518, accepted and finalized PEPs.

I'm happy to work on this once I open up some time to (if you're okay with this change, of course).

messense commented 1 year ago

I'm ok with it as long as parsing tool table to a struct in downstream is doable and easy.

konstin commented 1 year ago

There's two options here: parse the tool section into a toml Table or parse it into a user-provided T and parameterize everything with T

adamreichold commented 1 year ago

I think the Table is preferable as it can be easily transform into other Serializable types via its try_into method.

As a compromise, one could also parametrize everything on a user-defined type but at least default it to Table.

cnpryer commented 1 year ago

For visibility, I'm not yet able to snag this (or #10). I don't want to hold any progress up in case someone comes and gets to these before me. I could probably look at them this or next weekend.

If not it's definitely on my todo list, just not super high priority for what I personally need, but I'd like to see more projects using this crate. So it's up there.

Thanks for the ideas though, everyone!