Closed brettcannon closed 4 years ago
The first time I made a pyproject.toml, I used https://github.com/dephell/dephell to convert my old setup.[py|cfg] to a pyproject.toml. For a jump start, that tool may help you.
BTW, I use https://python-poetry.org/ that has a clean CLI, and a good dependency resolver (disclaimer: I only tried poetry, but it's really great).
@brettcannon Thanks for this PEP 518 (and the explanations you gave at https://testandcode.com/52)
Yes, I knew this request would come. It feels strange to need to install a third-party library in order to support a PEP, but there we are.
@vpoulailleau The request here (unless I am mistaken) is for scriv to read pyproject.toml files, not to have one for itself.
@nedbat Ah, ok… I assume this is to use pyproject.toml
as a configuration file for scriv…
But still, you might merge MANIFEST.in
, setup.cfg
, setup.py
, tox.ini
, pylintrc
(not sure for this file) into pyproject.toml
and use the poetry workflow (poetry update, poetry build, poetry publish, poetry run). It's just a suggestion, do as you want since it's your project.
Yes, the request is for scriv to read from pyproject.toml
.
And you're not the first person to make that comment about "why isn't there a TOML parser in the stdlib?", but I made that decision consciously. Ignoring the whole "which format is better" quagmire and focusing on the stdlib bit, TOML is at v1.0.0-rc.2 and adding a parser when the final 1.0 spec is close to being done seems unnecessarily rushed (the expectation is the end of the year and Pradyun who is a pip developer is a co-maintainer of TOML, so we will know when it occurs). But more importantly, when I start the discussion to add a TOML parser to the stdlib I know it will not only launch a massive discussion about which parser to pull in (or whether to write a new one from scratch), but it will start an even larger discussion about what the future of the stdlib even is.
So when TOML hits 1.0 it means I am going to lose months of my mental capacity to several centi-threads, and that's not something I'm running head-first towards while I try to clear out my current backlog. 😅
It feels strange to need to install a third-party library in order to support a PEP, but there we are.
You could add it as an extra. This would mitigate the need to have an unnecessary dependency for folks who don't really need it.
There's a [toml]
extra, though if you are using pyproject.toml, you probably already have the toml module available anyway.
This is now available in scriv 0.10.0
As the co-author of the standard for that file, I don't think this request coming from me will be much of a shock. 😉