google/pytype

Configure with pyproject.toml

adamchainz opened this issue ยท 7 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.

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.

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.

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.

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.

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 !

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?

This was implemented back in January.