pytype icon indicating copy to clipboard operation
pytype copied to clipboard

Configure with pyproject.toml

Open adamchainz opened this issue 5 years ago • 2 comments

pytype currently gets its configuration from setup.cfg, but that file is technically for setuptools only, although historically many tools have used it. pyproject.toml is the new file that other tools (such as isort) are standardizing on.

It would be neat if pytype could also read from pyproject.toml, saving sharding between files and unnecessarry setup.cfg files for projects not using setuptools.

adamchainz avatar Aug 17 '20 18:08 adamchainz

Sorry for the delayed response. Supporting pyproject.toml indeed looks reasonable and useful. Looking at https://timothycrosley.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format, there are some differences between the cfg and toml formats that we'd have to figure out, but nothing looks too tricky.

rchen152 avatar Aug 21 '20 21:08 rchen152

For unrelated reasons, pytype now has a dependency on a toml parser (https://pypi.org/project/toml/), so it shouldn't be too much extra work to use that parser to also parse pyproject.toml files.

Edit: changed my mind about labeling this "good first issue" because it does require some fussing around with pytype/tools/analyze_project/config.py.

rchen152 avatar Jan 27 '21 23:01 rchen152

It has been 1 year since last update on this.

Has not pytype gained support for pyproject.toml ?

I am the maintainer of aiosmtpd, and let me tell you, the only thing preventing me from deleting setup.cfg at the moment is pytype's configuration.

Other contents of setup.cfg I have migrated to pyproject.toml, including flake8's configuration courtesy of the flake8-pyproject plugin.

pepoluan avatar Dec 21 '22 19:12 pepoluan

Sorry this has taken so long! I think I've got a working implementation of this, but most of us are out for the holidays, so it'll take a few weeks for the change to reviewed, submitted, and released.

rchen152 avatar Dec 23 '22 07:12 rchen152

Sorry this has taken so long! I think I've got a working implementation of this, but most of us are out for the holidays, so it'll take a few weeks for the change to reviewed, submitted, and released.

Awesome! Looking forward to the eventual deletion of setup.cfg

Have a great holidays to y'all !

pepoluan avatar Dec 23 '22 08:12 pepoluan

Sorry this has taken so long! I think I've got a working implementation of this, but most of us are out for the holidays, so it'll take a few weeks for the change to reviewed, submitted, and released.

Hi @rchen152: do you have any update on the status of your implementation?

bernhardkaindl avatar Jun 19 '23 18:06 bernhardkaindl

This was implemented back in January.

rchen152 avatar Jul 11 '23 16:07 rchen152