python-poetry / tomlkit

Style-preserving TOML library for Python
MIT License
701 stars 99 forks source link

fix(#305): generate setup.py file #306

Closed luizribeiro closed 1 year ago

luizribeiro commented 1 year ago

Since poetry 1.3.0 setup.py files are no longer generated by default. See https://python-poetry.org/blog/announcing-poetry-1.3.0/#generate-setup-file--false

This causes an issue where in order to build tomlkit we need to use poetry itself.

luizribeiro commented 1 year ago

I'm actually not 100% sure we should merge this in, but putting the PR up anyway for discussion.

The blog post linked on the PR mentions that this setting will be removed too eventually (though it doesn't hint at when that will happen), so this feels like an intermediate solution for distributions which require poetry to build pyproject.toml-based packages (which leads to the circular dependency mentioned on #305).

Thoughts?

luizribeiro commented 1 year ago

Alternatively we could switch the build system for tomlkit from using poetry to use setuptools instead with:

[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta:__legacy__"

But I'm not sure what other implications that would have.

Secrus commented 1 year ago

This is completely wrong. You don't need poetry to build tomlkit. You can use build and it will build tomlkit just fine without the need for (now considered deprecated) setup.py script.

luizribeiro commented 1 year ago

Yeah it was also clarified that you can build with poetry-core, which doesn't depend on tomlkit. Thanks @Secrus