Discussed on #313.
Apparently black only supports pyproject.toml, while I always use make format and therefore don't care about where config is defined, we should make pydantic as easy for others to develop as possible.
Are there any downsides to pyproject.toml?
see here for more details.
I suspect we can't replace setup.py since it does a bunch of funky shit to build long_description for pypi.
We can replace setup.py, but if you want to replace you need to switch to the new build tool like poetry.
P.S. poetry is awesome :)
Looks like poetry isn't compatible with requirements.txt yet.
With poetry you don鈥檛 need requirements.txt (only in case of pyup...), all your deps must be defined in pyproject.toml.
sorry, I meant poetry isn't compatible with pyup, but wasn't thinking while I wrote.
You can always generate requirements.txt using poetry and keep it in repo, but it鈥檚 ugly solution.
How do we define long_description (eg. the rst which becomes the pypi page content) using poetry for deploy? I've googled it but can't see anything.
https://poetry.eustace.io/docs/pyproject/#readme
Just specify required file.
Just to add my 2 cents about choosing a new build tool, and the differences between Flit and Poetry, from what I have found about all this.
I haven't even developed a personal preference yet, but as it was a bit confusing for me, here's a summary of what I have found.
pipenv was developed with a file Pipfile (also in TOML format) to replace venv and requirements.txt at the same time. It was adopted and endorsed by PyPA (Python Package Authority, the guys that run PyPI).
They wrote the PEP about pyproject.toml, it is the new "standard" file by PyPA). It's supposed to be an alternative comparable to setup.py and setup.cfg. Not to "deprecate" them necessarily, but to make them optional. As everything is declared in a simpler configuration file, it's supposed to centralize and simplify package configuration.
Poetry and Flit both use the same pyproject.toml file, but in a slightly different way.
Flit uses it as it was intended, and so it's endorsed by PyPA, to do project building and publishing. Nothing else.
Poetry uses the same file to handle package building and publishing but also puts development dependencies in there. And it also handles development virtual environments. So, it intends to replace setup.py, setup.cfg but also Pipfile (and with that requirements.txt). And to replace venv and pipenv as commands. More like npm does in the JavaScript world. Everything is done with npm and there's a single package.json file.
Poetry creator and PyPA guys even had some arguments about all the subject.
Flit seems to be more "standard" and "endorsed", but Poetry seems to be more popular.
With Flit, the pyproject.toml file would only be replacing setup.py and setup.cfg, but Flit wouldn't care if you userequirements.txt,Pipfile` or anything else for development. It would only care about package building.
BTW, by the README, it seems like PyUP also supports Pipfiles. In that case, you could switch from setup.py to setup.cfg to pyproject.toml with Flit, and then, if you want to also update / upgrade requirements.txt, or support virtual environments integrated with development package dependencies, you could use pipenv with a Pipfile.
...actually that's what I have done locally for the recent PRs.
Again, I still can't say I have a preference between Poetry and Flit, but given what you want to keep and use in the project, it seems like Flit + Pipenv might be a good option to consider too.
Let's wait for all the tools we use (isort, pytest, coverage) to support pyproject.toml.
Currently, it looks like they don't.
Update: looks like isort (https://github.com/timothycrosley/isort/issues/705), pytest (https://github.com/pytest-dev/pytest/issues/1556, released in v6.0.0rc1), and coverage (https://github.com/nedbat/coveragepy/issues/664) all support pyproject.toml now.
Most helpful comment
Just to add my 2 cents about choosing a new build tool, and the differences between Flit and Poetry, from what I have found about all this.
I haven't even developed a personal preference yet, but as it was a bit confusing for me, here's a summary of what I have found.
pipenvwas developed with a filePipfile(also in TOML format) to replacevenvandrequirements.txtat the same time. It was adopted and endorsed by PyPA (Python Package Authority, the guys that run PyPI).They wrote the PEP about
pyproject.toml, it is the new "standard" file by PyPA). It's supposed to be an alternative comparable tosetup.pyandsetup.cfg. Not to "deprecate" them necessarily, but to make them optional. As everything is declared in a simpler configuration file, it's supposed to centralize and simplify package configuration.Poetry and Flit both use the same
pyproject.tomlfile, but in a slightly different way.Flit uses it as it was intended, and so it's endorsed by PyPA, to do project building and publishing. Nothing else.
Poetry uses the same file to handle package building and publishing but also puts development dependencies in there. And it also handles development virtual environments. So, it intends to replace
setup.py,setup.cfgbut alsoPipfile(and with thatrequirements.txt). And to replacevenvandpipenvas commands. More likenpmdoes in the JavaScript world. Everything is done withnpmand there's a singlepackage.jsonfile.Poetry creator and PyPA guys even had some arguments about all the subject.
Flit seems to be more "standard" and "endorsed", but Poetry seems to be more popular.
With Flit, the
pyproject.tomlfile would only be replacingsetup.pyand setup.cfg, but Flit wouldn't care if you userequirements.txt,Pipfile` or anything else for development. It would only care about package building.