Search code examples
pythonpipsetuptools

Specifying package data in pyproject.toml


I use setuptools. In setup.cfg, I can define

[options.package_data]
myModule =
    '*.csv'

to make sure that data will be installed for my users.

Can I achive the same with pyproject.toml instead?


Solution

  • if I understand your concern, you are using setuptools as a building and distributing system and you want to move some configs from setup.[py,cfg] namely package_data to pyproject.toml, if so you have to use an other tool to build and distribute your package e.g poetry as stated in @Romibuzi's answer because it's not possible unless the setuptools' team plan a new major release to include a full support of pyproject.toml and then no need for extra/standalone config setup.cfg file.

    some references:

    Update

    as per v61.0.0, setuptools brings a partial support (still in beta version) for this feature.

    refer to @LudvigH's answer. (thank you btw)